Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Fix inheritance from non-tensor #709

Merged
merged 2 commits into from
Mar 13, 2024
Merged

[BugFix] Fix inheritance from non-tensor #709

merged 2 commits into from
Mar 13, 2024

Conversation

vmoens
Copy link
Contributor

@vmoens vmoens commented Mar 13, 2024

No description provided.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 13, 2024
@vmoens vmoens added the bug Something isn't working label Mar 13, 2024
@vmoens vmoens changed the title fix-non-tensor [BugFix] Fix inheritance from non-tensor Mar 13, 2024
Copy link

github-actions bot commented Mar 13, 2024

$\color{#D29922}\textsf{\Large⚠\kern{0.2cm}\normalsize Warning}$ Result of CPU Benchmark Tests

Total Benchmarks: 127. Improved: $\large\color{#35bf28}21$. Worsened: $\large\color{#d91a1a}6$.

Expand to view detailed results
Name Max Mean Ops Ops on Repo HEAD Change
test_plain_set_nested 31.3990μs 16.0055μs 62.4786 KOps/s 59.3870 KOps/s $\textbf{\color{#35bf28}+5.21\%}$
test_plain_set_stack_nested 37.5000μs 16.2344μs 61.5975 KOps/s 58.6873 KOps/s $\color{#35bf28}+4.96\%$
test_plain_set_nested_inplace 46.9980μs 18.1347μs 55.1429 KOps/s 52.3774 KOps/s $\textbf{\color{#35bf28}+5.28\%}$
test_plain_set_stack_nested_inplace 59.4820μs 18.1648μs 55.0514 KOps/s 52.1241 KOps/s $\textbf{\color{#35bf28}+5.62\%}$
test_items 27.3410μs 2.4047μs 415.8457 KOps/s 411.8455 KOps/s $\color{#35bf28}+0.97\%$
test_items_nested 0.4777ms 0.2714ms 3.6845 KOps/s 3.7902 KOps/s $\color{#d91a1a}-2.79\%$
test_items_nested_locked 1.3438ms 0.2694ms 3.7122 KOps/s 3.7568 KOps/s $\color{#d91a1a}-1.19\%$
test_items_nested_leaf 0.3022ms 0.1653ms 6.0494 KOps/s 6.0927 KOps/s $\color{#d91a1a}-0.71\%$
test_items_stack_nested 0.3383ms 0.2718ms 3.6790 KOps/s 3.7603 KOps/s $\color{#d91a1a}-2.16\%$
test_items_stack_nested_leaf 1.1810ms 0.1697ms 5.8923 KOps/s 6.0698 KOps/s $\color{#d91a1a}-2.92\%$
test_items_stack_nested_locked 0.4598ms 0.2713ms 3.6856 KOps/s 3.7244 KOps/s $\color{#d91a1a}-1.04\%$
test_keys 33.8330μs 6.0779μs 164.5300 KOps/s 254.7618 KOps/s $\textbf{\color{#d91a1a}-35.42\%}$
test_keys_nested 2.2479ms 0.1450ms 6.8974 KOps/s 6.8215 KOps/s $\color{#35bf28}+1.11\%$
test_keys_nested_locked 0.3234ms 0.1484ms 6.7385 KOps/s 6.6562 KOps/s $\color{#35bf28}+1.24\%$
test_keys_nested_leaf 33.5171ms 0.1330ms 7.5202 KOps/s 7.8778 KOps/s $\color{#d91a1a}-4.54\%$
test_keys_stack_nested 0.2741ms 0.1499ms 6.6732 KOps/s 6.7330 KOps/s $\color{#d91a1a}-0.89\%$
test_keys_stack_nested_leaf 0.2365ms 0.1309ms 7.6404 KOps/s 7.7616 KOps/s $\color{#d91a1a}-1.56\%$
test_keys_stack_nested_locked 0.2160ms 0.1548ms 6.4583 KOps/s 6.5398 KOps/s $\color{#d91a1a}-1.25\%$
test_values 8.3783μs 1.1690μs 855.4378 KOps/s 773.6921 KOps/s $\textbf{\color{#35bf28}+10.57\%}$
test_values_nested 0.1099ms 51.5100μs 19.4137 KOps/s 19.4300 KOps/s $\color{#d91a1a}-0.08\%$
test_values_nested_locked 93.9060μs 51.6327μs 19.3676 KOps/s 19.4209 KOps/s $\color{#d91a1a}-0.27\%$
test_values_nested_leaf 85.8010μs 46.0945μs 21.6946 KOps/s 21.5079 KOps/s $\color{#35bf28}+0.87\%$
test_values_stack_nested 0.1090ms 53.2548μs 18.7777 KOps/s 19.2114 KOps/s $\color{#d91a1a}-2.26\%$
test_values_stack_nested_leaf 85.9610μs 46.2153μs 21.6378 KOps/s 21.3423 KOps/s $\color{#35bf28}+1.38\%$
test_values_stack_nested_locked 97.7720μs 53.7065μs 18.6197 KOps/s 19.2129 KOps/s $\color{#d91a1a}-3.09\%$
test_membership 15.2990μs 1.3535μs 738.8465 KOps/s 741.3256 KOps/s $\color{#d91a1a}-0.33\%$
test_membership_nested 35.6170μs 3.5015μs 285.5907 KOps/s 295.3529 KOps/s $\color{#d91a1a}-3.31\%$
test_membership_nested_leaf 43.0520μs 3.4872μs 286.7652 KOps/s 294.2222 KOps/s $\color{#d91a1a}-2.53\%$
test_membership_stacked_nested 16.2700μs 3.4650μs 288.6006 KOps/s 248.1067 KOps/s $\textbf{\color{#35bf28}+16.32\%}$
test_membership_stacked_nested_leaf 22.9830μs 3.4866μs 286.8133 KOps/s 294.3223 KOps/s $\color{#d91a1a}-2.55\%$
test_membership_nested_last 29.6460μs 4.2899μs 233.1076 KOps/s 237.2738 KOps/s $\color{#d91a1a}-1.76\%$
test_membership_nested_leaf_last 31.7000μs 4.3135μs 231.8292 KOps/s 235.5081 KOps/s $\color{#d91a1a}-1.56\%$
test_membership_stacked_nested_last 30.1260μs 6.2459μs 160.1044 KOps/s 187.7056 KOps/s $\textbf{\color{#d91a1a}-14.70\%}$
test_membership_stacked_nested_leaf_last 21.3900μs 6.2975μs 158.7943 KOps/s 188.4832 KOps/s $\textbf{\color{#d91a1a}-15.75\%}$
test_nested_getleaf 34.8350μs 10.5225μs 95.0346 KOps/s 94.5686 KOps/s $\color{#35bf28}+0.49\%$
test_nested_get 37.7100μs 9.9086μs 100.9227 KOps/s 100.1994 KOps/s $\color{#35bf28}+0.72\%$
test_stacked_getleaf 34.0840μs 10.3535μs 96.5855 KOps/s 95.4987 KOps/s $\color{#35bf28}+1.14\%$
test_stacked_get 45.5450μs 9.7710μs 102.3435 KOps/s 99.7037 KOps/s $\color{#35bf28}+2.65\%$
test_nested_getitemleaf 43.1910μs 11.1109μs 90.0018 KOps/s 91.4212 KOps/s $\color{#d91a1a}-1.55\%$
test_nested_getitem 34.0840μs 10.2601μs 97.4645 KOps/s 96.8268 KOps/s $\color{#35bf28}+0.66\%$
test_stacked_getitemleaf 36.8690μs 10.9810μs 91.0664 KOps/s 91.2399 KOps/s $\color{#d91a1a}-0.19\%$
test_stacked_getitem 38.1810μs 10.1413μs 98.6062 KOps/s 97.5268 KOps/s $\color{#35bf28}+1.11\%$
test_lock_nested 0.6866ms 0.3288ms 3.0412 KOps/s 2.9880 KOps/s $\color{#35bf28}+1.78\%$
test_lock_stack_nested 0.4473ms 0.2905ms 3.4419 KOps/s 3.3544 KOps/s $\color{#35bf28}+2.61\%$
test_unlock_nested 81.6093ms 0.4173ms 2.3963 KOps/s 2.3504 KOps/s $\color{#35bf28}+1.95\%$
test_unlock_stack_nested 0.4790ms 0.3023ms 3.3076 KOps/s 3.2581 KOps/s $\color{#35bf28}+1.52\%$
test_flatten_speed 0.6394ms 0.2591ms 3.8594 KOps/s 3.8574 KOps/s $\color{#35bf28}+0.05\%$
test_unflatten_speed 0.6965ms 0.3973ms 2.5167 KOps/s 2.5094 KOps/s $\color{#35bf28}+0.29\%$
test_common_ops 1.2453ms 0.6798ms 1.4710 KOps/s 1.4282 KOps/s $\color{#35bf28}+3.00\%$
test_creation 23.3040μs 1.8903μs 529.0211 KOps/s 520.7652 KOps/s $\color{#35bf28}+1.59\%$
test_creation_empty 31.5300μs 9.4464μs 105.8606 KOps/s 91.9381 KOps/s $\textbf{\color{#35bf28}+15.14\%}$
test_creation_nested_1 31.6190μs 12.0530μs 82.9667 KOps/s 74.5810 KOps/s $\textbf{\color{#35bf28}+11.24\%}$
test_creation_nested_2 55.0730μs 15.4355μs 64.7857 KOps/s 60.3622 KOps/s $\textbf{\color{#35bf28}+7.33\%}$
test_clone 60.9640μs 13.0638μs 76.5474 KOps/s 76.0667 KOps/s $\color{#35bf28}+0.63\%$
test_getitem[int] 27.4810μs 10.9832μs 91.0478 KOps/s 89.1295 KOps/s $\color{#35bf28}+2.15\%$
test_getitem[slice_int] 50.2840μs 21.8958μs 45.6710 KOps/s 44.4168 KOps/s $\color{#35bf28}+2.82\%$
test_getitem[range] 0.1293ms 40.9936μs 24.3941 KOps/s 24.0782 KOps/s $\color{#35bf28}+1.31\%$
test_getitem[tuple] 57.1570μs 18.1394μs 55.1285 KOps/s 53.6437 KOps/s $\color{#35bf28}+2.77\%$
test_getitem[list] 0.2770ms 36.2017μs 27.6230 KOps/s 27.3717 KOps/s $\color{#35bf28}+0.92\%$
test_setitem_dim[int] 85.5200μs 33.6158μs 29.7479 KOps/s 28.2259 KOps/s $\textbf{\color{#35bf28}+5.39\%}$
test_setitem_dim[slice_int] 0.1324ms 59.4040μs 16.8339 KOps/s 16.1939 KOps/s $\color{#35bf28}+3.95\%$
test_setitem_dim[range] 0.1452ms 77.0842μs 12.9728 KOps/s 12.2556 KOps/s $\textbf{\color{#35bf28}+5.85\%}$
test_setitem_dim[tuple] 0.1315ms 49.0609μs 20.3828 KOps/s 19.8033 KOps/s $\color{#35bf28}+2.93\%$
test_setitem 94.1060μs 18.9481μs 52.7757 KOps/s 49.4801 KOps/s $\textbf{\color{#35bf28}+6.66\%}$
test_set 89.9080μs 18.3786μs 54.4112 KOps/s 50.3954 KOps/s $\textbf{\color{#35bf28}+7.97\%}$
test_set_shared 4.3293ms 0.1412ms 7.0816 KOps/s 7.1597 KOps/s $\color{#d91a1a}-1.09\%$
test_update 97.4530μs 20.9696μs 47.6880 KOps/s 43.9065 KOps/s $\textbf{\color{#35bf28}+8.61\%}$
test_update_nested 0.1194ms 28.7690μs 34.7596 KOps/s 33.0384 KOps/s $\textbf{\color{#35bf28}+5.21\%}$
test_update__nested 0.1022ms 25.1170μs 39.8137 KOps/s 41.4842 KOps/s $\color{#d91a1a}-4.03\%$
test_set_nested 67.6370μs 20.3162μs 49.2217 KOps/s 46.5391 KOps/s $\textbf{\color{#35bf28}+5.76\%}$
test_set_nested_new 0.9198ms 24.3378μs 41.0884 KOps/s 39.7488 KOps/s $\color{#35bf28}+3.37\%$
test_select 0.1240ms 39.1855μs 25.5196 KOps/s 24.8398 KOps/s $\color{#35bf28}+2.74\%$
test_select_nested 0.1190ms 58.2726μs 17.1607 KOps/s 17.1552 KOps/s $\color{#35bf28}+0.03\%$
test_exclude_nested 0.2741ms 0.1189ms 8.4078 KOps/s 8.4400 KOps/s $\color{#d91a1a}-0.38\%$
test_empty[True] 0.6670ms 0.4030ms 2.4815 KOps/s 2.5015 KOps/s $\color{#d91a1a}-0.80\%$
test_empty[False] 7.7004μs 1.0481μs 954.1225 KOps/s 970.7890 KOps/s $\color{#d91a1a}-1.72\%$
test_unbind_speed 0.2874ms 0.2430ms 4.1149 KOps/s 4.1038 KOps/s $\color{#35bf28}+0.27\%$
test_unbind_speed_stack0 0.3589ms 0.2340ms 4.2740 KOps/s 4.1575 KOps/s $\color{#35bf28}+2.80\%$
test_unbind_speed_stack1 0.1284s 0.6542ms 1.5286 KOps/s 1.6694 KOps/s $\textbf{\color{#d91a1a}-8.44\%}$
test_split 0.1267s 1.6228ms 616.2283 Ops/s 605.0711 Ops/s $\color{#35bf28}+1.84\%$
test_chunk 1.6676ms 1.4383ms 695.2517 Ops/s 682.2926 Ops/s $\color{#35bf28}+1.90\%$
test_creation[device0] 0.1721ms 0.1012ms 9.8857 KOps/s 9.5033 KOps/s $\color{#35bf28}+4.02\%$
test_creation_from_tensor 4.2758ms 82.7820μs 12.0799 KOps/s 11.9157 KOps/s $\color{#35bf28}+1.38\%$
test_add_one[memmap_tensor0] 0.1061ms 5.3240μs 187.8297 KOps/s 185.6647 KOps/s $\color{#35bf28}+1.17\%$
test_contiguous[memmap_tensor0] 14.7780μs 0.6480μs 1.5431 MOps/s 1.5142 MOps/s $\color{#35bf28}+1.91\%$
test_stack[memmap_tensor0] 41.3070μs 3.5969μs 278.0134 KOps/s 279.2132 KOps/s $\color{#d91a1a}-0.43\%$
test_memmaptd_index 1.0314ms 0.2345ms 4.2645 KOps/s 4.1640 KOps/s $\color{#35bf28}+2.41\%$
test_memmaptd_index_astensor 0.7057ms 0.2922ms 3.4229 KOps/s 3.2975 KOps/s $\color{#35bf28}+3.80\%$
test_memmaptd_index_op 1.7851ms 0.5716ms 1.7495 KOps/s 1.6234 KOps/s $\textbf{\color{#35bf28}+7.77\%}$
test_serialize_model 0.2148s 0.1152s 8.6789 Ops/s 8.2914 Ops/s $\color{#35bf28}+4.67\%$
test_serialize_model_pickle 0.4467s 0.3749s 2.6673 Ops/s 2.6135 Ops/s $\color{#35bf28}+2.06\%$
test_serialize_weights 0.1082s 97.1331ms 10.2952 Ops/s 9.9712 Ops/s $\color{#35bf28}+3.25\%$
test_serialize_weights_returnearly 0.4501s 0.1669s 5.9926 Ops/s 6.9761 Ops/s $\textbf{\color{#d91a1a}-14.10\%}$
test_serialize_weights_pickle 0.7512s 0.5023s 1.9907 Ops/s 2.3955 Ops/s $\textbf{\color{#d91a1a}-16.90\%}$
test_serialize_weights_filesystem 96.3156ms 91.4392ms 10.9362 Ops/s 10.4985 Ops/s $\color{#35bf28}+4.17\%$
test_serialize_model_filesystem 0.1043s 93.9384ms 10.6453 Ops/s 10.6765 Ops/s $\color{#d91a1a}-0.29\%$
test_reshape_pytree 55.6940μs 20.9824μs 47.6589 KOps/s 47.6172 KOps/s $\color{#35bf28}+0.09\%$
test_reshape_td 64.5310μs 31.1405μs 32.1125 KOps/s 31.7518 KOps/s $\color{#35bf28}+1.14\%$
test_view_pytree 49.9330μs 20.8338μs 47.9990 KOps/s 47.8027 KOps/s $\color{#35bf28}+0.41\%$
test_view_td 0.1275s 59.4260μs 16.8277 KOps/s 15.8612 KOps/s $\textbf{\color{#35bf28}+6.09\%}$
test_unbind_pytree 54.3920μs 24.3361μs 41.0912 KOps/s 41.5365 KOps/s $\color{#d91a1a}-1.07\%$
test_unbind_td 0.1125ms 35.8202μs 27.9172 KOps/s 27.7626 KOps/s $\color{#35bf28}+0.56\%$
test_split_pytree 0.1112ms 23.7566μs 42.0936 KOps/s 42.7986 KOps/s $\color{#d91a1a}-1.65\%$
test_split_td 0.5108ms 39.8534μs 25.0919 KOps/s 25.0255 KOps/s $\color{#35bf28}+0.27\%$
test_add_pytree 77.6660μs 29.1437μs 34.3127 KOps/s 34.3970 KOps/s $\color{#d91a1a}-0.25\%$
test_add_td 0.1332ms 53.4881μs 18.6957 KOps/s 18.3184 KOps/s $\color{#35bf28}+2.06\%$
test_distributed 0.1819ms 97.9771μs 10.2065 KOps/s 9.8517 KOps/s $\color{#35bf28}+3.60\%$
test_tdmodule 64.3700μs 17.3447μs 57.6546 KOps/s 55.3077 KOps/s $\color{#35bf28}+4.24\%$
test_tdmodule_dispatch 57.8480μs 32.3504μs 30.9115 KOps/s 29.2498 KOps/s $\textbf{\color{#35bf28}+5.68\%}$
test_tdseq 35.3870μs 19.7086μs 50.7392 KOps/s 49.0277 KOps/s $\color{#35bf28}+3.49\%$
test_tdseq_dispatch 63.3890μs 37.3801μs 26.7522 KOps/s 25.3337 KOps/s $\textbf{\color{#35bf28}+5.60\%}$
test_instantiation_functorch 2.9484ms 1.3055ms 765.9682 Ops/s 760.9644 Ops/s $\color{#35bf28}+0.66\%$
test_instantiation_td 5.6294ms 0.9944ms 1.0056 KOps/s 995.8318 Ops/s $\color{#35bf28}+0.99\%$
test_exec_functorch 0.4117ms 0.1557ms 6.4243 KOps/s 6.3702 KOps/s $\color{#35bf28}+0.85\%$
test_exec_functional_call 0.3619ms 0.1442ms 6.9371 KOps/s 6.8691 KOps/s $\color{#35bf28}+0.99\%$
test_exec_td 0.2567ms 0.1374ms 7.2766 KOps/s 7.1312 KOps/s $\color{#35bf28}+2.04\%$
test_exec_td_decorator 0.5994ms 0.1868ms 5.3532 KOps/s 5.2607 KOps/s $\color{#35bf28}+1.76\%$
test_vmap_mlp_speed[True-True] 0.6681ms 0.4536ms 2.2045 KOps/s 2.1180 KOps/s $\color{#35bf28}+4.08\%$
test_vmap_mlp_speed[True-False] 0.8791ms 0.4550ms 2.1980 KOps/s 2.1204 KOps/s $\color{#35bf28}+3.66\%$
test_vmap_mlp_speed[False-True] 0.6016ms 0.3646ms 2.7427 KOps/s 2.6010 KOps/s $\textbf{\color{#35bf28}+5.45\%}$
test_vmap_mlp_speed[False-False] 0.5720ms 0.3667ms 2.7270 KOps/s 2.5812 KOps/s $\textbf{\color{#35bf28}+5.65\%}$
test_vmap_mlp_speed_decorator[True-True] 1.0362ms 0.4776ms 2.0939 KOps/s 2.0210 KOps/s $\color{#35bf28}+3.61\%$
test_vmap_mlp_speed_decorator[True-False] 0.8018ms 0.4792ms 2.0870 KOps/s 2.0086 KOps/s $\color{#35bf28}+3.90\%$
test_vmap_mlp_speed_decorator[False-True] 0.6774ms 0.3899ms 2.5649 KOps/s 2.4626 KOps/s $\color{#35bf28}+4.15\%$
test_vmap_mlp_speed_decorator[False-False] 0.5911ms 0.3883ms 2.5752 KOps/s 2.4622 KOps/s $\color{#35bf28}+4.59\%$
test_to_module_speed[True] 2.7451ms 1.3677ms 731.1641 Ops/s 742.8470 Ops/s $\color{#d91a1a}-1.57\%$
test_to_module_speed[False] 1.8449ms 1.3361ms 748.4336 Ops/s 750.1030 Ops/s $\color{#d91a1a}-0.22\%$

@vmoens vmoens merged commit 6a56ecd into main Mar 13, 2024
42 of 47 checks passed
@vmoens vmoens deleted the fix-non-tensor branch March 13, 2024 09:53
vmoens added a commit that referenced this pull request Mar 24, 2024
vmoens added a commit that referenced this pull request Mar 24, 2024
vmoens added a commit that referenced this pull request Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants