[Performance] Optimize RedisTensorDict indexed ops with GETRANGE/SETRANGE - #1569
Open
vmoens wants to merge 1 commit into
Open
[Performance] Optimize RedisTensorDict indexed ops with GETRANGE/SETRANGE#1569vmoens wants to merge 1 commit into
vmoens wants to merge 1 commit into
Conversation
This was referenced Feb 14, 2026
Contributor
|
| Name | Max | Mean | Ops | Ops on Repo HEAD
|
Change |
|---|---|---|---|---|---|
| test_plain_set_nested | 40.5310μs | 14.2467μs | 70.1916 KOps/s | 69.3666 KOps/s | |
| test_plain_set_stack_nested | 39.0710μs | 14.7981μs | 67.5761 KOps/s | 68.5691 KOps/s | |
| test_plain_set_nested_inplace | 37.5610μs | 16.0422μs | 62.3354 KOps/s | 61.8765 KOps/s | |
| test_plain_set_stack_nested_inplace | 54.1610μs | 15.9690μs | 62.6214 KOps/s | 62.3059 KOps/s | |
| test_items | 28.8910μs | 5.4621μs | 183.0803 KOps/s | 182.8977 KOps/s | |
| test_items_nested | 0.5667ms | 0.5184ms | 1.9291 KOps/s | 1.9389 KOps/s | |
| test_items_nested_locked | 0.5682ms | 0.5228ms | 1.9129 KOps/s | 1.9168 KOps/s | |
| test_items_nested_leaf | 0.1303ms | 91.1995μs | 10.9650 KOps/s | 10.9466 KOps/s | |
| test_items_stack_nested | 0.5800ms | 0.5232ms | 1.9112 KOps/s | 1.9325 KOps/s | |
| test_items_stack_nested_leaf | 0.1231ms | 90.7184μs | 11.0231 KOps/s | 10.9891 KOps/s | |
| test_items_stack_nested_locked | 0.5758ms | 0.5268ms | 1.8982 KOps/s | 1.9255 KOps/s | |
| test_keys | 31.6210μs | 4.1571μs | 240.5536 KOps/s | 242.8898 KOps/s | |
| test_keys_nested | 0.1604ms | 0.1162ms | 8.6051 KOps/s | 8.5351 KOps/s | |
| test_keys_nested_locked | 88.2214ms | 0.1383ms | 7.2329 KOps/s | 7.9264 KOps/s | |
| test_keys_nested_leaf | 0.1478ms | 0.1078ms | 9.2732 KOps/s | 9.3079 KOps/s | |
| test_keys_stack_nested | 0.1626ms | 0.1177ms | 8.4956 KOps/s | 8.4508 KOps/s | |
| test_keys_stack_nested_leaf | 0.1583ms | 0.1080ms | 9.2561 KOps/s | 9.2188 KOps/s | |
| test_keys_stack_nested_locked | 0.1698ms | 0.1259ms | 7.9423 KOps/s | 7.8917 KOps/s | |
| test_values | 5.0220μs | 1.0031μs | 996.8999 KOps/s | 1.0079 MOps/s | |
| test_values_nested | 79.9310μs | 46.0356μs | 21.7223 KOps/s | 21.2180 KOps/s | |
| test_values_nested_locked | 83.6610μs | 49.5139μs | 20.1963 KOps/s | 19.9385 KOps/s | |
| test_values_nested_leaf | 84.3910μs | 52.5949μs | 19.0132 KOps/s | 18.7779 KOps/s | |
| test_values_stack_nested | 76.2510μs | 46.2636μs | 21.6152 KOps/s | 21.3295 KOps/s | |
| test_values_stack_nested_leaf | 85.9810μs | 52.9659μs | 18.8801 KOps/s | 18.8070 KOps/s | |
| test_values_stack_nested_locked | 0.1235ms | 49.9336μs | 20.0266 KOps/s | 19.9839 KOps/s | |
| test_membership | 3.9767μs | 0.8078μs | 1.2379 MOps/s | 1.2408 MOps/s | |
| test_membership_nested | 23.7000μs | 3.0078μs | 332.4717 KOps/s | 335.0471 KOps/s | |
| test_membership_nested_leaf | 24.9610μs | 2.9922μs | 334.2035 KOps/s | 335.5441 KOps/s | |
| test_membership_stacked_nested | 25.0600μs | 3.0578μs | 327.0336 KOps/s | 334.1205 KOps/s | |
| test_membership_stacked_nested_leaf | 27.1200μs | 3.0051μs | 332.7647 KOps/s | 336.9863 KOps/s | |
| test_membership_nested_last | 39.9000μs | 4.3675μs | 228.9635 KOps/s | 228.2591 KOps/s | |
| test_membership_nested_leaf_last | 34.1510μs | 4.4108μs | 226.7168 KOps/s | 228.7518 KOps/s | |
| test_membership_stacked_nested_last | 27.1510μs | 4.3384μs | 230.5016 KOps/s | 228.0407 KOps/s | |
| test_membership_stacked_nested_leaf_last | 21.2910μs | 4.4017μs | 227.1859 KOps/s | 229.2469 KOps/s | |
| test_nested_getleaf | 49.1810μs | 20.8614μs | 47.9355 KOps/s | 48.4651 KOps/s | |
| test_nested_get | 46.4110μs | 19.7555μs | 50.6187 KOps/s | 51.7056 KOps/s | |
| test_stacked_getleaf | 59.4510μs | 20.5939μs | 48.5581 KOps/s | 47.4522 KOps/s | |
| test_stacked_get | 46.2510μs | 19.6330μs | 50.9346 KOps/s | 50.2267 KOps/s | |
| test_nested_getitemleaf | 44.0010μs | 21.2454μs | 47.0691 KOps/s | 47.2729 KOps/s | |
| test_nested_getitem | 45.2410μs | 20.0072μs | 49.9820 KOps/s | 49.4021 KOps/s | |
| test_stacked_getitemleaf | 47.2800μs | 21.3582μs | 46.8205 KOps/s | 46.7361 KOps/s | |
| test_stacked_getitem | 51.0500μs | 20.2584μs | 49.3623 KOps/s | 49.9792 KOps/s | |
| test_lock_nested | 7.7730ms | 0.4590ms | 2.1785 KOps/s | 2.1920 KOps/s | |
| test_lock_stack_nested | 0.5107ms | 0.4563ms | 2.1914 KOps/s | 2.1772 KOps/s | |
| test_unlock_nested | 0.4453ms | 0.3631ms | 2.7537 KOps/s | 2.7429 KOps/s | |
| test_unlock_stack_nested | 0.4184ms | 0.3670ms | 2.7248 KOps/s | 2.6914 KOps/s | |
| test_flatten_speed | 0.1671ms | 0.1165ms | 8.5833 KOps/s | 8.5833 KOps/s | |
| test_unflatten_speed | 0.6468ms | 0.5728ms | 1.7457 KOps/s | 1.7591 KOps/s | |
| test_common_ops | 0.8454ms | 0.6661ms | 1.5012 KOps/s | 1.4746 KOps/s | |
| test_creation | 0.1261ms | 2.7532μs | 363.2136 KOps/s | 363.6732 KOps/s | |
| test_creation_empty | 35.1100μs | 5.7968μs | 172.5091 KOps/s | 174.0597 KOps/s | |
| test_creation_nested_1 | 47.5710μs | 10.3790μs | 96.3487 KOps/s | 96.5742 KOps/s | |
| test_creation_nested_2 | 35.5000μs | 11.3539μs | 88.0754 KOps/s | 89.4928 KOps/s | |
| test_creation_many_keys[10] | 45.3010μs | 17.0923μs | 58.5057 KOps/s | 58.2044 KOps/s | |
| test_creation_many_keys[50] | 0.1397ms | 71.7088μs | 13.9453 KOps/s | 13.8609 KOps/s | |
| test_creation_many_keys[100] | 0.1731ms | 0.1417ms | 7.0569 KOps/s | 7.0709 KOps/s | |
| test_creation_nested_many_keys[10] | 70.3820μs | 36.8037μs | 27.1712 KOps/s | 27.3796 KOps/s | |
| test_creation_nested_many_keys[50] | 0.2026ms | 0.1475ms | 6.7814 KOps/s | 6.7616 KOps/s | |
| test_clone | 51.0510μs | 12.9504μs | 77.2180 KOps/s | 76.3317 KOps/s | |
| test_getitem[int] | 1.6486ms | 14.1005μs | 70.9194 KOps/s | 60.4884 KOps/s | |
| test_getitem[slice_int] | 0.1333ms | 24.2091μs | 41.3067 KOps/s | 41.3230 KOps/s | |
| test_getitem[range] | 0.1807ms | 59.7649μs | 16.7322 KOps/s | 16.6317 KOps/s | |
| test_getitem[tuple] | 0.1448ms | 23.7134μs | 42.1702 KOps/s | 42.5757 KOps/s | |
| test_getitem[list] | 0.1858ms | 55.1278μs | 18.1397 KOps/s | 17.5095 KOps/s | |
| test_setitem_dim[int] | 44.6510μs | 25.2032μs | 39.6774 KOps/s | 39.6376 KOps/s | |
| test_setitem_dim[slice_int] | 65.1110μs | 43.1106μs | 23.1961 KOps/s | 23.0490 KOps/s | |
| test_setitem_dim[range] | 0.1234ms | 90.9543μs | 10.9945 KOps/s | 10.5364 KOps/s | |
| test_setitem_dim[tuple] | 62.1410μs | 40.2041μs | 24.8731 KOps/s | 24.1505 KOps/s | |
| test_setitem | 60.5110μs | 17.4177μs | 57.4129 KOps/s | 55.8044 KOps/s | |
| test_set | 56.0910μs | 16.6867μs | 59.9281 KOps/s | 58.5996 KOps/s | |
| test_set_shared | 0.5141ms | 0.2010ms | 4.9747 KOps/s | 4.9158 KOps/s | |
| test_update | 0.2056ms | 21.6982μs | 46.0867 KOps/s | 45.7162 KOps/s | |
| test_update_nested | 75.9010μs | 33.7164μs | 29.6591 KOps/s | 29.4013 KOps/s | |
| test_update__nested | 0.4599ms | 33.3835μs | 29.9549 KOps/s | 29.3370 KOps/s | |
| test_set_nested | 49.0810μs | 18.8468μs | 53.0593 KOps/s | 52.5022 KOps/s | |
| test_set_nested_new | 59.3810μs | 23.7572μs | 42.0925 KOps/s | 41.4146 KOps/s | |
| test_select | 73.3810μs | 40.6467μs | 24.6022 KOps/s | 24.0827 KOps/s | |
| test_select_nested | 0.1005ms | 71.8988μs | 13.9084 KOps/s | 14.1124 KOps/s | |
| test_exclude_nested | 0.1338ms | 93.0832μs | 10.7431 KOps/s | 10.8376 KOps/s | |
| test_empty[True] | 0.4593ms | 0.4221ms | 2.3694 KOps/s | 2.3805 KOps/s | |
| test_empty[False] | 8.1178μs | 1.2697μs | 787.6042 KOps/s | 784.7480 KOps/s | |
| test_to | 0.1030ms | 71.1299μs | 14.0588 KOps/s | 13.9978 KOps/s | |
| test_to_nonblocking | 0.1089ms | 65.8287μs | 15.1909 KOps/s | 15.7120 KOps/s | |
| test_unbind_speed | 0.3584ms | 0.3128ms | 3.1966 KOps/s | 3.1994 KOps/s | |
| test_unbind_speed_stack0 | 0.3766ms | 0.3093ms | 3.2335 KOps/s | 3.2140 KOps/s | |
| test_unbind_speed_stack1 | 0.1021s | 0.8867ms | 1.1277 KOps/s | 1.1183 KOps/s | |
| test_split | 1.1611ms | 1.0963ms | 912.1734 Ops/s | 917.6228 Ops/s | |
| test_chunk | 0.1023s | 1.1561ms | 864.9475 Ops/s | 792.0064 Ops/s | |
| test_to_cpu_blocking | 28.5301ms | 28.3432ms | 35.2818 Ops/s | 35.5344 Ops/s | |
| test_to_cpu_global_sync | 11.2551ms | 11.1139ms | 89.9771 Ops/s | 91.0730 Ops/s | |
| test_to_cpu_event_sync | 0.1144s | 13.3025ms | 75.1738 Ops/s | 83.8341 Ops/s | |
| test_to_cpu_default | 12.3467ms | 12.0886ms | 82.7224 Ops/s | 83.7815 Ops/s | |
| test_consolidate[False-None] | 4.0474ms | 3.9257ms | 254.7290 Ops/s | 226.1802 Ops/s | |
| test_consolidate[default-None] | 2.0449ms | 1.9418ms | 514.9872 Ops/s | 500.6764 Ops/s | |
| test_consolidate[reduce-overhead-None] | 1.9448ms | 1.8680ms | 535.3331 Ops/s | 523.2026 Ops/s | |
| test_consolidate_njt[False-None] | 8.5061ms | 8.1518ms | 122.6726 Ops/s | 120.0306 Ops/s | |
| test_to[False-False-None] | 2.1194ms | 2.0202ms | 495.0067 Ops/s | 490.2334 Ops/s | |
| test_to[True-False-None] | 2.2021ms | 1.8802ms | 531.8668 Ops/s | 529.9025 Ops/s | |
| test_to[within-False-None] | 6.1548ms | 5.8135ms | 172.0137 Ops/s | 168.5372 Ops/s | |
| test_to[True-default-None] | 7.4971ms | 7.4008ms | 135.1214 Ops/s | 134.8441 Ops/s | |
| test_to_njt[False-False-None] | 8.3943ms | 8.3206ms | 120.1832 Ops/s | 119.0109 Ops/s | |
| test_to_njt[True-False-None] | 7.2470ms | 7.0351ms | 142.1448 Ops/s | 145.4462 Ops/s | |
| test_to_njt[within-False-None] | 15.8660ms | 15.2625ms | 65.5199 Ops/s | 65.4507 Ops/s | |
| test_creation[device0] | 0.4116ms | 0.1151ms | 8.6868 KOps/s | 8.6360 KOps/s | |
| test_creation_from_tensor | 0.4624ms | 0.1111ms | 8.9976 KOps/s | 8.8595 KOps/s | |
| test_add_one[memmap_tensor0] | 0.3799ms | 6.2234μs | 160.6845 KOps/s | 155.5961 KOps/s | |
| test_contiguous[memmap_tensor0] | 25.4100μs | 0.6166μs | 1.6217 MOps/s | 2.2944 MOps/s | |
| test_stack[memmap_tensor0] | 33.6610μs | 4.3993μs | 227.3103 KOps/s | 219.7163 KOps/s | |
| test_memmaptd_index | 0.9996ms | 0.2549ms | 3.9225 KOps/s | 4.0253 KOps/s | |
| test_memmaptd_index_astensor | 0.5191ms | 0.3439ms | 2.9080 KOps/s | 2.9471 KOps/s | |
| test_memmaptd_index_op | 0.8465ms | 0.5786ms | 1.7283 KOps/s | 1.7012 KOps/s | |
| test_serialize_model | 0.3063s | 0.1596s | 6.2644 Ops/s | 7.4309 Ops/s | |
| test_serialize_model_pickle | 1.3493s | 1.2131s | 0.8243 Ops/s | 0.8259 Ops/s | |
| test_serialize_weights | 0.1366s | 0.1349s | 7.4147 Ops/s | 7.4083 Ops/s | |
| test_serialize_weights_returnearly | 0.4402s | 90.7821ms | 11.0154 Ops/s | 6.0302 Ops/s | |
| test_serialize_weights_pickle | 1.3685s | 1.2328s | 0.8112 Ops/s | 0.8216 Ops/s | |
| test_reshape_pytree | 0.2169ms | 32.0815μs | 31.1706 KOps/s | 31.1412 KOps/s | |
| test_reshape_td | 85.9920μs | 41.9506μs | 23.8376 KOps/s | 23.2675 KOps/s | |
| test_view_pytree | 0.2214ms | 31.6544μs | 31.5911 KOps/s | 31.4023 KOps/s | |
| test_view_td | 97.4220μs | 49.7729μs | 20.0913 KOps/s | 19.7000 KOps/s | |
| test_unbind_pytree | 0.2630ms | 35.8597μs | 27.8864 KOps/s | 27.8849 KOps/s | |
| test_unbind_td | 0.1980ms | 46.0279μs | 21.7259 KOps/s | 21.0408 KOps/s | |
| test_split_pytree | 0.1966ms | 40.2902μs | 24.8200 KOps/s | 24.6427 KOps/s | |
| test_split_td | 0.1653ms | 61.6320μs | 16.2253 KOps/s | 16.1515 KOps/s | |
| test_add_pytree | 0.2363ms | 41.1639μs | 24.2931 KOps/s | 24.8055 KOps/s | |
| test_add_td | 96.3320μs | 51.9106μs | 19.2639 KOps/s | 19.2891 KOps/s | |
| test_compile_add_one_nested[tensordict-compile] | 0.1978ms | 0.1377ms | 7.2606 KOps/s | 6.8456 KOps/s | |
| test_compile_add_one_nested[tensordict-eager] | 0.2948ms | 0.1883ms | 5.3101 KOps/s | 5.3930 KOps/s | |
| test_compile_add_one_nested[pytree-compile] | 0.1489ms | 0.1054ms | 9.4917 KOps/s | 9.2899 KOps/s | |
| test_compile_add_one_nested[pytree-eager] | 0.4247ms | 0.1744ms | 5.7335 KOps/s | 5.7327 KOps/s | |
| test_compile_copy_nested[tensordict-compile] | 98.3710μs | 28.7450μs | 34.7887 KOps/s | 30.4887 KOps/s | |
| test_compile_copy_nested[tensordict-eager] | 0.1022ms | 49.2531μs | 20.3033 KOps/s | 19.9755 KOps/s | |
| test_compile_copy_nested[pytree-compile] | 35.0110μs | 9.4363μs | 105.9735 KOps/s | 103.6726 KOps/s | |
| test_compile_copy_nested[pytree-eager] | 0.4581ms | 66.1751μs | 15.1114 KOps/s | 15.0991 KOps/s | |
| test_compile_add_one_flat[tensordict-compile] | 0.2494ms | 0.1735ms | 5.7628 KOps/s | 5.4837 KOps/s | |
| test_compile_add_one_flat[tensordict-eager] | 0.3015ms | 0.2494ms | 4.0096 KOps/s | 3.9857 KOps/s | |
| test_compile_add_one_flat[tensorclass-compile] | 0.1969ms | 0.1146ms | 8.7223 KOps/s | 8.4653 KOps/s | |
| test_compile_add_one_flat[tensorclass-eager] | 0.1208ms | 69.1968μs | 14.4515 KOps/s | 14.6811 KOps/s | |
| test_compile_add_one_flat[pytree-compile] | 0.2475ms | 0.1557ms | 6.4206 KOps/s | 3.7333 KOps/s | |
| test_compile_add_one_flat[pytree-eager] | 0.8228ms | 0.5170ms | 1.9344 KOps/s | 1.9249 KOps/s | |
| test_compile_add_self_flat[tensordict-eager] | 0.4246ms | 0.3014ms | 3.3179 KOps/s | 3.2628 KOps/s | |
| test_compile_add_self_flat[tensordict-compile] | 0.2454ms | 0.1755ms | 5.6969 KOps/s | 5.2617 KOps/s | |
| test_compile_add_self_flat[tensorclass-eager] | 0.1313ms | 84.8197μs | 11.7897 KOps/s | 11.8189 KOps/s | |
| test_compile_add_self_flat[tensorclass-compile] | 0.1927ms | 0.1178ms | 8.4885 KOps/s | 8.1486 KOps/s | |
| test_compile_add_self_flat[pytree-eager] | 0.1752s | 0.5016ms | 1.9935 KOps/s | 2.3021 KOps/s | |
| test_compile_add_self_flat[pytree-compile] | 0.2371ms | 0.1580ms | 6.3296 KOps/s | 6.2330 KOps/s | |
| test_compile_copy_flat[tensordict-compile] | 56.4300μs | 23.2837μs | 42.9485 KOps/s | 39.4497 KOps/s | |
| test_compile_copy_flat[tensordict-eager] | 72.6910μs | 39.6122μs | 25.2448 KOps/s | 24.4976 KOps/s | |
| test_compile_copy_flat[pytree-compile] | 0.1019ms | 10.5306μs | 94.9614 KOps/s | 95.3688 KOps/s | |
| test_compile_copy_flat[pytree-eager] | 0.3979ms | 50.9612μs | 19.6228 KOps/s | 19.5739 KOps/s | |
| test_compile_assign_and_add[tensordict-compile] | 1.9456ms | 0.1696ms | 5.8948 KOps/s | 5.4648 KOps/s | |
| test_compile_assign_and_add[tensordict-eager] | 3.4443ms | 3.2457ms | 308.0961 Ops/s | 305.2397 Ops/s | |
| test_compile_assign_and_add[pytree-compile] | 1.9076ms | 0.1575ms | 6.3489 KOps/s | 6.1583 KOps/s | |
| test_compile_assign_and_add[pytree-eager] | 2.8915ms | 2.7447ms | 364.3406 Ops/s | 361.9130 Ops/s | |
| test_compile_indexing[tensor-tensordict-compile] | 0.1791ms | 0.1060ms | 9.4300 KOps/s | 8.9639 KOps/s | |
| test_compile_indexing[tensor-tensordict-eager] | 0.3115ms | 71.6452μs | 13.9577 KOps/s | 14.0317 KOps/s | |
| test_compile_indexing[tensor-tensorclass-compile] | 0.1503ms | 93.8617μs | 10.6540 KOps/s | 10.3919 KOps/s | |
| test_compile_indexing[tensor-tensorclass-eager] | 0.2588ms | 47.1844μs | 21.1934 KOps/s | 22.5673 KOps/s | |
| test_compile_indexing[tensor-pytree-compile] | 0.1648ms | 96.7259μs | 10.3385 KOps/s | 10.1190 KOps/s | |
| test_compile_indexing[tensor-pytree-eager] | 0.2875ms | 46.9233μs | 21.3114 KOps/s | 22.3963 KOps/s | |
| test_compile_indexing[slice-tensordict-compile] | 0.1055ms | 55.9236μs | 17.8815 KOps/s | 17.7520 KOps/s | |
| test_compile_indexing[slice-tensordict-eager] | 0.2266ms | 27.1102μs | 36.8864 KOps/s | 36.9063 KOps/s | |
| test_compile_indexing[slice-tensorclass-compile] | 83.7310μs | 44.1433μs | 22.6535 KOps/s | 22.6185 KOps/s | |
| test_compile_indexing[slice-tensorclass-eager] | 0.2640ms | 21.8560μs | 45.7541 KOps/s | 45.0940 KOps/s | |
| test_compile_indexing[slice-pytree-compile] | 93.3310μs | 45.6705μs | 21.8960 KOps/s | 22.1292 KOps/s | |
| test_compile_indexing[slice-pytree-eager] | 0.3076ms | 21.9364μs | 45.5863 KOps/s | 45.4992 KOps/s | |
| test_compile_indexing[int-tensordict-compile] | 0.1014ms | 56.1394μs | 17.8128 KOps/s | 17.2712 KOps/s | |
| test_compile_indexing[int-tensordict-eager] | 0.3025ms | 26.9764μs | 37.0694 KOps/s | 37.7781 KOps/s | |
| test_compile_indexing[int-tensorclass-compile] | 89.4010μs | 44.8188μs | 22.3121 KOps/s | 21.3597 KOps/s | |
| test_compile_indexing[int-tensorclass-eager] | 0.2562ms | 21.7083μs | 46.0654 KOps/s | 45.6185 KOps/s | |
| test_compile_indexing[int-pytree-compile] | 96.3220μs | 45.4794μs | 21.9880 KOps/s | 22.0419 KOps/s | |
| test_compile_indexing[int-pytree-eager] | 0.2581ms | 21.5801μs | 46.3390 KOps/s | 45.8095 KOps/s | |
| test_mod_add[eager] | 95.1720μs | 49.5202μs | 20.1938 KOps/s | 19.8506 KOps/s | |
| test_mod_add[compile] | 0.1762ms | 0.1013ms | 9.8688 KOps/s | 9.6024 KOps/s | |
| test_mod_add[compile-overhead] | 0.3331ms | 0.1452ms | 6.8867 KOps/s | 6.8018 KOps/s | |
| test_mod_wrap[eager] | 0.3798ms | 0.2972ms | 3.3651 KOps/s | 3.4786 KOps/s | |
| test_mod_wrap[compile] | 0.4128ms | 0.3575ms | 2.7971 KOps/s | 2.7810 KOps/s | |
| test_mod_wrap[compile-overhead] | 7.4676ms | 4.0879ms | 244.6240 Ops/s | 255.1583 Ops/s | |
| test_mod_wrap_and_backward[eager] | 1.5771ms | 1.4658ms | 682.2419 Ops/s | 673.2628 Ops/s | |
| test_mod_wrap_and_backward[compile] | 1.4749ms | 1.4146ms | 706.9083 Ops/s | 699.9132 Ops/s | |
| test_mod_wrap_and_backward[compile-overhead] | 1.2093ms | 0.8553ms | 1.1691 KOps/s | 1.1356 KOps/s | |
| test_seq_add[eager] | 0.2099ms | 0.1527ms | 6.5481 KOps/s | 6.4373 KOps/s | |
| test_seq_add[compile] | 0.1941ms | 0.1112ms | 8.9894 KOps/s | 8.6141 KOps/s | |
| test_seq_add[compile-overhead] | 0.3907ms | 0.1561ms | 6.4064 KOps/s | 6.4572 KOps/s | |
| test_seq_wrap[eager] | 0.6227ms | 0.5334ms | 1.8747 KOps/s | 1.9188 KOps/s | |
| test_seq_wrap[compile] | 0.4489ms | 0.3581ms | 2.7924 KOps/s | 2.7482 KOps/s | |
| test_seq_wrap[compile-overhead] | 0.3224ms | 0.2567ms | 3.8962 KOps/s | 3.8241 KOps/s | |
| test_func_call_runtime[False-eager] | 0.8897ms | 0.8210ms | 1.2181 KOps/s | 1.2039 KOps/s | |
| test_func_call_runtime[False-compile] | 1.0744ms | 0.8842ms | 1.1310 KOps/s | 1.1188 KOps/s | |
| test_func_call_runtime[False-compile-overhead] | 0.5781ms | 0.4391ms | 2.2774 KOps/s | 2.2348 KOps/s | |
| test_func_call_runtime[True-eager] | 1.1339ms | 1.0480ms | 954.2052 Ops/s | 934.1078 Ops/s | |
| test_func_call_runtime[True-compile] | 0.9724ms | 0.8962ms | 1.1158 KOps/s | 1.0964 KOps/s | |
| test_func_call_runtime[True-compile-overhead] | 0.5279ms | 0.4545ms | 2.2002 KOps/s | 2.1505 KOps/s | |
| test_func_call_cm_runtime[False-eager] | 0.8776ms | 0.8182ms | 1.2222 KOps/s | 1.2077 KOps/s | |
| test_func_call_cm_runtime[False-compile] | 0.9996ms | 0.8838ms | 1.1315 KOps/s | 1.1083 KOps/s | |
| test_func_call_cm_runtime[False-compile-overhead] | 0.5311ms | 0.4432ms | 2.2566 KOps/s | 2.2266 KOps/s | |
| test_func_call_cm_runtime[True-eager] | 1.2725ms | 1.1884ms | 841.4352 Ops/s | 825.3611 Ops/s | |
| test_func_call_cm_runtime[True-compile] | 0.9783ms | 0.9302ms | 1.0751 KOps/s | 1.0573 KOps/s | |
| test_func_call_cm_runtime[True-compile-overhead] | 0.5412ms | 0.4847ms | 2.0632 KOps/s | 2.0028 KOps/s | |
| test_vmap_func_call_cm_runtime[eager] | 2.8087ms | 2.3129ms | 432.3565 Ops/s | 425.6697 Ops/s | |
| test_vmap_func_call_cm_runtime[compile] | 1.0552ms | 0.9462ms | 1.0569 KOps/s | 1.0427 KOps/s | |
| test_vmap_func_call_cm_runtime[compile-overhead] | 0.5607ms | 0.4917ms | 2.0337 KOps/s | 1.9824 KOps/s | |
| test_distributed | 0.6439ms | 0.1515ms | 6.5989 KOps/s | 5.8941 KOps/s | |
| test_tdmodule | 63.6510μs | 27.2480μs | 36.6999 KOps/s | 35.7514 KOps/s | |
| test_tdmodule_dispatch | 75.1510μs | 44.9035μs | 22.2700 KOps/s | 21.9246 KOps/s | |
| test_tdseq | 61.2810μs | 27.2950μs | 36.6367 KOps/s | 36.3691 KOps/s | |
| test_tdseq_dispatch | 75.5410μs | 47.9090μs | 20.8729 KOps/s | 20.6665 KOps/s | |
| test_instantiation_functorch | 2.0363ms | 1.9700ms | 507.6160 Ops/s | 503.2743 Ops/s | |
| test_exec_functorch | 0.2133ms | 0.1732ms | 5.7736 KOps/s | 5.6417 KOps/s | |
| test_exec_functional_call | 0.2252ms | 0.1561ms | 6.4050 KOps/s | 6.0445 KOps/s | |
| test_exec_td_decorator | 0.4275ms | 0.2263ms | 4.4187 KOps/s | 4.1721 KOps/s | |
| test_vmap_mlp_speed_decorator[True-True] | 0.9986ms | 0.8033ms | 1.2449 KOps/s | 1.2246 KOps/s | |
| test_vmap_mlp_speed_decorator[True-False] | 0.9723ms | 0.8012ms | 1.2481 KOps/s | 1.2213 KOps/s | |
| test_vmap_mlp_speed_decorator[False-True] | 0.8620ms | 0.6940ms | 1.4410 KOps/s | 1.4035 KOps/s | |
| test_vmap_mlp_speed_decorator[False-False] | 0.8658ms | 0.6948ms | 1.4393 KOps/s | 1.4062 KOps/s | |
| test_vmap_transformer_speed_decorator[True-True] | 20.2005ms | 20.1107ms | 49.7248 Ops/s | 49.2897 Ops/s | |
| test_vmap_transformer_speed_decorator[True-False] | 20.2547ms | 20.1061ms | 49.7362 Ops/s | 49.0655 Ops/s | |
| test_vmap_transformer_speed_decorator[False-True] | 20.0109ms | 19.9133ms | 50.2176 Ops/s | 49.7220 Ops/s | |
| test_vmap_transformer_speed_decorator[False-False] | 20.4869ms | 19.9370ms | 50.1581 Ops/s | 49.6106 Ops/s | |
| test_to_module_speed[True] | 2.0366ms | 1.4162ms | 706.0962 Ops/s | 703.4613 Ops/s | |
| test_to_module_speed[False] | 1.4800ms | 1.3858ms | 721.6142 Ops/s | 715.4531 Ops/s | |
| test_tc_init | 79.8310μs | 45.1628μs | 22.1421 KOps/s | 22.0692 KOps/s | |
| test_tc_init_tensor_only | 35.3200μs | 9.4974μs | 105.2922 KOps/s | 106.7457 KOps/s | |
| test_tc_init_nested | 0.1222ms | 89.3190μs | 11.1958 KOps/s | 11.1889 KOps/s | |
| test_tc_init_many_fields | 42.5210μs | 15.7644μs | 63.4340 KOps/s | 63.4791 KOps/s | |
| test_tc_first_layer_tensor | 26.0200μs | 1.7597μs | 568.2947 KOps/s | 582.4694 KOps/s | |
| test_tc_first_layer_tensor_only | 4.6087μs | 0.7151μs | 1.3984 MOps/s | 1.4110 MOps/s | |
| test_tc_first_layer_tensor_set | 31.6610μs | 3.9940μs | 250.3735 KOps/s | 253.2787 KOps/s | |
| test_tc_first_layer_tensor_only_set | 20.3510μs | 3.0142μs | 331.7617 KOps/s | 332.1530 KOps/s | |
| test_tc_first_layer_nontensor | 34.5600μs | 5.9016μs | 169.4454 KOps/s | 172.3298 KOps/s | |
| test_tc_second_layer_tensor | 31.4510μs | 4.1950μs | 238.3763 KOps/s | 244.7838 KOps/s | |
| test_tc_second_layer_nontensor | 37.0110μs | 8.2862μs | 120.6821 KOps/s | 120.6607 KOps/s | |
| test_unbind | 0.2439s | 13.7011ms | 72.9868 Ops/s | 73.1016 Ops/s | |
| test_full_like | 5.2748ms | 4.3724ms | 228.7054 Ops/s | 135.0083 Ops/s | |
| test_zeros_like | 4.4868ms | 4.3467ms | 230.0599 Ops/s | 229.6096 Ops/s | |
| test_ones_like | 4.7553ms | 4.3538ms | 229.6845 Ops/s | 229.3751 Ops/s | |
| test_clone | 6.5632ms | 6.3545ms | 157.3693 Ops/s | 156.7462 Ops/s | |
| test_squeeze | 0.1995ms | 14.0153μs | 71.3507 KOps/s | 71.7935 KOps/s | |
| test_unsqueeze | 0.2777ms | 0.1109ms | 9.0205 KOps/s | 9.2932 KOps/s | |
| test_split | 0.2312ms | 0.1764ms | 5.6684 KOps/s | 5.5045 KOps/s | |
| test_permute | 0.2596ms | 0.1985ms | 5.0386 KOps/s | 4.9910 KOps/s | |
| test_stack | 51.3813ms | 51.0873ms | 19.5743 Ops/s | 19.6871 Ops/s | |
| test_cat | 51.4907ms | 51.0968ms | 19.5707 Ops/s | 18.9357 Ops/s |
Contributor
|
| Name | Max | Mean | Ops | Ops on Repo HEAD
|
Change |
|---|---|---|---|---|---|
| test_plain_set_nested | 44.1100μs | 14.4409μs | 69.2477 KOps/s | 69.7311 KOps/s | |
| test_plain_set_stack_nested | 48.1310μs | 14.6201μs | 68.3991 KOps/s | 68.2213 KOps/s | |
| test_plain_set_nested_inplace | 52.4410μs | 15.9620μs | 62.6487 KOps/s | 62.8121 KOps/s | |
| test_plain_set_stack_nested_inplace | 43.1000μs | 15.9021μs | 62.8846 KOps/s | 62.4034 KOps/s | |
| test_items | 35.9600μs | 5.5509μs | 180.1495 KOps/s | 180.4080 KOps/s | |
| test_items_nested | 0.5677ms | 0.5190ms | 1.9268 KOps/s | 2.0033 KOps/s | |
| test_items_nested_locked | 0.6028ms | 0.5180ms | 1.9305 KOps/s | 1.9638 KOps/s | |
| test_items_nested_leaf | 0.1205ms | 91.4170μs | 10.9389 KOps/s | 10.9052 KOps/s | |
| test_items_stack_nested | 0.5799ms | 0.5243ms | 1.9073 KOps/s | 1.9622 KOps/s | |
| test_items_stack_nested_leaf | 0.1316ms | 91.6622μs | 10.9096 KOps/s | 11.0298 KOps/s | |
| test_items_stack_nested_locked | 0.6349ms | 0.5266ms | 1.8989 KOps/s | 1.9447 KOps/s | |
| test_keys | 37.1900μs | 4.1497μs | 240.9784 KOps/s | 241.2259 KOps/s | |
| test_keys_nested | 0.1476ms | 0.1172ms | 8.5301 KOps/s | 8.4791 KOps/s | |
| test_keys_nested_locked | 88.7388ms | 0.1377ms | 7.2627 KOps/s | 7.9455 KOps/s | |
| test_keys_nested_leaf | 0.1451ms | 0.1079ms | 9.2707 KOps/s | 9.2694 KOps/s | |
| test_keys_stack_nested | 0.1635ms | 0.1181ms | 8.4656 KOps/s | 8.4829 KOps/s | |
| test_keys_stack_nested_leaf | 0.1530ms | 0.1097ms | 9.1153 KOps/s | 9.2515 KOps/s | |
| test_keys_stack_nested_locked | 0.1761ms | 0.1258ms | 7.9494 KOps/s | 7.9599 KOps/s | |
| test_values | 6.2302μs | 1.0004μs | 999.5676 KOps/s | 1.0114 MOps/s | |
| test_values_nested | 76.1720μs | 46.3432μs | 21.5781 KOps/s | 21.4768 KOps/s | |
| test_values_nested_locked | 0.1039ms | 49.1373μs | 20.3511 KOps/s | 20.2464 KOps/s | |
| test_values_nested_leaf | 85.6610μs | 52.0554μs | 19.2103 KOps/s | 18.8525 KOps/s | |
| test_values_stack_nested | 91.9720μs | 46.5951μs | 21.4615 KOps/s | 21.4799 KOps/s | |
| test_values_stack_nested_leaf | 80.0420μs | 52.3870μs | 19.0887 KOps/s | 18.9385 KOps/s | |
| test_values_stack_nested_locked | 82.3120μs | 49.0373μs | 20.3926 KOps/s | 20.2728 KOps/s | |
| test_membership | 5.4850μs | 0.7945μs | 1.2586 MOps/s | 1.2485 MOps/s | |
| test_membership_nested | 33.7210μs | 2.9772μs | 335.8880 KOps/s | 335.6085 KOps/s | |
| test_membership_nested_leaf | 32.1110μs | 2.9725μs | 336.4216 KOps/s | 334.4789 KOps/s | |
| test_membership_stacked_nested | 27.6600μs | 2.9991μs | 333.4357 KOps/s | 334.2539 KOps/s | |
| test_membership_stacked_nested_leaf | 26.3010μs | 2.9886μs | 334.6000 KOps/s | 339.1020 KOps/s | |
| test_membership_nested_last | 37.1610μs | 4.3828μs | 228.1641 KOps/s | 232.8454 KOps/s | |
| test_membership_nested_leaf_last | 34.2400μs | 4.3692μs | 228.8773 KOps/s | 229.6747 KOps/s | |
| test_membership_stacked_nested_last | 21.2800μs | 4.3477μs | 230.0062 KOps/s | 229.6230 KOps/s | |
| test_membership_stacked_nested_leaf_last | 63.6920μs | 4.3245μs | 231.2387 KOps/s | 229.8359 KOps/s | |
| test_nested_getleaf | 49.8910μs | 20.6552μs | 48.4139 KOps/s | 47.9498 KOps/s | |
| test_nested_get | 68.9510μs | 19.3340μs | 51.7224 KOps/s | 50.0782 KOps/s | |
| test_stacked_getleaf | 59.3310μs | 20.8749μs | 47.9045 KOps/s | 48.4168 KOps/s | |
| test_stacked_get | 52.4910μs | 19.6760μs | 50.8234 KOps/s | 50.4293 KOps/s | |
| test_nested_getitemleaf | 44.0300μs | 21.4163μs | 46.6934 KOps/s | 46.4630 KOps/s | |
| test_nested_getitem | 43.8210μs | 20.0806μs | 49.7994 KOps/s | 49.7187 KOps/s | |
| test_stacked_getitemleaf | 54.5910μs | 21.1989μs | 47.1723 KOps/s | 46.4984 KOps/s | |
| test_stacked_getitem | 0.4060ms | 19.9304μs | 50.1746 KOps/s | 49.3602 KOps/s | |
| test_lock_nested | 7.9294ms | 0.4570ms | 2.1881 KOps/s | 2.2061 KOps/s | |
| test_lock_stack_nested | 0.5038ms | 0.4546ms | 2.1998 KOps/s | 2.1890 KOps/s | |
| test_unlock_nested | 0.4613ms | 0.3629ms | 2.7554 KOps/s | 2.7393 KOps/s | |
| test_unlock_stack_nested | 0.4375ms | 0.3667ms | 2.7267 KOps/s | 2.6975 KOps/s | |
| test_flatten_speed | 0.2021ms | 0.1158ms | 8.6346 KOps/s | 8.6290 KOps/s | |
| test_unflatten_speed | 0.6565ms | 0.5621ms | 1.7789 KOps/s | 1.7763 KOps/s | |
| test_common_ops | 0.8037ms | 0.6759ms | 1.4796 KOps/s | 1.4781 KOps/s | |
| test_creation | 78.8320μs | 2.7578μs | 362.6051 KOps/s | 372.7543 KOps/s | |
| test_creation_empty | 31.2400μs | 5.9863μs | 167.0482 KOps/s | 175.2116 KOps/s | |
| test_creation_nested_1 | 42.5310μs | 10.5127μs | 95.1227 KOps/s | 98.4594 KOps/s | |
| test_creation_nested_2 | 41.2710μs | 11.6375μs | 85.9288 KOps/s | 89.8675 KOps/s | |
| test_creation_many_keys[10] | 52.7110μs | 17.1824μs | 58.1991 KOps/s | 59.0217 KOps/s | |
| test_creation_many_keys[50] | 0.1057ms | 73.2274μs | 13.6561 KOps/s | 13.8889 KOps/s | |
| test_creation_many_keys[100] | 0.1936ms | 0.1428ms | 7.0030 KOps/s | 7.1594 KOps/s | |
| test_creation_nested_many_keys[10] | 72.0110μs | 37.1962μs | 26.8844 KOps/s | 27.7959 KOps/s | |
| test_creation_nested_many_keys[50] | 0.1934ms | 0.1500ms | 6.6662 KOps/s | 6.8175 KOps/s | |
| test_clone | 37.7000μs | 12.8314μs | 77.9340 KOps/s | 76.0836 KOps/s | |
| test_getitem[int] | 1.7942ms | 14.0076μs | 71.3896 KOps/s | 58.3531 KOps/s | |
| test_getitem[slice_int] | 0.1404ms | 23.8320μs | 41.9604 KOps/s | 41.9487 KOps/s | |
| test_getitem[range] | 0.1700ms | 59.6326μs | 16.7694 KOps/s | 16.6715 KOps/s | |
| test_getitem[tuple] | 0.1437ms | 23.1468μs | 43.2026 KOps/s | 43.1347 KOps/s | |
| test_getitem[list] | 0.1742ms | 54.5472μs | 18.3328 KOps/s | 17.0748 KOps/s | |
| test_setitem_dim[int] | 43.7000μs | 25.1355μs | 39.7843 KOps/s | 37.8639 KOps/s | |
| test_setitem_dim[slice_int] | 82.7410μs | 43.0041μs | 23.2536 KOps/s | 22.4445 KOps/s | |
| test_setitem_dim[range] | 0.1377ms | 90.4927μs | 11.0506 KOps/s | 10.5705 KOps/s | |
| test_setitem_dim[tuple] | 62.9610μs | 40.3157μs | 24.8042 KOps/s | 24.5827 KOps/s | |
| test_setitem | 48.3810μs | 17.4576μs | 57.2816 KOps/s | 55.4087 KOps/s | |
| test_set | 43.2310μs | 16.3622μs | 61.1163 KOps/s | 58.5309 KOps/s | |
| test_set_shared | 0.5096ms | 0.2025ms | 4.9376 KOps/s | 4.7671 KOps/s | |
| test_update | 0.3637ms | 21.5408μs | 46.4234 KOps/s | 44.1834 KOps/s | |
| test_update_nested | 67.3210μs | 33.3784μs | 29.9595 KOps/s | 30.0046 KOps/s | |
| test_update__nested | 0.4889ms | 33.2621μs | 30.0642 KOps/s | 29.8187 KOps/s | |
| test_set_nested | 48.0400μs | 18.7143μs | 53.4350 KOps/s | 52.9053 KOps/s | |
| test_set_nested_new | 65.0310μs | 23.7481μs | 42.1086 KOps/s | 41.7898 KOps/s | |
| test_select | 85.7120μs | 40.7222μs | 24.5566 KOps/s | 24.6279 KOps/s | |
| test_select_nested | 0.1032ms | 71.3926μs | 14.0071 KOps/s | 13.9995 KOps/s | |
| test_exclude_nested | 0.1467ms | 92.6975μs | 10.7878 KOps/s | 10.9497 KOps/s | |
| test_empty[True] | 0.4574ms | 0.4190ms | 2.3866 KOps/s | 2.4082 KOps/s | |
| test_empty[False] | 7.7275μs | 1.2565μs | 795.8349 KOps/s | 793.3449 KOps/s | |
| test_to | 0.1013ms | 69.9886μs | 14.2880 KOps/s | 14.0441 KOps/s | |
| test_to_nonblocking | 0.1023ms | 63.4415μs | 15.7626 KOps/s | 15.9486 KOps/s | |
| test_unbind_speed | 0.3730ms | 0.3154ms | 3.1705 KOps/s | 3.2278 KOps/s | |
| test_unbind_speed_stack0 | 0.3653ms | 0.3089ms | 3.2372 KOps/s | 3.2590 KOps/s | |
| test_unbind_speed_stack1 | 0.1037s | 0.8770ms | 1.1403 KOps/s | 1.1298 KOps/s | |
| test_split | 1.1481ms | 1.0814ms | 924.7442 Ops/s | 927.5798 Ops/s | |
| test_chunk | 0.1053s | 1.1655ms | 858.0368 Ops/s | 969.2281 Ops/s | |
| test_to_cpu_blocking | 28.0710ms | 27.8055ms | 35.9641 Ops/s | 50.7541 Ops/s | |
| test_to_cpu_global_sync | 11.0723ms | 10.9505ms | 91.3197 Ops/s | 91.2401 Ops/s | |
| test_to_cpu_event_sync | 0.1149s | 13.0188ms | 76.8120 Ops/s | 84.7320 Ops/s | |
| test_to_cpu_default | 12.0361ms | 11.8043ms | 84.7150 Ops/s | 84.6958 Ops/s | |
| test_consolidate[False-None] | 4.1002ms | 3.9357ms | 254.0823 Ops/s | 229.2798 Ops/s | |
| test_consolidate[default-None] | 2.3579ms | 1.9126ms | 522.8496 Ops/s | 498.3273 Ops/s | |
| test_consolidate[reduce-overhead-None] | 2.2864ms | 1.8488ms | 540.9058 Ops/s | 519.5979 Ops/s | |
| test_consolidate_njt[False-None] | 8.3883ms | 7.9649ms | 125.5509 Ops/s | 121.1063 Ops/s | |
| test_to[False-False-None] | 2.3735ms | 1.9588ms | 510.5246 Ops/s | 497.0080 Ops/s | |
| test_to[True-False-None] | 2.2592ms | 1.8328ms | 545.6202 Ops/s | 538.0812 Ops/s | |
| test_to[within-False-None] | 6.2184ms | 5.8094ms | 172.1356 Ops/s | 168.8788 Ops/s | |
| test_to[True-default-None] | 0.1792s | 8.4417ms | 118.4600 Ops/s | 129.5884 Ops/s | |
| test_to_njt[False-False-None] | 8.3953ms | 8.1864ms | 122.1542 Ops/s | 117.4720 Ops/s | |
| test_to_njt[True-False-None] | 6.7046ms | 6.5625ms | 152.3813 Ops/s | 140.5294 Ops/s | |
| test_to_njt[within-False-None] | 14.7463ms | 14.5785ms | 68.5943 Ops/s | 63.8017 Ops/s | |
| test_creation[device0] | 0.3415ms | 0.1133ms | 8.8237 KOps/s | 8.5791 KOps/s | |
| test_creation_from_tensor | 0.4058ms | 0.1122ms | 8.9153 KOps/s | 8.9277 KOps/s | |
| test_add_one[memmap_tensor0] | 0.2597ms | 6.2829μs | 159.1612 KOps/s | 158.3481 KOps/s | |
| test_contiguous[memmap_tensor0] | 26.1010μs | 0.6130μs | 1.6313 MOps/s | 2.3276 MOps/s | |
| test_stack[memmap_tensor0] | 57.4210μs | 4.3299μs | 230.9502 KOps/s | 223.6072 KOps/s | |
| test_memmaptd_index | 1.1795ms | 0.2515ms | 3.9756 KOps/s | 4.0091 KOps/s | |
| test_memmaptd_index_astensor | 0.4953ms | 0.3411ms | 2.9318 KOps/s | 2.9426 KOps/s | |
| test_memmaptd_index_op | 0.9113ms | 0.5863ms | 1.7057 KOps/s | 1.7310 KOps/s | |
| test_serialize_model | 0.1375s | 0.1360s | 7.3533 Ops/s | 7.3226 Ops/s | |
| test_serialize_model_pickle | 1.3642s | 1.2132s | 0.8242 Ops/s | 0.8264 Ops/s | |
| test_serialize_weights | 0.1381s | 0.1362s | 7.3444 Ops/s | 7.4026 Ops/s | |
| test_serialize_weights_returnearly | 0.4413s | 88.8760ms | 11.2516 Ops/s | 10.6794 Ops/s | |
| test_serialize_weights_pickle | 1.3505s | 1.1932s | 0.8381 Ops/s | 0.8252 Ops/s | |
| test_reshape_pytree | 0.2064ms | 31.8668μs | 31.3807 KOps/s | 30.4535 KOps/s | |
| test_reshape_td | 80.7920μs | 41.7210μs | 23.9687 KOps/s | 23.4466 KOps/s | |
| test_view_pytree | 0.2227ms | 31.9861μs | 31.2635 KOps/s | 30.7117 KOps/s | |
| test_view_td | 82.2510μs | 49.9780μs | 20.0088 KOps/s | 19.8378 KOps/s | |
| test_unbind_pytree | 0.2673ms | 36.2049μs | 27.6206 KOps/s | 27.8583 KOps/s | |
| test_unbind_td | 86.1410μs | 46.8505μs | 21.3445 KOps/s | 21.0980 KOps/s | |
| test_split_pytree | 0.2467ms | 41.2782μs | 24.2259 KOps/s | 24.1137 KOps/s | |
| test_split_td | 0.1792ms | 60.9927μs | 16.3954 KOps/s | 16.0202 KOps/s | |
| test_add_pytree | 0.2329ms | 41.3154μs | 24.2041 KOps/s | 24.2516 KOps/s | |
| test_add_td | 0.1219ms | 53.7044μs | 18.6204 KOps/s | 19.5739 KOps/s | |
| test_compile_add_one_nested[tensordict-compile] | 0.1960ms | 0.1352ms | 7.3981 KOps/s | 7.0566 KOps/s | |
| test_compile_add_one_nested[tensordict-eager] | 0.3400ms | 0.1866ms | 5.3604 KOps/s | 5.4642 KOps/s | |
| test_compile_add_one_nested[pytree-compile] | 0.1444ms | 0.1058ms | 9.4541 KOps/s | 9.4002 KOps/s | |
| test_compile_add_one_nested[pytree-eager] | 0.4350ms | 0.1781ms | 5.6139 KOps/s | 5.8050 KOps/s | |
| test_compile_copy_nested[tensordict-compile] | 69.1610μs | 30.4774μs | 32.8111 KOps/s | 33.3237 KOps/s | |
| test_compile_copy_nested[tensordict-eager] | 87.8710μs | 49.8978μs | 20.0410 KOps/s | 20.0680 KOps/s | |
| test_compile_copy_nested[pytree-compile] | 45.8300μs | 9.5856μs | 104.3226 KOps/s | 109.0117 KOps/s | |
| test_compile_copy_nested[pytree-eager] | 0.4616ms | 67.5732μs | 14.7988 KOps/s | 15.0063 KOps/s | |
| test_compile_add_one_flat[tensordict-compile] | 0.2133ms | 0.1731ms | 5.7763 KOps/s | 5.4891 KOps/s | |
| test_compile_add_one_flat[tensordict-eager] | 0.3207ms | 0.2497ms | 4.0042 KOps/s | 4.0295 KOps/s | |
| test_compile_add_one_flat[tensorclass-compile] | 0.1895ms | 0.1138ms | 8.7837 KOps/s | 8.5367 KOps/s | |
| test_compile_add_one_flat[tensorclass-eager] | 0.1165ms | 68.4224μs | 14.6151 KOps/s | 15.0673 KOps/s | |
| test_compile_add_one_flat[pytree-compile] | 0.1912ms | 0.1558ms | 6.4202 KOps/s | 6.3202 KOps/s | |
| test_compile_add_one_flat[pytree-eager] | 0.8032ms | 0.5128ms | 1.9501 KOps/s | 1.9396 KOps/s | |
| test_compile_add_self_flat[tensordict-eager] | 0.4332ms | 0.3014ms | 3.3175 KOps/s | 3.3021 KOps/s | |
| test_compile_add_self_flat[tensordict-compile] | 0.2292ms | 0.1743ms | 5.7356 KOps/s | 5.1870 KOps/s | |
| test_compile_add_self_flat[tensorclass-eager] | 0.1353ms | 84.5393μs | 11.8288 KOps/s | 11.7199 KOps/s | |
| test_compile_add_self_flat[tensorclass-compile] | 0.2144ms | 0.1162ms | 8.6025 KOps/s | 7.8758 KOps/s | |
| test_compile_add_self_flat[pytree-eager] | 0.6251ms | 0.4232ms | 2.3627 KOps/s | 2.3324 KOps/s | |
| test_compile_add_self_flat[pytree-compile] | 0.2031ms | 0.1557ms | 6.4213 KOps/s | 6.1952 KOps/s | |
| test_compile_copy_flat[tensordict-compile] | 80.7710μs | 23.4403μs | 42.6616 KOps/s | 39.9472 KOps/s | |
| test_compile_copy_flat[tensordict-eager] | 72.5410μs | 40.4488μs | 24.7226 KOps/s | 25.1747 KOps/s | |
| test_compile_copy_flat[pytree-compile] | 48.6710μs | 10.5724μs | 94.5861 KOps/s | 94.7614 KOps/s | |
| test_compile_copy_flat[pytree-eager] | 0.4061ms | 50.7638μs | 19.6991 KOps/s | 19.7842 KOps/s | |
| test_compile_assign_and_add[tensordict-compile] | 1.9340ms | 0.1702ms | 5.8748 KOps/s | 5.5127 KOps/s | |
| test_compile_assign_and_add[tensordict-eager] | 3.3262ms | 3.1899ms | 313.4874 Ops/s | 309.8266 Ops/s | |
| test_compile_assign_and_add[pytree-compile] | 1.9048ms | 0.1576ms | 6.3451 KOps/s | 6.2010 KOps/s | |
| test_compile_assign_and_add[pytree-eager] | 3.0895ms | 2.9185ms | 342.6379 Ops/s | 369.2119 Ops/s | |
| test_compile_indexing[tensor-tensordict-compile] | 0.1551ms | 0.1067ms | 9.3725 KOps/s | 9.1327 KOps/s | |
| test_compile_indexing[tensor-tensordict-eager] | 0.3072ms | 70.0204μs | 14.2816 KOps/s | 14.2754 KOps/s | |
| test_compile_indexing[tensor-tensorclass-compile] | 0.1419ms | 94.6891μs | 10.5609 KOps/s | 10.4367 KOps/s | |
| test_compile_indexing[tensor-tensorclass-eager] | 0.2506ms | 47.0253μs | 21.2651 KOps/s | 22.7669 KOps/s | |
| test_compile_indexing[tensor-pytree-compile] | 0.1465ms | 94.8281μs | 10.5454 KOps/s | 10.3035 KOps/s | |
| test_compile_indexing[tensor-pytree-eager] | 0.2409ms | 47.0814μs | 21.2398 KOps/s | 22.7084 KOps/s | |
| test_compile_indexing[slice-tensordict-compile] | 0.1436ms | 54.5695μs | 18.3253 KOps/s | 17.9894 KOps/s | |
| test_compile_indexing[slice-tensordict-eager] | 0.2284ms | 26.5893μs | 37.6092 KOps/s | 37.8923 KOps/s | |
| test_compile_indexing[slice-tensorclass-compile] | 81.3920μs | 43.7703μs | 22.8465 KOps/s | 22.2952 KOps/s | |
| test_compile_indexing[slice-tensorclass-eager] | 0.2487ms | 21.9710μs | 45.5145 KOps/s | 45.8997 KOps/s | |
| test_compile_indexing[slice-pytree-compile] | 82.6810μs | 45.0225μs | 22.2111 KOps/s | 22.2951 KOps/s | |
| test_compile_indexing[slice-pytree-eager] | 0.2738ms | 21.8808μs | 45.7022 KOps/s | 46.1718 KOps/s | |
| test_compile_indexing[int-tensordict-compile] | 93.7610μs | 55.3989μs | 18.0509 KOps/s | 17.8236 KOps/s | |
| test_compile_indexing[int-tensordict-eager] | 0.2751ms | 26.7632μs | 37.3647 KOps/s | 38.1784 KOps/s | |
| test_compile_indexing[int-tensorclass-compile] | 81.7810μs | 44.0383μs | 22.7075 KOps/s | 22.4285 KOps/s | |
| test_compile_indexing[int-tensorclass-eager] | 0.2553ms | 22.1385μs | 45.1701 KOps/s | 45.9513 KOps/s | |
| test_compile_indexing[int-pytree-compile] | 94.4510μs | 45.1641μs | 22.1415 KOps/s | 22.4089 KOps/s | |
| test_compile_indexing[int-pytree-eager] | 0.2747ms | 22.1312μs | 45.1851 KOps/s | 46.3694 KOps/s | |
| test_mod_add[eager] | 91.7610μs | 49.3930μs | 20.2458 KOps/s | 19.8077 KOps/s | |
| test_mod_add[compile] | 0.1763ms | 0.1015ms | 9.8491 KOps/s | 9.6175 KOps/s | |
| test_mod_add[compile-overhead] | 0.2353ms | 0.1464ms | 6.8327 KOps/s | 6.7863 KOps/s | |
| test_mod_wrap[eager] | 0.3969ms | 0.2826ms | 3.5380 KOps/s | 3.4898 KOps/s | |
| test_mod_wrap[compile] | 0.4693ms | 0.3426ms | 2.9189 KOps/s | 2.9368 KOps/s | |
| test_mod_wrap[compile-overhead] | 6.9407ms | 3.8055ms | 262.7775 Ops/s | 253.2719 Ops/s | |
| test_mod_wrap_and_backward[eager] | 1.6391ms | 1.4964ms | 668.2828 Ops/s | 621.3236 Ops/s | |
| test_mod_wrap_and_backward[compile] | 1.5528ms | 1.4219ms | 703.2835 Ops/s | 655.9612 Ops/s | |
| test_mod_wrap_and_backward[compile-overhead] | 1.2215ms | 0.8633ms | 1.1583 KOps/s | 1.0145 KOps/s | |
| test_seq_add[eager] | 0.2294ms | 0.1504ms | 6.6481 KOps/s | 6.1954 KOps/s | |
| test_seq_add[compile] | 0.5764ms | 0.1108ms | 9.0262 KOps/s | 8.5447 KOps/s | |
| test_seq_add[compile-overhead] | 0.1933ms | 0.1488ms | 6.7222 KOps/s | 6.4822 KOps/s | |
| test_seq_wrap[eager] | 0.5831ms | 0.5309ms | 1.8835 KOps/s | 1.9418 KOps/s | |
| test_seq_wrap[compile] | 0.5896ms | 0.3625ms | 2.7588 KOps/s | 2.7819 KOps/s | |
| test_seq_wrap[compile-overhead] | 0.3183ms | 0.2563ms | 3.9020 KOps/s | 3.8437 KOps/s | |
| test_func_call_runtime[False-eager] | 0.8830ms | 0.8116ms | 1.2321 KOps/s | 1.2227 KOps/s | |
| test_func_call_runtime[False-compile] | 0.9231ms | 0.8671ms | 1.1533 KOps/s | 1.0922 KOps/s | |
| test_func_call_runtime[False-compile-overhead] | 0.5026ms | 0.4395ms | 2.2754 KOps/s | 2.2354 KOps/s | |
| test_func_call_runtime[True-eager] | 1.1004ms | 1.0455ms | 956.4752 Ops/s | 945.9077 Ops/s | |
| test_func_call_runtime[True-compile] | 0.9262ms | 0.8768ms | 1.1404 KOps/s | 1.0802 KOps/s | |
| test_func_call_runtime[True-compile-overhead] | 0.5570ms | 0.4520ms | 2.2123 KOps/s | 2.1631 KOps/s | |
| test_func_call_cm_runtime[False-eager] | 0.9410ms | 0.8127ms | 1.2305 KOps/s | 1.2229 KOps/s | |
| test_func_call_cm_runtime[False-compile] | 0.9843ms | 0.8708ms | 1.1484 KOps/s | 1.1254 KOps/s | |
| test_func_call_cm_runtime[False-compile-overhead] | 0.5513ms | 0.4412ms | 2.2666 KOps/s | 2.2212 KOps/s | |
| test_func_call_cm_runtime[True-eager] | 1.3122ms | 1.1958ms | 836.2594 Ops/s | 835.3807 Ops/s | |
| test_func_call_cm_runtime[True-compile] | 1.0247ms | 0.9113ms | 1.0973 KOps/s | 1.0660 KOps/s | |
| test_func_call_cm_runtime[True-compile-overhead] | 0.5945ms | 0.4834ms | 2.0689 KOps/s | 2.0192 KOps/s | |
| test_vmap_func_call_cm_runtime[eager] | 2.7938ms | 2.2951ms | 435.7174 Ops/s | 428.8331 Ops/s | |
| test_vmap_func_call_cm_runtime[compile] | 1.0986ms | 0.9382ms | 1.0659 KOps/s | 1.0449 KOps/s | |
| test_vmap_func_call_cm_runtime[compile-overhead] | 0.6151ms | 0.4994ms | 2.0025 KOps/s | 1.9913 KOps/s | |
| test_distributed | 3.1324ms | 0.1656ms | 6.0399 KOps/s | 6.5210 KOps/s | |
| test_tdmodule | 62.8810μs | 26.9504μs | 37.1052 KOps/s | 35.5233 KOps/s | |
| test_tdmodule_dispatch | 0.1388ms | 43.9014μs | 22.7783 KOps/s | 21.9113 KOps/s | |
| test_tdseq | 55.7310μs | 26.5328μs | 37.6892 KOps/s | 36.8830 KOps/s | |
| test_tdseq_dispatch | 78.7310μs | 46.5347μs | 21.4893 KOps/s | 21.0599 KOps/s | |
| test_instantiation_functorch | 2.0283ms | 1.9460ms | 513.8637 Ops/s | 504.3468 Ops/s | |
| test_exec_functorch | 0.2318ms | 0.1684ms | 5.9388 KOps/s | 5.6603 KOps/s | |
| test_exec_functional_call | 0.2181ms | 0.1525ms | 6.5593 KOps/s | 6.2551 KOps/s | |
| test_exec_td_decorator | 0.4261ms | 0.2235ms | 4.4739 KOps/s | 4.3107 KOps/s | |
| test_vmap_mlp_speed_decorator[True-True] | 0.9827ms | 0.7957ms | 1.2568 KOps/s | 1.2275 KOps/s | |
| test_vmap_mlp_speed_decorator[True-False] | 0.9670ms | 0.7948ms | 1.2583 KOps/s | 1.2315 KOps/s | |
| test_vmap_mlp_speed_decorator[False-True] | 0.8490ms | 0.6881ms | 1.4534 KOps/s | 1.4232 KOps/s | |
| test_vmap_mlp_speed_decorator[False-False] | 0.8473ms | 0.6889ms | 1.4517 KOps/s | 1.4292 KOps/s | |
| test_vmap_transformer_speed_decorator[True-True] | 20.5874ms | 19.9220ms | 50.1959 Ops/s | 49.4385 Ops/s | |
| test_vmap_transformer_speed_decorator[True-False] | 20.6722ms | 19.9521ms | 50.1200 Ops/s | 49.3802 Ops/s | |
| test_vmap_transformer_speed_decorator[False-True] | 26.2695ms | 20.0001ms | 49.9999 Ops/s | 49.9363 Ops/s | |
| test_vmap_transformer_speed_decorator[False-False] | 19.8716ms | 19.7595ms | 50.6085 Ops/s | 49.8765 Ops/s | |
| test_to_module_speed[True] | 1.4739ms | 1.3999ms | 714.3240 Ops/s | 709.1214 Ops/s | |
| test_to_module_speed[False] | 1.9776ms | 1.3822ms | 723.4881 Ops/s | 721.7826 Ops/s | |
| test_tc_init | 68.5910μs | 44.1990μs | 22.6249 KOps/s | 22.0324 KOps/s | |
| test_tc_init_tensor_only | 45.5210μs | 9.3022μs | 107.5010 KOps/s | 106.7572 KOps/s | |
| test_tc_init_nested | 0.1260ms | 87.8840μs | 11.3786 KOps/s | 11.2255 KOps/s | |
| test_tc_init_many_fields | 39.8210μs | 15.6616μs | 63.8506 KOps/s | 63.1082 KOps/s | |
| test_tc_first_layer_tensor | 22.0900μs | 1.7323μs | 577.2801 KOps/s | 575.8412 KOps/s | |
| test_tc_first_layer_tensor_only | 4.1143μs | 0.7213μs | 1.3864 MOps/s | 1.3814 MOps/s | |
| test_tc_first_layer_tensor_set | 22.3000μs | 3.9678μs | 252.0268 KOps/s | 252.5640 KOps/s | |
| test_tc_first_layer_tensor_only_set | 25.4210μs | 2.9993μs | 333.4123 KOps/s | 333.9313 KOps/s | |
| test_tc_first_layer_nontensor | 38.5300μs | 5.8400μs | 171.2324 KOps/s | 164.6658 KOps/s | |
| test_tc_second_layer_tensor | 37.4900μs | 4.1461μs | 241.1882 KOps/s | 238.3074 KOps/s | |
| test_tc_second_layer_nontensor | 38.8010μs | 8.2588μs | 121.0831 KOps/s | 117.5601 KOps/s | |
| test_unbind | 0.2784s | 16.0235ms | 62.4082 Ops/s | 59.3109 Ops/s | |
| test_full_like | 16.9559ms | 16.7649ms | 59.6484 Ops/s | 222.4951 Ops/s | |
| test_zeros_like | 16.8473ms | 16.7116ms | 59.8386 Ops/s | 226.7979 Ops/s | |
| test_ones_like | 4.6081ms | 4.3863ms | 227.9801 Ops/s | 226.2947 Ops/s | |
| test_clone | 7.0954ms | 6.6271ms | 150.8954 Ops/s | 149.7288 Ops/s | |
| test_squeeze | 86.8820μs | 13.3564μs | 74.8705 KOps/s | 72.0025 KOps/s | |
| test_unsqueeze | 0.2838ms | 0.1032ms | 9.6854 KOps/s | 9.1540 KOps/s | |
| test_split | 0.3457ms | 0.1716ms | 5.8258 KOps/s | 5.4620 KOps/s | |
| test_permute | 0.2619ms | 0.1939ms | 5.1585 KOps/s | 5.0162 KOps/s | |
| test_stack | 52.5009ms | 52.0181ms | 19.2241 Ops/s | 19.5338 Ops/s | |
| test_cat | 52.4244ms | 51.5153ms | 19.4117 Ops/s | 19.4127 Ops/s |
Xmaster6y
pushed a commit
to Xmaster6y/tensordict
that referenced
this pull request
Feb 27, 2026
…ANGE Replace the full read-modify-write approach for indexed access with Redis byte-range operations (GETRANGE/SETRANGE). This reduces data transfer from O(full_tensor) to O(slice) and network round-trips from 2N to 2 (or 1 with metadata caching). Key changes: - Add _compute_byte_ranges to map tensor indices to byte offsets - Add pipelined _abatch_get_at / _abatch_set_at / _abatch_read_modify_write - Override __setitem__ to bypass _SubTensorDict for batched SETRANGE - Override _get_at_str/_get_at_tuple to use GETRANGE - Add metadata cache (cache_metadata=True by default) to skip metadata round-trips - Refactor inline meta decoding to shared _decode_meta utility ghstack-source-id: dddb29e Pull-Request: pytorch#1569
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
Replace the full read-modify-write approach for indexed access with Redis
byte-range operations (GETRANGE/SETRANGE). This reduces data transfer from
O(full_tensor) to O(slice) and network round-trips from 2N to 2 (or 1 with
metadata caching).
Key changes:
round-trips