[BugFix] Run __post_init__ and apply field defaults under torch.compile (#1708, #1710) - #1709
Merged
Conversation
PR #1552 replaced the unconditional dataclass __init__ call with a fast-path bypass and explicitly re-invoked __post_init__ — but guarded the call with `not is_compiling()`. Under torch.compile, that guard short-circuits, so any normalization, derivation, or validation a user wrote in __post_init__ is silently dropped: compiled output diverges from eager with no error. Drop the is_compiling() half of both guards (the bypass branch in _init_wrapper and the symmetric _from_tensordict path). Add regression tests covering both construction paths. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
|
| Name | Max | Mean | Ops | Ops on Repo HEAD
|
Change |
|---|---|---|---|---|---|
| test_collector_preallocated_write[stack_out-cpu-32-2] | 0.2419ms | 0.1675ms | 5.9718 KOps/s | 5.8645 KOps/s | |
| test_collector_preallocated_write[stack_out-cpu-32-8] | 0.3525ms | 0.2980ms | 3.3560 KOps/s | 3.3907 KOps/s | |
| test_collector_preallocated_write[stack_out-cpu-32-32] | 0.8526ms | 0.7760ms | 1.2886 KOps/s | 1.2802 KOps/s | |
| test_collector_preallocated_write[stack_out-cpu-4096-2] | 0.3934ms | 0.3379ms | 2.9594 KOps/s | 2.9212 KOps/s | |
| test_collector_preallocated_write[stack_out-cpu-4096-8] | 1.3919ms | 1.1360ms | 880.3168 Ops/s | 930.7452 Ops/s | |
| test_collector_preallocated_write[stack_out-cpu-4096-32] | 7.4289ms | 7.2645ms | 137.6556 Ops/s | 135.9794 Ops/s | |
| test_collector_preallocated_write[stack_out-cuda-32-2] | 0.3148ms | 0.2574ms | 3.8845 KOps/s | 3.7959 KOps/s | |
| test_collector_preallocated_write[stack_out-cuda-32-8] | 0.4643ms | 0.3811ms | 2.6239 KOps/s | 2.6188 KOps/s | |
| test_collector_preallocated_write[stack_out-cuda-32-32] | 0.8876ms | 0.8163ms | 1.2251 KOps/s | 1.2145 KOps/s | |
| test_collector_preallocated_write[stack_out-cuda-4096-2] | 0.3194ms | 0.2571ms | 3.8891 KOps/s | 3.8782 KOps/s | |
| test_collector_preallocated_write[stack_out-cuda-4096-8] | 0.4810ms | 0.3846ms | 2.6002 KOps/s | 2.6577 KOps/s | |
| test_collector_preallocated_write[stack_out-cuda-4096-32] | 0.9424ms | 0.8830ms | 1.1325 KOps/s | 1.1310 KOps/s | |
| test_collector_preallocated_write[set_at_loop-cpu-32-2] | 0.2571ms | 0.2165ms | 4.6183 KOps/s | 4.5886 KOps/s | |
| test_collector_preallocated_write[set_at_loop-cpu-32-8] | 0.9101ms | 0.8312ms | 1.2031 KOps/s | 1.1735 KOps/s | |
| test_collector_preallocated_write[set_at_loop-cpu-32-32] | 3.8209ms | 3.3002ms | 303.0163 Ops/s | 291.3090 Ops/s | |
| test_collector_preallocated_write[set_at_loop-cpu-4096-2] | 0.5344ms | 0.3729ms | 2.6820 KOps/s | 2.5745 KOps/s | |
| test_collector_preallocated_write[set_at_loop-cpu-4096-8] | 2.3118ms | 1.7433ms | 573.6225 Ops/s | 575.6908 Ops/s | |
| test_collector_preallocated_write[set_at_loop-cpu-4096-32] | 10.6704ms | 10.3831ms | 96.3108 Ops/s | 96.3766 Ops/s | |
| test_collector_preallocated_write[set_at_loop-cuda-32-2] | 0.4512ms | 0.4110ms | 2.4329 KOps/s | 2.4871 KOps/s | |
| test_collector_preallocated_write[set_at_loop-cuda-32-8] | 1.7742ms | 1.5162ms | 659.5489 Ops/s | 631.4598 Ops/s | |
| test_collector_preallocated_write[set_at_loop-cuda-32-32] | 6.2154ms | 5.9032ms | 169.3984 Ops/s | 160.3779 Ops/s | |
| test_collector_preallocated_write[set_at_loop-cuda-4096-2] | 0.4426ms | 0.3939ms | 2.5387 KOps/s | 2.3560 KOps/s | |
| test_collector_preallocated_write[set_at_loop-cuda-4096-8] | 1.5499ms | 1.4732ms | 678.7935 Ops/s | 633.6406 Ops/s | |
| test_collector_preallocated_write[set_at_loop-cuda-4096-32] | 6.1124ms | 5.7920ms | 172.6519 Ops/s | 160.9068 Ops/s | |
| test_collector_preallocated_write[copy_at-cpu-32-2] | 0.2157ms | 0.1708ms | 5.8552 KOps/s | 5.7150 KOps/s | |
| test_collector_preallocated_write[copy_at-cpu-32-8] | 0.8173ms | 0.6692ms | 1.4943 KOps/s | 1.4871 KOps/s | |
| test_collector_preallocated_write[copy_at-cpu-32-32] | 2.8649ms | 2.6542ms | 376.7629 Ops/s | 371.8893 Ops/s | |
| test_collector_preallocated_write[copy_at-cpu-4096-2] | 0.7307ms | 0.3189ms | 3.1362 KOps/s | 3.0997 KOps/s | |
| test_collector_preallocated_write[copy_at-cpu-4096-8] | 1.5991ms | 1.4611ms | 684.3964 Ops/s | 681.3053 Ops/s | |
| test_collector_preallocated_write[copy_at-cpu-4096-32] | 9.8206ms | 9.4705ms | 105.5911 Ops/s | 105.1343 Ops/s | |
| test_collector_preallocated_write[copy_at-cuda-32-2] | 0.4141ms | 0.3248ms | 3.0792 KOps/s | 3.0509 KOps/s | |
| test_collector_preallocated_write[copy_at-cuda-32-8] | 1.3465ms | 1.2064ms | 828.8869 Ops/s | 819.6463 Ops/s | |
| test_collector_preallocated_write[copy_at-cuda-32-32] | 4.8301ms | 4.7189ms | 211.9153 Ops/s | 208.7110 Ops/s | |
| test_collector_preallocated_write[copy_at-cuda-4096-2] | 0.4333ms | 0.3248ms | 3.0788 KOps/s | 3.0546 KOps/s | |
| test_collector_preallocated_write[copy_at-cuda-4096-8] | 1.4497ms | 1.2111ms | 825.7208 Ops/s | 816.6463 Ops/s | |
| test_collector_preallocated_write[copy_at-cuda-4096-32] | 4.8618ms | 4.7397ms | 210.9831 Ops/s | 208.0397 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cpu-32-2] | 0.1768ms | 0.1206ms | 8.2904 KOps/s | 8.4066 KOps/s | |
| test_collector_preallocated_write[manual_leaf_copy-cpu-32-8] | 0.5683ms | 0.4713ms | 2.1217 KOps/s | 2.1241 KOps/s | |
| test_collector_preallocated_write[manual_leaf_copy-cpu-32-32] | 1.9990ms | 1.8762ms | 533.0024 Ops/s | 532.7598 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cpu-4096-2] | 0.3270ms | 0.2625ms | 3.8088 KOps/s | 3.7101 KOps/s | |
| test_collector_preallocated_write[manual_leaf_copy-cpu-4096-8] | 1.6865ms | 1.2895ms | 775.4770 Ops/s | 836.8779 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cpu-4096-32] | 8.8609ms | 8.5647ms | 116.7583 Ops/s | 113.9059 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cuda-32-2] | 0.4223ms | 0.2775ms | 3.6037 KOps/s | 3.3732 KOps/s | |
| test_collector_preallocated_write[manual_leaf_copy-cuda-32-8] | 1.1515ms | 1.0307ms | 970.2178 Ops/s | 905.5566 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cuda-32-32] | 4.1210ms | 4.0417ms | 247.4233 Ops/s | 231.0243 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cuda-4096-2] | 0.3720ms | 0.2775ms | 3.6040 KOps/s | 3.3823 KOps/s | |
| test_collector_preallocated_write[manual_leaf_copy-cuda-4096-8] | 1.1332ms | 1.0348ms | 966.4046 Ops/s | 907.6182 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cuda-4096-32] | 4.1820ms | 4.0883ms | 244.6022 Ops/s | 235.2568 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cpu-128-128] | 16.5834ms | 16.3746ms | 61.0702 Ops/s | 61.5897 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cpu-128-256] | 34.8455ms | 33.0586ms | 30.2493 Ops/s | 30.5294 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cpu-4096-128] | 88.4687ms | 87.6521ms | 11.4087 Ops/s | 12.0080 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cpu-4096-256] | 0.2071s | 0.2061s | 4.8527 Ops/s | 5.0504 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cuda-128-128] | 14.0407ms | 13.8524ms | 72.1898 Ops/s | 72.7027 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cuda-128-256] | 27.2765ms | 27.1802ms | 36.7916 Ops/s | 37.2663 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cuda-4096-128] | 14.1403ms | 14.0341ms | 71.2550 Ops/s | 71.9546 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cuda-4096-256] | 27.5274ms | 27.3873ms | 36.5133 Ops/s | 36.7353 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cpu-128-128] | 53.3311ms | 52.9840ms | 18.8736 Ops/s | 19.0299 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cpu-128-256] | 0.1059s | 0.1055s | 9.4810 Ops/s | 9.4690 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cpu-4096-128] | 0.1547s | 0.1527s | 6.5491 Ops/s | 6.5705 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cpu-4096-256] | 0.3335s | 0.3328s | 3.0049 Ops/s | 3.1214 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cuda-128-128] | 79.7367ms | 78.0992ms | 12.8042 Ops/s | 12.5176 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cuda-128-256] | 0.1597s | 0.1573s | 6.3571 Ops/s | 6.1942 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cuda-4096-128] | 80.8314ms | 80.1135ms | 12.4823 Ops/s | 12.5371 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cuda-4096-256] | 0.1603s | 0.1572s | 6.3614 Ops/s | 6.2648 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cpu-128-128] | 30.4497ms | 30.3651ms | 32.9325 Ops/s | 32.8014 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cpu-128-256] | 61.5926ms | 61.3506ms | 16.2998 Ops/s | 16.3018 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cpu-4096-128] | 0.1237s | 0.1230s | 8.1317 Ops/s | 8.4906 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cpu-4096-256] | 0.2769s | 0.2759s | 3.6241 Ops/s | 3.7912 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cuda-128-128] | 43.3733ms | 43.2232ms | 23.1357 Ops/s | 23.0065 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cuda-128-256] | 86.6032ms | 86.3851ms | 11.5761 Ops/s | 11.4907 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cuda-4096-128] | 43.5416ms | 43.4427ms | 23.0188 Ops/s | 22.8615 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cuda-4096-256] | 86.9156ms | 86.7959ms | 11.5213 Ops/s | 11.4177 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cpu-128-128] | 20.7620ms | 20.6423ms | 48.4442 Ops/s | 48.9293 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cpu-128-256] | 42.2091ms | 42.0648ms | 23.7728 Ops/s | 23.7204 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cpu-4096-128] | 0.1129s | 0.1126s | 8.8794 Ops/s | 9.2125 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cpu-4096-256] | 0.2526s | 0.2520s | 3.9680 Ops/s | 4.1849 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cuda-128-128] | 37.4677ms | 37.2283ms | 26.8613 Ops/s | 25.8172 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cuda-128-256] | 74.6648ms | 74.0850ms | 13.4980 Ops/s | 13.2733 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cuda-4096-128] | 37.4502ms | 37.1708ms | 26.9028 Ops/s | 25.1501 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cuda-4096-256] | 74.5549ms | 74.0404ms | 13.5061 Ops/s | 12.6911 Ops/s | |
| test_plain_set_nested | 47.6410μs | 15.6968μs | 63.7074 KOps/s | 64.8970 KOps/s | |
| test_plain_set_stack_nested | 31.2610μs | 15.3297μs | 65.2327 KOps/s | 65.9785 KOps/s | |
| test_plain_set_nested_inplace | 45.1810μs | 16.8868μs | 59.2180 KOps/s | 59.2779 KOps/s | |
| test_plain_set_stack_nested_inplace | 46.6110μs | 16.7815μs | 59.5893 KOps/s | 60.9822 KOps/s | |
| test_items | 41.0010μs | 5.9584μs | 167.8309 KOps/s | 169.6371 KOps/s | |
| test_items_nested | 0.5492ms | 0.4647ms | 2.1519 KOps/s | 2.1862 KOps/s | |
| test_items_nested_locked | 0.5363ms | 0.4662ms | 2.1451 KOps/s | 2.1786 KOps/s | |
| test_items_nested_leaf | 0.1415ms | 96.7950μs | 10.3311 KOps/s | 10.3414 KOps/s | |
| test_items_stack_nested | 0.6006ms | 0.4573ms | 2.1868 KOps/s | 2.1893 KOps/s | |
| test_items_stack_nested_leaf | 0.1804ms | 96.9057μs | 10.3193 KOps/s | 10.2205 KOps/s | |
| test_items_stack_nested_locked | 0.5637ms | 0.4685ms | 2.1345 KOps/s | 2.1714 KOps/s | |
| test_keys | 24.6910μs | 4.2474μs | 235.4378 KOps/s | 236.0264 KOps/s | |
| test_keys_nested | 0.2411ms | 0.1300ms | 7.6909 KOps/s | 7.6958 KOps/s | |
| test_keys_nested_locked | 0.7153ms | 0.1380ms | 7.2441 KOps/s | 7.1723 KOps/s | |
| test_keys_nested_leaf | 0.1804ms | 0.1212ms | 8.2488 KOps/s | 8.2532 KOps/s | |
| test_keys_stack_nested | 0.1569ms | 0.1299ms | 7.6971 KOps/s | 7.7242 KOps/s | |
| test_keys_stack_nested_leaf | 0.1437ms | 0.1204ms | 8.3047 KOps/s | 8.2919 KOps/s | |
| test_keys_stack_nested_locked | 0.1741ms | 0.1385ms | 7.2176 KOps/s | 7.2161 KOps/s | |
| test_values | 5.6102μs | 1.0279μs | 972.8457 KOps/s | 985.9379 KOps/s | |
| test_values_nested | 0.1200ms | 52.4341μs | 19.0716 KOps/s | 18.9285 KOps/s | |
| test_values_nested_locked | 90.9110μs | 55.7162μs | 17.9481 KOps/s | 17.8910 KOps/s | |
| test_values_nested_leaf | 90.6610μs | 59.9499μs | 16.6806 KOps/s | 16.4934 KOps/s | |
| test_values_stack_nested | 0.1440ms | 52.2446μs | 19.1407 KOps/s | 19.1371 KOps/s | |
| test_values_stack_nested_leaf | 88.3320μs | 59.8259μs | 16.7152 KOps/s | 16.7447 KOps/s | |
| test_values_stack_nested_locked | 86.3820μs | 56.2558μs | 17.7759 KOps/s | 17.9783 KOps/s | |
| test_membership | 5.4768μs | 0.8329μs | 1.2006 MOps/s | 1.1896 MOps/s | |
| test_membership_nested | 57.7610μs | 2.9461μs | 339.4273 KOps/s | 339.3977 KOps/s | |
| test_membership_nested_leaf | 30.9510μs | 2.9394μs | 340.2107 KOps/s | 338.8871 KOps/s | |
| test_membership_stacked_nested | 27.4710μs | 2.8671μs | 348.7873 KOps/s | 349.8211 KOps/s | |
| test_membership_stacked_nested_leaf | 37.6810μs | 2.8478μs | 351.1494 KOps/s | 347.6639 KOps/s | |
| test_membership_nested_last | 28.1900μs | 4.4445μs | 224.9955 KOps/s | 224.5896 KOps/s | |
| test_membership_nested_leaf_last | 29.2800μs | 4.4688μs | 223.7713 KOps/s | 224.0416 KOps/s | |
| test_membership_stacked_nested_last | 33.1410μs | 4.3438μs | 230.2140 KOps/s | 229.6042 KOps/s | |
| test_membership_stacked_nested_leaf_last | 31.9000μs | 4.2840μs | 233.4273 KOps/s | 229.6238 KOps/s | |
| test_nested_getleaf | 58.4110μs | 21.4209μs | 46.6834 KOps/s | 45.7821 KOps/s | |
| test_nested_get | 47.8210μs | 20.0927μs | 49.7694 KOps/s | 47.8353 KOps/s | |
| test_stacked_getleaf | 47.9010μs | 21.2641μs | 47.0276 KOps/s | 45.2424 KOps/s | |
| test_stacked_get | 52.9000μs | 20.4015μs | 49.0159 KOps/s | 47.7928 KOps/s | |
| test_nested_getitemleaf | 44.6210μs | 21.9923μs | 45.4705 KOps/s | 44.1665 KOps/s | |
| test_nested_getitem | 49.7510μs | 20.9923μs | 47.6365 KOps/s | 47.5203 KOps/s | |
| test_stacked_getitemleaf | 50.1310μs | 21.7186μs | 46.0434 KOps/s | 45.5343 KOps/s | |
| test_stacked_getitem | 46.3710μs | 20.7375μs | 48.2219 KOps/s | 47.6880 KOps/s | |
| test_lock_nested | 8.1241ms | 0.4832ms | 2.0694 KOps/s | 2.0857 KOps/s | |
| test_lock_stack_nested | 0.5194ms | 0.4796ms | 2.0852 KOps/s | 2.0770 KOps/s | |
| test_unlock_nested | 0.4780ms | 0.3863ms | 2.5887 KOps/s | 2.5868 KOps/s | |
| test_unlock_stack_nested | 0.4344ms | 0.3884ms | 2.5747 KOps/s | 2.5593 KOps/s | |
| test_flatten_speed | 0.1570ms | 0.1208ms | 8.2767 KOps/s | 8.1974 KOps/s | |
| test_unflatten_speed | 0.6792ms | 0.5661ms | 1.7665 KOps/s | 1.7754 KOps/s | |
| test_common_ops | 0.1972s | 1.7692ms | 565.2385 Ops/s | 211.4064 Ops/s | |
| test_creation | 75.8810μs | 3.1404μs | 318.4311 KOps/s | 322.8863 KOps/s | |
| test_creation_empty | 29.5100μs | 7.0290μs | 142.2679 KOps/s | 144.6653 KOps/s | |
| test_creation_nested_1 | 39.2410μs | 11.5670μs | 86.4527 KOps/s | 87.3519 KOps/s | |
| test_creation_nested_2 | 57.3210μs | 13.2874μs | 75.2590 KOps/s | 75.1050 KOps/s | |
| test_creation_many_keys[10] | 86.6710μs | 21.1351μs | 47.3147 KOps/s | 48.1653 KOps/s | |
| test_creation_many_keys[50] | 0.1207ms | 91.4813μs | 10.9312 KOps/s | 11.3559 KOps/s | |
| test_creation_many_keys[100] | 0.2339ms | 0.1791ms | 5.5825 KOps/s | 5.6330 KOps/s | |
| test_creation_nested_many_keys[10] | 0.1186ms | 44.4666μs | 22.4888 KOps/s | 22.3491 KOps/s | |
| test_creation_nested_many_keys[50] | 0.2220ms | 0.1864ms | 5.3660 KOps/s | 5.3840 KOps/s | |
| test_clone | 31.7300μs | 13.3575μs | 74.8643 KOps/s | 74.6062 KOps/s | |
| test_getitem[int] | 1.4779ms | 15.1976μs | 65.8001 KOps/s | 65.7309 KOps/s | |
| test_getitem[slice_int] | 0.1421ms | 24.5679μs | 40.7035 KOps/s | 41.2669 KOps/s | |
| test_getitem[range] | 0.1719ms | 64.7467μs | 15.4448 KOps/s | 15.5460 KOps/s | |
| test_getitem[tuple] | 0.1392ms | 24.4656μs | 40.8738 KOps/s | 40.5242 KOps/s | |
| test_getitem[list] | 0.1791ms | 60.0743μs | 16.6460 KOps/s | 16.3347 KOps/s | |
| test_setitem_dim[int] | 57.6310μs | 25.6532μs | 38.9815 KOps/s | 36.1780 KOps/s | |
| test_setitem_dim[slice_int] | 86.9210μs | 42.6241μs | 23.4609 KOps/s | 22.3719 KOps/s | |
| test_setitem_dim[range] | 0.1230ms | 95.5237μs | 10.4686 KOps/s | 10.3219 KOps/s | |
| test_setitem_dim[tuple] | 67.5310μs | 39.7076μs | 25.1841 KOps/s | 25.5246 KOps/s | |
| test_setitem | 36.9110μs | 17.7483μs | 56.3433 KOps/s | 56.5937 KOps/s | |
| test_set | 63.8910μs | 16.9990μs | 58.8268 KOps/s | 58.6959 KOps/s | |
| test_set_shared | 0.5251ms | 0.2037ms | 4.9092 KOps/s | 4.7469 KOps/s | |
| test_update | 0.3467ms | 22.1393μs | 45.1686 KOps/s | 45.1264 KOps/s | |
| test_update_nested | 0.1036ms | 33.6916μs | 29.6810 KOps/s | 29.6228 KOps/s | |
| test_update__nested | 0.4569ms | 33.2847μs | 30.0439 KOps/s | 30.1307 KOps/s | |
| test_set_nested | 48.7410μs | 19.0266μs | 52.5579 KOps/s | 52.6356 KOps/s | |
| test_set_nested_new | 59.9910μs | 23.9210μs | 41.8042 KOps/s | 41.9417 KOps/s | |
| test_select | 76.7310μs | 40.3507μs | 24.7827 KOps/s | 25.0295 KOps/s | |
| test_select_nested | 0.1069ms | 74.8939μs | 13.3522 KOps/s | 13.5115 KOps/s | |
| test_exclude_nested | 0.1216ms | 90.9362μs | 10.9967 KOps/s | 11.1526 KOps/s | |
| test_empty[True] | 0.4752ms | 0.3980ms | 2.5128 KOps/s | 2.5267 KOps/s | |
| test_empty[False] | 7.3400μs | 1.3904μs | 719.1966 KOps/s | 718.7588 KOps/s | |
| test_to | 99.5020μs | 68.5871μs | 14.5800 KOps/s | 14.3627 KOps/s | |
| test_to_nonblocking | 0.1095ms | 67.7147μs | 14.7678 KOps/s | 14.7026 KOps/s | |
| test_unbind_speed | 0.4031ms | 0.3362ms | 2.9745 KOps/s | 2.9603 KOps/s | |
| test_unbind_speed_stack0 | 0.4539ms | 0.3311ms | 3.0199 KOps/s | 3.0148 KOps/s | |
| test_unbind_speed_stack1 | 0.1143s | 0.8567ms | 1.1672 KOps/s | 1.1677 KOps/s | |
| test_split | 1.1920ms | 1.1434ms | 874.6130 Ops/s | 702.5696 Ops/s | |
| test_chunk | 0.1139s | 1.2264ms | 815.3860 Ops/s | 915.6575 Ops/s | |
| test_to_cpu_blocking | 20.1124ms | 20.0014ms | 49.9965 Ops/s | 49.9895 Ops/s | |
| test_to_cpu_global_sync | 11.8856ms | 11.7779ms | 84.9048 Ops/s | 85.0434 Ops/s | |
| test_to_cpu_event_sync | 13.0737ms | 12.7795ms | 78.2504 Ops/s | 78.4656 Ops/s | |
| test_to_cpu_default | 14.2599ms | 12.8090ms | 78.0702 Ops/s | 70.0048 Ops/s | |
| test_consolidate[False-None] | 4.2318ms | 4.1193ms | 242.7611 Ops/s | 240.7547 Ops/s | |
| test_consolidate[default-None] | 2.1090ms | 2.0040ms | 499.0008 Ops/s | 490.8335 Ops/s | |
| test_consolidate[reduce-overhead-None] | 2.0235ms | 1.9271ms | 518.9100 Ops/s | 511.0857 Ops/s | |
| test_consolidate_njt[False-None] | 8.7435ms | 8.4783ms | 117.9486 Ops/s | 117.2808 Ops/s | |
| test_to[False-False-None] | 2.6672ms | 2.1662ms | 461.6390 Ops/s | 457.0598 Ops/s | |
| test_to[True-False-None] | 2.1184ms | 1.8782ms | 532.4379 Ops/s | 537.6263 Ops/s | |
| test_to[within-False-None] | 6.2102ms | 6.1058ms | 163.7780 Ops/s | 162.6964 Ops/s | |
| test_to[True-default-None] | 11.2818ms | 10.6996ms | 93.4614 Ops/s | 92.5283 Ops/s | |
| test_to_njt[False-False-None] | 8.7251ms | 8.6541ms | 115.5526 Ops/s | 114.6414 Ops/s | |
| test_to_njt[True-False-None] | 7.3296ms | 6.8955ms | 145.0223 Ops/s | 137.5353 Ops/s | |
| test_to_njt[within-False-None] | 15.7185ms | 15.6400ms | 63.9387 Ops/s | 63.7084 Ops/s | |
| test_creation[device0] | 0.4398ms | 0.1169ms | 8.5567 KOps/s | 8.6508 KOps/s | |
| test_creation_from_tensor | 0.6024ms | 0.1177ms | 8.4977 KOps/s | 8.8764 KOps/s | |
| test_add_one[memmap_tensor0] | 0.3250ms | 6.7556μs | 148.0259 KOps/s | 147.1051 KOps/s | |
| test_contiguous[memmap_tensor0] | 12.9400μs | 0.6693μs | 1.4940 MOps/s | 2.2111 MOps/s | |
| test_stack[memmap_tensor0] | 27.6510μs | 4.2611μs | 234.6806 KOps/s | 235.6898 KOps/s | |
| test_memmaptd_index | 1.1565ms | 0.2739ms | 3.6515 KOps/s | 3.6920 KOps/s | |
| test_memmaptd_index_astensor | 0.5329ms | 0.3754ms | 2.6641 KOps/s | 2.6783 KOps/s | |
| test_memmaptd_index_op | 0.7934ms | 0.6410ms | 1.5600 KOps/s | 1.5512 KOps/s | |
| test_serialize_model | 0.1368s | 0.1349s | 7.4145 Ops/s | 7.3687 Ops/s | |
| test_serialize_model_pickle | 1.3483s | 1.2094s | 0.8269 Ops/s | 0.8265 Ops/s | |
| test_serialize_weights | 0.1351s | 0.1332s | 7.5092 Ops/s | 7.4646 Ops/s | |
| test_serialize_weights_returnearly | 0.2951s | 77.9986ms | 12.8207 Ops/s | 15.0243 Ops/s | |
| test_serialize_weights_pickle | 1.3688s | 1.2133s | 0.8242 Ops/s | 0.8245 Ops/s | |
| test_reshape_pytree | 0.2217ms | 32.7355μs | 30.5479 KOps/s | 30.2072 KOps/s | |
| test_reshape_td | 79.5610μs | 44.0301μs | 22.7117 KOps/s | 21.8719 KOps/s | |
| test_view_pytree | 0.2156ms | 32.3968μs | 30.8672 KOps/s | 30.8372 KOps/s | |
| test_view_td | 85.2020μs | 52.5725μs | 19.0214 KOps/s | 18.7488 KOps/s | |
| test_unbind_pytree | 0.2019ms | 36.7752μs | 27.1922 KOps/s | 26.8118 KOps/s | |
| test_unbind_td | 0.1661ms | 49.4094μs | 20.2391 KOps/s | 19.8793 KOps/s | |
| test_split_pytree | 0.2406ms | 42.5212μs | 23.5177 KOps/s | 23.4815 KOps/s | |
| test_split_td | 0.1089ms | 64.0826μs | 15.6049 KOps/s | 15.7527 KOps/s | |
| test_add_pytree | 0.2263ms | 42.8046μs | 23.3620 KOps/s | 23.1823 KOps/s | |
| test_add_td | 92.9620μs | 54.8677μs | 18.2257 KOps/s | 17.7631 KOps/s | |
| test_compile_add_one_nested[tensordict-compile] | 0.3382ms | 0.2323ms | 4.3039 KOps/s | 4.4313 KOps/s | |
| test_compile_add_one_nested[tensordict-eager] | 0.4146ms | 0.2020ms | 4.9505 KOps/s | 4.8731 KOps/s | |
| test_compile_add_one_nested[pytree-compile] | 0.4310ms | 0.1341ms | 7.4591 KOps/s | 7.1750 KOps/s | |
| test_compile_add_one_nested[pytree-eager] | 0.4311ms | 0.1793ms | 5.5763 KOps/s | 5.5382 KOps/s | |
| test_compile_copy_nested[tensordict-compile] | 0.1019ms | 14.6742μs | 68.1470 KOps/s | 67.0754 KOps/s | |
| test_compile_copy_nested[tensordict-eager] | 0.3387ms | 53.1745μs | 18.8060 KOps/s | 18.4836 KOps/s | |
| test_compile_copy_nested[pytree-compile] | 59.1310μs | 15.4052μs | 64.9133 KOps/s | 63.7268 KOps/s | |
| test_compile_copy_nested[pytree-eager] | 0.3780ms | 68.4212μs | 14.6154 KOps/s | 14.6801 KOps/s | |
| test_compile_add_one_flat[tensordict-compile] | 0.4844ms | 0.2489ms | 4.0181 KOps/s | 3.9114 KOps/s | |
| test_compile_add_one_flat[tensordict-eager] | 0.3785ms | 0.2810ms | 3.5591 KOps/s | 3.4756 KOps/s | |
| test_compile_add_one_flat[tensorclass-compile] | 0.3066ms | 0.1829ms | 5.4685 KOps/s | 5.3244 KOps/s | |
| test_compile_add_one_flat[tensorclass-eager] | 0.1236ms | 75.5200μs | 13.2415 KOps/s | 13.2268 KOps/s | |
| test_compile_add_one_flat[pytree-compile] | 0.4590ms | 0.1924ms | 5.1969 KOps/s | 4.9054 KOps/s | |
| test_compile_add_one_flat[pytree-eager] | 0.7957ms | 0.5246ms | 1.9064 KOps/s | 1.8274 KOps/s | |
| test_compile_add_self_flat[tensordict-eager] | 0.4459ms | 0.3286ms | 3.0429 KOps/s | 3.0158 KOps/s | |
| test_compile_add_self_flat[tensordict-compile] | 0.6024ms | 0.2489ms | 4.0175 KOps/s | 3.5556 KOps/s | |
| test_compile_add_self_flat[tensorclass-eager] | 0.1323ms | 90.9618μs | 10.9936 KOps/s | 10.7362 KOps/s | |
| test_compile_add_self_flat[tensorclass-compile] | 0.2832ms | 0.1863ms | 5.3683 KOps/s | 5.0640 KOps/s | |
| test_compile_add_self_flat[pytree-eager] | 0.6449ms | 0.4289ms | 2.3314 KOps/s | 2.2806 KOps/s | |
| test_compile_add_self_flat[pytree-compile] | 0.5082ms | 0.1927ms | 5.1895 KOps/s | 4.9810 KOps/s | |
| test_compile_copy_flat[tensordict-compile] | 73.4310μs | 19.3610μs | 51.6503 KOps/s | 49.7310 KOps/s | |
| test_compile_copy_flat[tensordict-eager] | 86.4910μs | 41.9002μs | 23.8662 KOps/s | 24.3338 KOps/s | |
| test_compile_copy_flat[pytree-compile] | 0.2031ms | 21.3184μs | 46.9078 KOps/s | 45.8626 KOps/s | |
| test_compile_copy_flat[pytree-eager] | 0.3330ms | 52.0107μs | 19.2268 KOps/s | 19.0632 KOps/s | |
| test_compile_assign_and_add[tensordict-compile] | 2.2404ms | 0.2410ms | 4.1496 KOps/s | 3.9011 KOps/s | |
| test_compile_assign_and_add[tensordict-eager] | 3.4061ms | 3.2439ms | 308.2675 Ops/s | 300.0247 Ops/s | |
| test_compile_assign_and_add[pytree-compile] | 2.1034ms | 0.1792ms | 5.5802 KOps/s | 5.3785 KOps/s | |
| test_compile_assign_and_add[pytree-eager] | 2.8958ms | 2.7606ms | 362.2398 Ops/s | 355.1321 Ops/s | |
| test_compile_indexing[tensor-tensordict-compile] | 0.2752ms | 0.1386ms | 7.2151 KOps/s | 7.1898 KOps/s | |
| test_compile_indexing[tensor-tensordict-eager] | 0.3164ms | 76.0302μs | 13.1527 KOps/s | 13.6670 KOps/s | |
| test_compile_indexing[tensor-tensorclass-compile] | 0.2468ms | 0.1225ms | 8.1618 KOps/s | 8.4068 KOps/s | |
| test_compile_indexing[tensor-tensorclass-eager] | 0.2543ms | 46.3948μs | 21.5541 KOps/s | 21.5909 KOps/s | |
| test_compile_indexing[tensor-pytree-compile] | 0.1623ms | 0.1202ms | 8.3206 KOps/s | 8.3582 KOps/s | |
| test_compile_indexing[tensor-pytree-eager] | 0.3117ms | 47.4959μs | 21.0544 KOps/s | 21.1523 KOps/s | |
| test_compile_indexing[slice-tensordict-compile] | 0.2091ms | 81.9831μs | 12.1976 KOps/s | 11.5565 KOps/s | |
| test_compile_indexing[slice-tensordict-eager] | 0.2039ms | 27.3617μs | 36.5474 KOps/s | 36.2514 KOps/s | |
| test_compile_indexing[slice-tensorclass-compile] | 0.1893ms | 71.2721μs | 14.0307 KOps/s | 14.2621 KOps/s | |
| test_compile_indexing[slice-tensorclass-eager] | 0.2437ms | 22.4942μs | 44.4559 KOps/s | 44.7283 KOps/s | |
| test_compile_indexing[slice-pytree-compile] | 0.1143ms | 74.0369μs | 13.5068 KOps/s | 14.0869 KOps/s | |
| test_compile_indexing[slice-pytree-eager] | 0.2365ms | 23.1328μs | 43.2287 KOps/s | 44.6922 KOps/s | |
| test_compile_indexing[int-tensordict-compile] | 0.1287ms | 87.1655μs | 11.4724 KOps/s | 11.5916 KOps/s | |
| test_compile_indexing[int-tensordict-eager] | 0.3086ms | 27.2547μs | 36.6909 KOps/s | 35.9020 KOps/s | |
| test_compile_indexing[int-tensorclass-compile] | 0.1408ms | 73.4491μs | 13.6149 KOps/s | 14.0579 KOps/s | |
| test_compile_indexing[int-tensorclass-eager] | 0.2494ms | 22.3257μs | 44.7915 KOps/s | 44.4026 KOps/s | |
| test_compile_indexing[int-pytree-compile] | 0.1088ms | 73.9463μs | 13.5233 KOps/s | 14.0902 KOps/s | |
| test_compile_indexing[int-pytree-eager] | 0.2078ms | 22.2890μs | 44.8652 KOps/s | 44.6506 KOps/s | |
| test_compile_replace[single-eager] | 93.4120μs | 48.0480μs | 20.8125 KOps/s | 21.2104 KOps/s | |
| test_compile_replace[single-compile] | 0.2200ms | 0.1333ms | 7.5014 KOps/s | 7.5957 KOps/s | |
| test_compile_replace[multi-eager] | 0.7177ms | 0.5799ms | 1.7245 KOps/s | 1.7988 KOps/s | |
| test_compile_replace[multi-compile] | 0.3189ms | 0.1371ms | 7.2956 KOps/s | 7.0965 KOps/s | |
| test_compile_tc_getattr_20[eager] | 0.2202ms | 0.1670ms | 5.9868 KOps/s | 6.1300 KOps/s | |
| test_compile_tc_getattr_20[compile] | 0.4407ms | 0.1463ms | 6.8360 KOps/s | 6.5855 KOps/s | |
| test_compile_clone_shallow[20-eager] | 44.7710μs | 19.3094μs | 51.7883 KOps/s | 51.9737 KOps/s | |
| test_compile_clone_shallow[20-compile] | 77.6810μs | 17.7497μs | 56.3389 KOps/s | 60.4965 KOps/s | |
| test_compile_clone_shallow[40-eager] | 61.6620μs | 34.0801μs | 29.3426 KOps/s | 29.4176 KOps/s | |
| test_compile_clone_shallow[40-compile] | 84.1610μs | 18.9600μs | 52.7425 KOps/s | 54.1295 KOps/s | |
| test_compile_clone_shallow[80-eager] | 0.1286ms | 62.8953μs | 15.8994 KOps/s | 16.1207 KOps/s | |
| test_compile_clone_shallow[80-compile] | 77.6920μs | 21.4534μs | 46.6126 KOps/s | 46.6564 KOps/s | |
| test_compile_update_inplace[eager] | 98.1410μs | 61.2189μs | 16.3348 KOps/s | 16.3051 KOps/s | |
| test_compile_update_inplace[compile] | 0.3104ms | 0.1471ms | 6.7997 KOps/s | 6.7069 KOps/s | |
| test_mod_add[eager] | 0.3039ms | 0.2291ms | 4.3642 KOps/s | 4.3989 KOps/s | |
| test_mod_add[compile] | 0.3282ms | 0.1395ms | 7.1660 KOps/s | 7.4856 KOps/s | |
| test_mod_add[compile-overhead] | 0.2989ms | 0.1784ms | 5.6062 KOps/s | 5.5846 KOps/s | |
| test_mod_wrap[eager] | 0.5606ms | 0.4909ms | 2.0369 KOps/s | 2.1129 KOps/s | |
| test_mod_wrap[compile] | 0.5726ms | 0.4007ms | 2.4958 KOps/s | 2.4664 KOps/s | |
| test_mod_wrap[compile-overhead] | 8.3652ms | 4.6672ms | 214.2633 Ops/s | 215.2024 Ops/s | |
| test_mod_wrap_and_backward[eager] | 1.8628ms | 1.6852ms | 593.4091 Ops/s | 575.3702 Ops/s | |
| test_mod_wrap_and_backward[compile] | 1.8783ms | 1.5333ms | 652.1680 Ops/s | 644.9201 Ops/s | |
| test_mod_wrap_and_backward[compile-overhead] | 1.3688ms | 0.9476ms | 1.0553 KOps/s | 1.0357 KOps/s | |
| test_seq_add[eager] | 9.1103ms | 0.5139ms | 1.9461 KOps/s | 1.9421 KOps/s | |
| test_seq_add[compile] | 0.2359ms | 0.1407ms | 7.1093 KOps/s | 6.8534 KOps/s | |
| test_seq_add[compile-overhead] | 0.3374ms | 0.1807ms | 5.5339 KOps/s | 5.2721 KOps/s | |
| test_seq_wrap[eager] | 1.6158ms | 1.4180ms | 705.1976 Ops/s | 701.0736 Ops/s | |
| test_seq_wrap[compile] | 0.4991ms | 0.4083ms | 2.4491 KOps/s | 2.3809 KOps/s | |
| test_seq_wrap[compile-overhead] | 0.3882ms | 0.3057ms | 3.2716 KOps/s | 3.1859 KOps/s | |
| test_func_call_runtime[False-eager] | 0.8959ms | 0.8001ms | 1.2498 KOps/s | 1.2436 KOps/s | |
| test_func_call_runtime[False-compile] | 1.0737ms | 0.9772ms | 1.0234 KOps/s | 1.0113 KOps/s | |
| test_func_call_runtime[False-compile-overhead] | 0.6887ms | 0.5119ms | 1.9534 KOps/s | 1.9287 KOps/s | |
| test_func_call_runtime[True-eager] | 1.1581ms | 1.0404ms | 961.2145 Ops/s | 952.5613 Ops/s | |
| test_func_call_runtime[True-compile] | 1.1279ms | 1.0190ms | 981.3105 Ops/s | 995.0203 Ops/s | |
| test_func_call_runtime[True-compile-overhead] | 0.6319ms | 0.5252ms | 1.9039 KOps/s | 1.8719 KOps/s | |
| test_func_call_cm_runtime[False-eager] | 0.8945ms | 0.7977ms | 1.2536 KOps/s | 1.2501 KOps/s | |
| test_func_call_cm_runtime[False-compile] | 1.1336ms | 0.9606ms | 1.0410 KOps/s | 1.0262 KOps/s | |
| test_func_call_cm_runtime[False-compile-overhead] | 0.7534ms | 0.5066ms | 1.9738 KOps/s | 2.0096 KOps/s | |
| test_func_call_cm_runtime[True-eager] | 1.3213ms | 1.1899ms | 840.4049 Ops/s | 835.7121 Ops/s | |
| test_func_call_cm_runtime[True-compile] | 1.0598ms | 1.0026ms | 997.3702 Ops/s | 982.0770 Ops/s | |
| test_func_call_cm_runtime[True-compile-overhead] | 0.6231ms | 0.5434ms | 1.8404 KOps/s | 1.8173 KOps/s | |
| test_vmap_func_call_cm_runtime[eager] | 2.8601ms | 2.3911ms | 418.2109 Ops/s | 419.2298 Ops/s | |
| test_vmap_func_call_cm_runtime[compile] | 1.1156ms | 1.0206ms | 979.8436 Ops/s | 968.9141 Ops/s | |
| test_vmap_func_call_cm_runtime[compile-overhead] | 0.6273ms | 0.5356ms | 1.8671 KOps/s | 1.8368 KOps/s | |
| test_distributed | 1.8008ms | 0.1521ms | 6.5735 KOps/s | 6.5451 KOps/s | |
| test_tdmodule | 1.0056ms | 0.1943ms | 5.1454 KOps/s | 5.0929 KOps/s | |
| test_tdmodule_dispatch | 0.4542ms | 0.3697ms | 2.7052 KOps/s | 2.6822 KOps/s | |
| test_tdseq | 49.1510μs | 27.3335μs | 36.5851 KOps/s | 36.8713 KOps/s | |
| test_tdseq_dispatch | 0.2619ms | 0.2162ms | 4.6252 KOps/s | 4.5891 KOps/s | |
| test_instantiation_functorch | 2.1843ms | 2.0705ms | 482.9813 Ops/s | 482.2293 Ops/s | |
| test_exec_functorch | 0.2392ms | 0.1835ms | 5.4507 KOps/s | 5.5391 KOps/s | |
| test_exec_functional_call | 0.2491ms | 0.1643ms | 6.0878 KOps/s | 6.1599 KOps/s | |
| test_exec_td_decorator | 0.4652ms | 0.2384ms | 4.1952 KOps/s | 4.2002 KOps/s | |
| test_vmap_mlp_speed_decorator[True-True] | 1.2023ms | 1.0156ms | 984.6041 Ops/s | 986.7276 Ops/s | |
| test_vmap_mlp_speed_decorator[True-False] | 1.2114ms | 1.0068ms | 993.2275 Ops/s | 992.1535 Ops/s | |
| test_vmap_mlp_speed_decorator[False-True] | 0.9141ms | 0.7103ms | 1.4079 KOps/s | 1.4049 KOps/s | |
| test_vmap_mlp_speed_decorator[False-False] | 0.9002ms | 0.7112ms | 1.4061 KOps/s | 1.4048 KOps/s | |
| test_vmap_transformer_speed_decorator[True-True] | 21.8283ms | 20.9455ms | 47.7430 Ops/s | 47.8018 Ops/s | |
| test_vmap_transformer_speed_decorator[True-False] | 21.8071ms | 20.9264ms | 47.7866 Ops/s | 47.8809 Ops/s | |
| test_vmap_transformer_speed_decorator[False-True] | 20.6536ms | 20.5407ms | 48.6839 Ops/s | 48.7720 Ops/s | |
| test_vmap_transformer_speed_decorator[False-False] | 20.7325ms | 20.5009ms | 48.7784 Ops/s | 48.8254 Ops/s | |
| test_to_module_speed[True] | 1.6194ms | 1.4655ms | 682.3455 Ops/s | 667.2966 Ops/s | |
| test_to_module_speed[False] | 1.5601ms | 1.4472ms | 690.9824 Ops/s | 683.2889 Ops/s | |
| test_tc_init | 73.4410μs | 44.0152μs | 22.7194 KOps/s | 21.3881 KOps/s | |
| test_tc_init_tensor_only | 44.7610μs | 8.9584μs | 111.6268 KOps/s | 102.6248 KOps/s | |
| test_tc_init_nested | 0.1204ms | 85.9081μs | 11.6404 KOps/s | 11.3379 KOps/s | |
| test_tc_init_many_fields | 37.8400μs | 14.6762μs | 68.1373 KOps/s | 61.0237 KOps/s | |
| test_tc_first_layer_tensor | 32.2510μs | 1.7972μs | 556.4124 KOps/s | 548.3474 KOps/s | |
| test_tc_first_layer_tensor_only | 2.0315μs | 0.3932μs | 2.5435 MOps/s | 2.5347 MOps/s | |
| test_tc_first_layer_tensor_set | 31.2210μs | 3.9248μs | 254.7903 KOps/s | 252.6526 KOps/s | |
| test_tc_first_layer_tensor_only_set | 25.5910μs | 3.2528μs | 307.4303 KOps/s | 305.1525 KOps/s | |
| test_tc_first_layer_nontensor | 38.1600μs | 6.1532μs | 162.5172 KOps/s | 152.7434 KOps/s | |
| test_tc_second_layer_tensor | 34.0900μs | 4.4545μs | 224.4945 KOps/s | 226.3739 KOps/s | |
| test_tc_second_layer_nontensor | 49.5210μs | 8.6359μs | 115.7953 KOps/s | 109.8647 KOps/s | |
| test_unbind | 0.2823s | 14.1735ms | 70.5543 Ops/s | 69.1809 Ops/s | |
| test_full_like | 4.4955ms | 4.3849ms | 228.0557 Ops/s | 227.8365 Ops/s | |
| test_zeros_like | 4.4873ms | 4.3817ms | 228.2225 Ops/s | 230.7482 Ops/s | |
| test_ones_like | 4.5491ms | 4.3919ms | 227.6905 Ops/s | 232.0268 Ops/s | |
| test_clone | 6.9626ms | 6.6171ms | 151.1238 Ops/s | 155.2167 Ops/s | |
| test_squeeze | 0.1945ms | 14.2456μs | 70.1971 KOps/s | 69.0155 KOps/s | |
| test_unsqueeze | 0.1640ms | 0.1127ms | 8.8744 KOps/s | 8.9123 KOps/s | |
| test_split | 0.2328ms | 0.1810ms | 5.5249 KOps/s | 5.5092 KOps/s | |
| test_permute | 0.2569ms | 0.2084ms | 4.7977 KOps/s | 4.8184 KOps/s | |
| test_stack | 43.6719ms | 43.2791ms | 23.1058 Ops/s | 19.5875 Ops/s | |
| test_cat | 43.2474ms | 43.0183ms | 23.2459 Ops/s | 19.5682 Ops/s | |
| test_sequential_tensordict | 0.7054ms | 0.5681ms | 1.7604 KOps/s | 1.7288 KOps/s | |
| test_sequential_graph_module | 0.1470ms | 0.1185ms | 8.4380 KOps/s | 8.4899 KOps/s | |
| test_nested_tensordict | 0.9388ms | 0.8161ms | 1.2253 KOps/s | 1.2116 KOps/s | |
| test_nested_graph_module | 0.1814ms | 0.1341ms | 7.4596 KOps/s | 7.5302 KOps/s |
Contributor
|
| Name | Max | Mean | Ops | Ops on Repo HEAD
|
Change |
|---|---|---|---|---|---|
| test_collector_preallocated_write[stack_out-cpu-32-2] | 0.2272ms | 0.1677ms | 5.9644 KOps/s | 6.1076 KOps/s | |
| test_collector_preallocated_write[stack_out-cpu-32-8] | 0.3964ms | 0.2950ms | 3.3893 KOps/s | 3.4321 KOps/s | |
| test_collector_preallocated_write[stack_out-cpu-32-32] | 0.8188ms | 0.7435ms | 1.3450 KOps/s | 1.3272 KOps/s | |
| test_collector_preallocated_write[stack_out-cpu-4096-2] | 0.4564ms | 0.3388ms | 2.9517 KOps/s | 2.9003 KOps/s | |
| test_collector_preallocated_write[stack_out-cpu-4096-8] | 1.5739ms | 1.1363ms | 880.0471 Ops/s | 923.1287 Ops/s | |
| test_collector_preallocated_write[stack_out-cpu-4096-32] | 8.8455ms | 7.2575ms | 137.7882 Ops/s | 136.9673 Ops/s | |
| test_collector_preallocated_write[stack_out-cuda-32-2] | 0.2979ms | 0.2393ms | 4.1793 KOps/s | 4.1734 KOps/s | |
| test_collector_preallocated_write[stack_out-cuda-32-8] | 0.4470ms | 0.3575ms | 2.7968 KOps/s | 2.8133 KOps/s | |
| test_collector_preallocated_write[stack_out-cuda-32-32] | 0.8945ms | 0.7902ms | 1.2656 KOps/s | 1.2726 KOps/s | |
| test_collector_preallocated_write[stack_out-cuda-4096-2] | 0.3097ms | 0.2417ms | 4.1375 KOps/s | 4.1716 KOps/s | |
| test_collector_preallocated_write[stack_out-cuda-4096-8] | 0.4495ms | 0.3592ms | 2.7837 KOps/s | 2.8217 KOps/s | |
| test_collector_preallocated_write[stack_out-cuda-4096-32] | 0.9198ms | 0.8553ms | 1.1691 KOps/s | 1.1767 KOps/s | |
| test_collector_preallocated_write[set_at_loop-cpu-32-2] | 0.2573ms | 0.2059ms | 4.8571 KOps/s | 4.7995 KOps/s | |
| test_collector_preallocated_write[set_at_loop-cpu-32-8] | 0.8685ms | 0.7983ms | 1.2526 KOps/s | 1.2402 KOps/s | |
| test_collector_preallocated_write[set_at_loop-cpu-32-32] | 3.4145ms | 3.2236ms | 310.2149 Ops/s | 312.7494 Ops/s | |
| test_collector_preallocated_write[set_at_loop-cpu-4096-2] | 0.4431ms | 0.3650ms | 2.7400 KOps/s | 2.7059 KOps/s | |
| test_collector_preallocated_write[set_at_loop-cpu-4096-8] | 1.9516ms | 1.7099ms | 584.8290 Ops/s | 616.6302 Ops/s | |
| test_collector_preallocated_write[set_at_loop-cpu-4096-32] | 10.3716ms | 10.1223ms | 98.7918 Ops/s | 98.5429 Ops/s | |
| test_collector_preallocated_write[set_at_loop-cuda-32-2] | 0.4481ms | 0.3911ms | 2.5570 KOps/s | 2.5933 KOps/s | |
| test_collector_preallocated_write[set_at_loop-cuda-32-8] | 1.5348ms | 1.4348ms | 696.9788 Ops/s | 696.7652 Ops/s | |
| test_collector_preallocated_write[set_at_loop-cuda-32-32] | 5.7000ms | 5.5900ms | 178.8919 Ops/s | 178.2493 Ops/s | |
| test_collector_preallocated_write[set_at_loop-cuda-4096-2] | 0.4489ms | 0.3808ms | 2.6259 KOps/s | 2.5922 KOps/s | |
| test_collector_preallocated_write[set_at_loop-cuda-4096-8] | 1.4922ms | 1.4310ms | 698.7991 Ops/s | 695.6558 Ops/s | |
| test_collector_preallocated_write[set_at_loop-cuda-4096-32] | 5.8940ms | 5.6442ms | 177.1718 Ops/s | 177.2352 Ops/s | |
| test_collector_preallocated_write[copy_at-cpu-32-2] | 0.2310ms | 0.1691ms | 5.9140 KOps/s | 5.9065 KOps/s | |
| test_collector_preallocated_write[copy_at-cpu-32-8] | 0.7634ms | 0.6568ms | 1.5225 KOps/s | 1.5210 KOps/s | |
| test_collector_preallocated_write[copy_at-cpu-32-32] | 2.7153ms | 2.5728ms | 388.6829 Ops/s | 383.1071 Ops/s | |
| test_collector_preallocated_write[copy_at-cpu-4096-2] | 0.4039ms | 0.3202ms | 3.1231 KOps/s | 3.1808 KOps/s | |
| test_collector_preallocated_write[copy_at-cpu-4096-8] | 1.7134ms | 1.4444ms | 692.3432 Ops/s | 684.5872 Ops/s | |
| test_collector_preallocated_write[copy_at-cpu-4096-32] | 9.9234ms | 9.4455ms | 105.8710 Ops/s | 106.6356 Ops/s | |
| test_collector_preallocated_write[copy_at-cuda-32-2] | 0.3948ms | 0.3196ms | 3.1286 KOps/s | 3.1086 KOps/s | |
| test_collector_preallocated_write[copy_at-cuda-32-8] | 1.2844ms | 1.1904ms | 840.0813 Ops/s | 839.6658 Ops/s | |
| test_collector_preallocated_write[copy_at-cuda-32-32] | 4.7964ms | 4.6398ms | 215.5248 Ops/s | 214.2457 Ops/s | |
| test_collector_preallocated_write[copy_at-cuda-4096-2] | 0.4143ms | 0.3204ms | 3.1212 KOps/s | 3.1096 KOps/s | |
| test_collector_preallocated_write[copy_at-cuda-4096-8] | 1.3490ms | 1.1929ms | 838.2593 Ops/s | 833.0845 Ops/s | |
| test_collector_preallocated_write[copy_at-cuda-4096-32] | 4.8154ms | 4.6722ms | 214.0327 Ops/s | 212.8867 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cpu-32-2] | 0.1672ms | 0.1163ms | 8.6021 KOps/s | 8.5519 KOps/s | |
| test_collector_preallocated_write[manual_leaf_copy-cpu-32-8] | 0.5375ms | 0.4554ms | 2.1961 KOps/s | 2.1875 KOps/s | |
| test_collector_preallocated_write[manual_leaf_copy-cpu-32-32] | 1.8836ms | 1.8151ms | 550.9363 Ops/s | 552.2854 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cpu-4096-2] | 4.9735ms | 0.2540ms | 3.9376 KOps/s | 3.9091 KOps/s | |
| test_collector_preallocated_write[manual_leaf_copy-cpu-4096-8] | 1.6169ms | 1.2055ms | 829.5504 Ops/s | 781.8516 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cpu-4096-32] | 8.8385ms | 8.4836ms | 117.8750 Ops/s | 118.3213 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cuda-32-2] | 0.3472ms | 0.2745ms | 3.6424 KOps/s | 3.6897 KOps/s | |
| test_collector_preallocated_write[manual_leaf_copy-cuda-32-8] | 1.1235ms | 1.0200ms | 980.4136 Ops/s | 992.1643 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cuda-32-32] | 4.1191ms | 4.0112ms | 249.3045 Ops/s | 254.5462 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cuda-4096-2] | 0.3377ms | 0.2738ms | 3.6519 KOps/s | 3.6673 KOps/s | |
| test_collector_preallocated_write[manual_leaf_copy-cuda-4096-8] | 1.1225ms | 1.0306ms | 970.3064 Ops/s | 984.8490 Ops/s | |
| test_collector_preallocated_write[manual_leaf_copy-cuda-4096-32] | 4.2269ms | 4.0204ms | 248.7293 Ops/s | 251.1317 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cpu-128-128] | 15.9568ms | 15.8138ms | 63.2358 Ops/s | 64.5446 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cpu-128-256] | 32.1266ms | 31.8390ms | 31.4080 Ops/s | 32.0191 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cpu-4096-128] | 89.8808ms | 87.6424ms | 11.4100 Ops/s | 12.1418 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cpu-4096-256] | 0.2036s | 0.2021s | 4.9473 Ops/s | 5.1182 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cuda-128-128] | 13.3587ms | 13.2304ms | 75.5835 Ops/s | 77.1520 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cuda-128-256] | 27.7046ms | 25.9131ms | 38.5905 Ops/s | 39.4374 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cuda-4096-128] | 13.4861ms | 13.3423ms | 74.9494 Ops/s | 76.0689 Ops/s | |
| test_wide_nested_preallocated_write[stack_out-cuda-4096-256] | 26.1239ms | 25.9952ms | 38.4687 Ops/s | 38.7893 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cpu-128-128] | 53.1887ms | 51.6662ms | 19.3550 Ops/s | 20.0757 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cpu-128-256] | 0.1010s | 0.1008s | 9.9250 Ops/s | 9.9119 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cpu-4096-128] | 0.1430s | 0.1428s | 7.0032 Ops/s | 7.0773 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cpu-4096-256] | 0.3233s | 0.3225s | 3.1008 Ops/s | 3.1988 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cuda-128-128] | 77.0170ms | 73.3358ms | 13.6359 Ops/s | 13.9051 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cuda-128-256] | 0.1477s | 0.1452s | 6.8855 Ops/s | 6.9254 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cuda-4096-128] | 77.9907ms | 77.0388ms | 12.9805 Ops/s | 13.6604 Ops/s | |
| test_wide_nested_preallocated_write[set_at_loop-cuda-4096-256] | 0.1559s | 0.1529s | 6.5409 Ops/s | 6.8713 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cpu-128-128] | 29.8928ms | 29.6478ms | 33.7294 Ops/s | 33.8161 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cpu-128-256] | 60.2577ms | 60.0997ms | 16.6390 Ops/s | 16.7183 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cpu-4096-128] | 0.1188s | 0.1182s | 8.4572 Ops/s | 8.5829 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cpu-4096-256] | 0.2615s | 0.2611s | 3.8293 Ops/s | 3.8239 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cuda-128-128] | 43.8464ms | 42.5966ms | 23.4761 Ops/s | 23.6038 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cuda-128-256] | 85.3301ms | 85.1980ms | 11.7374 Ops/s | 11.7776 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cuda-4096-128] | 42.8609ms | 42.6480ms | 23.4477 Ops/s | 23.5516 Ops/s | |
| test_wide_nested_preallocated_write[copy_at-cuda-4096-256] | 85.5324ms | 85.2669ms | 11.7279 Ops/s | 11.7624 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cpu-128-128] | 20.3007ms | 19.9287ms | 50.1789 Ops/s | 50.3099 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cpu-128-256] | 41.3086ms | 40.9177ms | 24.4393 Ops/s | 24.6886 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cpu-4096-128] | 0.1090s | 0.1082s | 9.2392 Ops/s | 9.5477 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cpu-4096-256] | 0.2519s | 0.2470s | 4.0478 Ops/s | 4.2102 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cuda-128-128] | 36.3720ms | 36.0682ms | 27.7253 Ops/s | 28.0984 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cuda-128-256] | 72.8838ms | 72.3923ms | 13.8136 Ops/s | 14.0274 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cuda-4096-128] | 36.6042ms | 36.2617ms | 27.5773 Ops/s | 27.9838 Ops/s | |
| test_wide_nested_preallocated_write[manual_leaf_copy-cuda-4096-256] | 73.0477ms | 72.1900ms | 13.8523 Ops/s | 14.0034 Ops/s | |
| test_plain_set_nested | 39.4510μs | 14.7948μs | 67.5913 KOps/s | 67.8287 KOps/s | |
| test_plain_set_stack_nested | 38.0410μs | 14.7924μs | 67.6021 KOps/s | 69.4760 KOps/s | |
| test_plain_set_nested_inplace | 49.5610μs | 16.1957μs | 61.7448 KOps/s | 61.7417 KOps/s | |
| test_plain_set_stack_nested_inplace | 42.2410μs | 15.8918μs | 62.9255 KOps/s | 63.5348 KOps/s | |
| test_items | 22.2200μs | 5.5207μs | 181.1364 KOps/s | 183.8512 KOps/s | |
| test_items_nested | 0.5423ms | 0.4422ms | 2.2614 KOps/s | 2.2445 KOps/s | |
| test_items_nested_locked | 0.5408ms | 0.4448ms | 2.2484 KOps/s | 2.2463 KOps/s | |
| test_items_nested_leaf | 0.1350ms | 91.7567μs | 10.8984 KOps/s | 10.8552 KOps/s | |
| test_items_stack_nested | 0.5332ms | 0.4399ms | 2.2735 KOps/s | 2.2518 KOps/s | |
| test_items_stack_nested_leaf | 0.1334ms | 92.3335μs | 10.8303 KOps/s | 10.8995 KOps/s | |
| test_items_stack_nested_locked | 0.5226ms | 0.4397ms | 2.2745 KOps/s | 2.2051 KOps/s | |
| test_keys | 27.4710μs | 4.1129μs | 243.1350 KOps/s | 242.3644 KOps/s | |
| test_keys_nested | 0.1792ms | 0.1281ms | 7.8092 KOps/s | 7.8695 KOps/s | |
| test_keys_nested_locked | 0.7072ms | 0.1366ms | 7.3200 KOps/s | 7.4092 KOps/s | |
| test_keys_nested_leaf | 0.1648ms | 0.1183ms | 8.4544 KOps/s | 8.4817 KOps/s | |
| test_keys_stack_nested | 0.1792ms | 0.1276ms | 7.8374 KOps/s | 7.8355 KOps/s | |
| test_keys_stack_nested_leaf | 0.1500ms | 0.1185ms | 8.4363 KOps/s | 8.6202 KOps/s | |
| test_keys_stack_nested_locked | 0.1952ms | 0.1356ms | 7.3736 KOps/s | 7.4713 KOps/s | |
| test_values | 8.7302μs | 0.9918μs | 1.0082 MOps/s | 998.3028 KOps/s | |
| test_values_nested | 84.8120μs | 51.5535μs | 19.3973 KOps/s | 19.4518 KOps/s | |
| test_values_nested_locked | 91.7320μs | 54.7852μs | 18.2531 KOps/s | 18.5107 KOps/s | |
| test_values_nested_leaf | 94.5920μs | 59.1342μs | 16.9107 KOps/s | 17.1623 KOps/s | |
| test_values_stack_nested | 85.0510μs | 51.1506μs | 19.5501 KOps/s | 19.6534 KOps/s | |
| test_values_stack_nested_leaf | 0.1033ms | 58.7865μs | 17.0107 KOps/s | 17.2545 KOps/s | |
| test_values_stack_nested_locked | 82.9210μs | 54.5967μs | 18.3161 KOps/s | 18.9030 KOps/s | |
| test_membership | 6.9885μs | 0.7864μs | 1.2716 MOps/s | 1.2635 MOps/s | |
| test_membership_nested | 33.2000μs | 2.8171μs | 354.9700 KOps/s | 356.9544 KOps/s | |
| test_membership_nested_leaf | 27.7010μs | 2.7845μs | 359.1292 KOps/s | 362.0867 KOps/s | |
| test_membership_stacked_nested | 34.7810μs | 2.7396μs | 365.0105 KOps/s | 368.5335 KOps/s | |
| test_membership_stacked_nested_leaf | 45.7610μs | 2.7048μs | 369.7070 KOps/s | 370.9193 KOps/s | |
| test_membership_nested_last | 32.0410μs | 4.1611μs | 240.3196 KOps/s | 238.0304 KOps/s | |
| test_membership_nested_leaf_last | 28.7410μs | 4.1936μs | 238.4569 KOps/s | 242.5226 KOps/s | |
| test_membership_stacked_nested_last | 44.4810μs | 4.0939μs | 244.2639 KOps/s | 246.9136 KOps/s | |
| test_membership_stacked_nested_leaf_last | 38.3610μs | 4.0587μs | 246.3842 KOps/s | 244.1414 KOps/s | |
| test_nested_getleaf | 54.7610μs | 20.9124μs | 47.8186 KOps/s | 47.9469 KOps/s | |
| test_nested_get | 50.1310μs | 19.9227μs | 50.1941 KOps/s | 51.2239 KOps/s | |
| test_stacked_getleaf | 49.8710μs | 20.9012μs | 47.8441 KOps/s | 48.6731 KOps/s | |
| test_stacked_get | 42.3410μs | 19.6000μs | 51.0205 KOps/s | 51.3174 KOps/s | |
| test_nested_getitemleaf | 48.9510μs | 21.2848μs | 46.9819 KOps/s | 47.7736 KOps/s | |
| test_nested_getitem | 49.5810μs | 20.2455μs | 49.3938 KOps/s | 50.7794 KOps/s | |
| test_stacked_getitemleaf | 62.0220μs | 20.7253μs | 48.2501 KOps/s | 47.4271 KOps/s | |
| test_stacked_getitem | 45.1810μs | 20.2331μs | 49.4240 KOps/s | 49.8961 KOps/s | |
| test_lock_nested | 8.1428ms | 0.4599ms | 2.1742 KOps/s | 2.1805 KOps/s | |
| test_lock_stack_nested | 0.4905ms | 0.4579ms | 2.1841 KOps/s | 2.1815 KOps/s | |
| test_unlock_nested | 0.5197ms | 0.3662ms | 2.7305 KOps/s | 2.7179 KOps/s | |
| test_unlock_stack_nested | 0.4040ms | 0.3699ms | 2.7036 KOps/s | 2.6947 KOps/s | |
| test_flatten_speed | 0.1642ms | 0.1153ms | 8.6699 KOps/s | 8.6456 KOps/s | |
| test_unflatten_speed | 0.6138ms | 0.5492ms | 1.8209 KOps/s | 1.8249 KOps/s | |
| test_common_ops | 99.5648ms | 1.7199ms | 581.4366 Ops/s | 503.5531 Ops/s | |
| test_creation | 0.1199ms | 2.8916μs | 345.8255 KOps/s | 350.9937 KOps/s | |
| test_creation_empty | 42.2010μs | 6.3860μs | 156.5914 KOps/s | 155.9694 KOps/s | |
| test_creation_nested_1 | 40.1910μs | 10.7890μs | 92.6871 KOps/s | 92.2534 KOps/s | |
| test_creation_nested_2 | 40.5810μs | 12.4800μs | 80.1285 KOps/s | 79.9064 KOps/s | |
| test_creation_many_keys[10] | 67.1820μs | 19.2689μs | 51.8970 KOps/s | 50.3971 KOps/s | |
| test_creation_many_keys[50] | 0.1223ms | 83.6020μs | 11.9614 KOps/s | 11.6691 KOps/s | |
| test_creation_many_keys[100] | 0.2408ms | 0.1604ms | 6.2357 KOps/s | 5.8503 KOps/s | |
| test_creation_nested_many_keys[10] | 67.6410μs | 42.1465μs | 23.7268 KOps/s | 23.2999 KOps/s | |
| test_creation_nested_many_keys[50] | 0.2123ms | 0.1709ms | 5.8531 KOps/s | 5.7794 KOps/s | |
| test_clone | 41.0410μs | 12.5406μs | 79.7409 KOps/s | 78.1877 KOps/s | |
| test_getitem[int] | 1.5032ms | 14.5888μs | 68.5457 KOps/s | 69.0124 KOps/s | |
| test_getitem[slice_int] | 0.1322ms | 23.9772μs | 41.7063 KOps/s | 42.3027 KOps/s | |
| test_getitem[range] | 0.1879ms | 62.3049μs | 16.0501 KOps/s | 16.2673 KOps/s | |
| test_getitem[tuple] | 0.1411ms | 23.2083μs | 43.0880 KOps/s | 42.8615 KOps/s | |
| test_getitem[list] | 0.1763ms | 56.9183μs | 17.5690 KOps/s | 17.5710 KOps/s | |
| test_setitem_dim[int] | 52.8610μs | 25.0435μs | 39.9305 KOps/s | 40.3563 KOps/s | |
| test_setitem_dim[slice_int] | 70.2920μs | 41.4767μs | 24.1099 KOps/s | 24.9007 KOps/s | |
| test_setitem_dim[range] | 0.1241ms | 92.8853μs | 10.7660 KOps/s | 11.0229 KOps/s | |
| test_setitem_dim[tuple] | 66.8920μs | 38.4020μs | 26.0403 KOps/s | 26.6934 KOps/s | |
| test_setitem | 50.8110μs | 16.6527μs | 60.0502 KOps/s | 59.3147 KOps/s | |
| test_set | 47.6110μs | 15.8615μs | 63.0458 KOps/s | 62.0629 KOps/s | |
| test_set_shared | 0.7399ms | 0.2001ms | 4.9978 KOps/s | 4.9607 KOps/s | |
| test_update | 0.3823ms | 21.1934μs | 47.1845 KOps/s | 47.3661 KOps/s | |
| test_update_nested | 87.3110μs | 31.8691μs | 31.3783 KOps/s | 31.3991 KOps/s | |
| test_update__nested | 0.5066ms | 31.8808μs | 31.3669 KOps/s | 29.8217 KOps/s | |
| test_set_nested | 50.2810μs | 18.1317μs | 55.1521 KOps/s | 55.9479 KOps/s | |
| test_set_nested_new | 51.3910μs | 22.7004μs | 44.0521 KOps/s | 44.0898 KOps/s | |
| test_select | 70.5710μs | 38.2952μs | 26.1129 KOps/s | 26.3959 KOps/s | |
| test_select_nested | 0.1009ms | 70.7284μs | 14.1386 KOps/s | 14.4660 KOps/s | |
| test_exclude_nested | 0.1199ms | 86.4788μs | 11.5635 KOps/s | 11.7146 KOps/s | |
| test_empty[True] | 0.4989ms | 0.3875ms | 2.5807 KOps/s | 2.6182 KOps/s | |
| test_empty[False] | 7.2252μs | 1.3022μs | 767.9112 KOps/s | 773.4864 KOps/s | |
| test_to | 95.7220μs | 65.2179μs | 15.3332 KOps/s | 14.8788 KOps/s | |
| test_to_nonblocking | 0.1066ms | 65.3399μs | 15.3046 KOps/s | 14.9941 KOps/s | |
| test_unbind_speed | 0.3514ms | 0.3211ms | 3.1141 KOps/s | 3.1039 KOps/s | |
| test_unbind_speed_stack0 | 0.3888ms | 0.3180ms | 3.1443 KOps/s | 3.1662 KOps/s | |
| test_unbind_speed_stack1 | 0.1157s | 0.8288ms | 1.2066 KOps/s | 1.2074 KOps/s | |
| test_split | 1.2114ms | 1.0801ms | 925.8818 Ops/s | 745.2369 Ops/s | |
| test_chunk | 0.1158s | 1.1670ms | 856.9068 Ops/s | 962.5779 Ops/s | |
| test_to_cpu_blocking | 20.6760ms | 20.1009ms | 49.7490 Ops/s | 49.8141 Ops/s | |
| test_to_cpu_global_sync | 11.7093ms | 11.6189ms | 86.0666 Ops/s | 86.5127 Ops/s | |
| test_to_cpu_event_sync | 13.0341ms | 12.6457ms | 79.0785 Ops/s | 79.3017 Ops/s | |
| test_to_cpu_default | 0.1280s | 14.1294ms | 70.7746 Ops/s | 70.5445 Ops/s | |
| test_consolidate[False-None] | 0.1446s | 4.5178ms | 221.3487 Ops/s | 252.3877 Ops/s | |
| test_consolidate[default-None] | 2.0664ms | 1.9546ms | 511.6180 Ops/s | 498.2610 Ops/s | |
| test_consolidate[reduce-overhead-None] | 1.9495ms | 1.8749ms | 533.3586 Ops/s | 520.4356 Ops/s | |
| test_consolidate_njt[False-None] | 8.4105ms | 8.2019ms | 121.9227 Ops/s | 115.6869 Ops/s | |
| test_to[False-False-None] | 2.1761ms | 2.1145ms | 472.9276 Ops/s | 468.5625 Ops/s | |
| test_to[True-False-None] | 1.9458ms | 1.8162ms | 550.5907 Ops/s | 529.2243 Ops/s | |
| test_to[within-False-None] | 0.2002s | 6.9951ms | 142.9573 Ops/s | 168.9574 Ops/s | |
| test_to[True-default-None] | 10.5055ms | 10.1822ms | 98.2103 Ops/s | 96.7763 Ops/s | |
| test_to_njt[False-False-None] | 8.7341ms | 8.3460ms | 119.8177 Ops/s | 117.9054 Ops/s | |
| test_to_njt[True-False-None] | 6.8839ms | 6.6481ms | 150.4195 Ops/s | 144.1890 Ops/s | |
| test_to_njt[within-False-None] | 16.1608ms | 15.6675ms | 63.8262 Ops/s | 62.7304 Ops/s | |
| test_creation[device0] | 0.3880ms | 0.1137ms | 8.7978 KOps/s | 8.4743 KOps/s | |
| test_creation_from_tensor | 0.4034ms | 0.1111ms | 9.0038 KOps/s | 8.6843 KOps/s | |
| test_add_one[memmap_tensor0] | 0.2072ms | 6.4873μs | 154.1468 KOps/s | 151.9004 KOps/s | |
| test_contiguous[memmap_tensor0] | 25.1610μs | 0.6031μs | 1.6581 MOps/s | 2.3553 MOps/s | |
| test_stack[memmap_tensor0] | 30.1810μs | 4.0436μs | 247.3050 KOps/s | 247.7131 KOps/s | |
| test_memmaptd_index | 1.3052ms | 0.2634ms | 3.7961 KOps/s | 3.7832 KOps/s | |
| test_memmaptd_index_astensor | 0.5194ms | 0.3626ms | 2.7580 KOps/s | 2.7637 KOps/s | |
| test_memmaptd_index_op | 0.7716ms | 0.6224ms | 1.6066 KOps/s | 1.6088 KOps/s | |
| test_serialize_model | 0.1365s | 0.1339s | 7.4706 Ops/s | 3.4047 Ops/s | |
| test_serialize_model_pickle | 1.3490s | 1.2098s | 0.8266 Ops/s | 0.8218 Ops/s | |
| test_serialize_weights | 0.1349s | 0.1335s | 7.4913 Ops/s | 7.4838 Ops/s | |
| test_serialize_weights_returnearly | 0.4739s | 85.6832ms | 11.6709 Ops/s | 15.8839 Ops/s | |
| test_serialize_weights_pickle | 1.3676s | 1.2130s | 0.8244 Ops/s | 0.8230 Ops/s | |
| test_reshape_pytree | 0.1964ms | 30.7477μs | 32.5227 KOps/s | 32.1616 KOps/s | |
| test_reshape_td | 88.0320μs | 42.0449μs | 23.7841 KOps/s | 23.9426 KOps/s | |
| test_view_pytree | 0.2069ms | 30.3844μs | 32.9116 KOps/s | 32.6426 KOps/s | |
| test_view_td | 0.1009ms | 50.6834μs | 19.7303 KOps/s | 20.0467 KOps/s | |
| test_unbind_pytree | 0.2282ms | 35.2365μs | 28.3797 KOps/s | 28.2653 KOps/s | |
| test_unbind_td | 90.5120μs | 47.3302μs | 21.1282 KOps/s | 21.1706 KOps/s | |
| test_split_pytree | 0.2484ms | 40.3373μs | 24.7909 KOps/s | 24.6056 KOps/s | |
| test_split_td | 0.1345ms | 60.4726μs | 16.5364 KOps/s | 16.6826 KOps/s | |
| test_add_pytree | 0.1642ms | 40.1143μs | 24.9288 KOps/s | 24.8131 KOps/s | |
| test_add_td | 0.1033ms | 52.6297μs | 19.0007 KOps/s | 19.0707 KOps/s | |
| test_compile_add_one_nested[tensordict-compile] | 0.3452ms | 0.2198ms | 4.5492 KOps/s | 4.4192 KOps/s | |
| test_compile_add_one_nested[tensordict-eager] | 0.5198ms | 0.1956ms | 5.1125 KOps/s | 5.1919 KOps/s | |
| test_compile_add_one_nested[pytree-compile] | 0.5839ms | 0.1350ms | 7.4084 KOps/s | 7.3307 KOps/s | |
| test_compile_add_one_nested[pytree-eager] | 0.6173ms | 0.1818ms | 5.5005 KOps/s | 5.7722 KOps/s | |
| test_compile_copy_nested[tensordict-compile] | 77.3220μs | 14.0955μs | 70.9448 KOps/s | 64.0923 KOps/s | |
| test_compile_copy_nested[tensordict-eager] | 0.5032ms | 50.5476μs | 19.7833 KOps/s | 19.5645 KOps/s | |
| test_compile_copy_nested[pytree-compile] | 0.4654ms | 14.7752μs | 67.6812 KOps/s | 65.4680 KOps/s | |
| test_compile_copy_nested[pytree-eager] | 0.5128ms | 64.3032μs | 15.5513 KOps/s | 15.4782 KOps/s | |
| test_compile_add_one_flat[tensordict-compile] | 0.6964ms | 0.2419ms | 4.1337 KOps/s | 3.9602 KOps/s | |
| test_compile_add_one_flat[tensordict-eager] | 0.7106ms | 0.2770ms | 3.6105 KOps/s | 3.6332 KOps/s | |
| test_compile_add_one_flat[tensorclass-compile] | 0.6141ms | 0.1771ms | 5.6479 KOps/s | 5.3576 KOps/s | |
| test_compile_add_one_flat[tensorclass-eager] | 0.5001ms | 72.1799μs | 13.8543 KOps/s | 13.8454 KOps/s | |
| test_compile_add_one_flat[pytree-compile] | 0.5422ms | 0.1865ms | 5.3630 KOps/s | 5.1597 KOps/s | |
| test_compile_add_one_flat[pytree-eager] | 0.9503ms | 0.5119ms | 1.9537 KOps/s | 1.9592 KOps/s | |
| test_compile_add_self_flat[tensordict-eager] | 0.7512ms | 0.3201ms | 3.1239 KOps/s | 3.0922 KOps/s | |
| test_compile_add_self_flat[tensordict-compile] | 0.5797ms | 0.2410ms | 4.1489 KOps/s | 3.7627 KOps/s | |
| test_compile_add_self_flat[tensorclass-eager] | 0.5322ms | 88.3480μs | 11.3189 KOps/s | 11.3402 KOps/s | |
| test_compile_add_self_flat[tensorclass-compile] | 0.6258ms | 0.1795ms | 5.5699 KOps/s | 5.1606 KOps/s | |
| test_compile_add_self_flat[pytree-eager] | 0.8524ms | 0.4273ms | 2.3404 KOps/s | 2.3509 KOps/s | |
| test_compile_add_self_flat[pytree-compile] | 0.6264ms | 0.1865ms | 5.3617 KOps/s | 5.1237 KOps/s | |
| test_compile_copy_flat[tensordict-compile] | 0.4514ms | 18.5960μs | 53.7749 KOps/s | 51.3169 KOps/s | |
| test_compile_copy_flat[tensordict-eager] | 0.4695ms | 40.2096μs | 24.8697 KOps/s | 25.3525 KOps/s | |
| test_compile_copy_flat[pytree-compile] | 0.4555ms | 20.3990μs | 49.0220 KOps/s | 46.1193 KOps/s | |
| test_compile_copy_flat[pytree-eager] | 0.3299ms | 50.9679μs | 19.6202 KOps/s | 19.6406 KOps/s | |
| test_compile_assign_and_add[tensordict-compile] | 2.0862ms | 0.2298ms | 4.3508 KOps/s | 3.9444 KOps/s | |
| test_compile_assign_and_add[tensordict-eager] | 3.6412ms | 3.1992ms | 312.5821 Ops/s | 309.7682 Ops/s | |
| test_compile_assign_and_add[pytree-compile] | 1.9916ms | 0.1743ms | 5.7359 KOps/s | 5.5468 KOps/s | |
| test_compile_assign_and_add[pytree-eager] | 3.1327ms | 2.7121ms | 368.7193 Ops/s | 370.1038 Ops/s | |
| test_compile_indexing[tensor-tensordict-compile] | 0.5696ms | 0.1286ms | 7.7783 KOps/s | 7.4948 KOps/s | |
| test_compile_indexing[tensor-tensordict-eager] | 0.5106ms | 73.1268μs | 13.6749 KOps/s | 13.9320 KOps/s | |
| test_compile_indexing[tensor-tensorclass-compile] | 0.2327ms | 0.1139ms | 8.7791 KOps/s | 8.5024 KOps/s | |
| test_compile_indexing[tensor-tensorclass-eager] | 0.4816ms | 43.1575μs | 23.1710 KOps/s | 21.8137 KOps/s | |
| test_compile_indexing[tensor-pytree-compile] | 0.5527ms | 0.1152ms | 8.6779 KOps/s | 8.4095 KOps/s | |
| test_compile_indexing[tensor-pytree-eager] | 0.4722ms | 43.3496μs | 23.0683 KOps/s | 22.8794 KOps/s | |
| test_compile_indexing[slice-tensordict-compile] | 0.5101ms | 79.4785μs | 12.5820 KOps/s | 12.2310 KOps/s | |
| test_compile_indexing[slice-tensordict-eager] | 0.4483ms | 26.3609μs | 37.9350 KOps/s | 38.2714 KOps/s | |
| test_compile_indexing[slice-tensorclass-compile] | 0.2080ms | 73.1505μs | 13.6704 KOps/s | 14.5498 KOps/s | |
| test_compile_indexing[slice-tensorclass-eager] | 0.2330ms | 20.7642μs | 48.1598 KOps/s | 47.4761 KOps/s | |
| test_compile_indexing[slice-pytree-compile] | 0.1203ms | 67.4976μs | 14.8153 KOps/s | 14.4449 KOps/s | |
| test_compile_indexing[slice-pytree-eager] | 0.2477ms | 21.2430μs | 47.0744 KOps/s | 47.2921 KOps/s | |
| test_compile_indexing[int-tensordict-compile] | 0.1498ms | 83.1141μs | 12.0317 KOps/s | 12.0358 KOps/s | |
| test_compile_indexing[int-tensordict-eager] | 0.2669ms | 26.2066μs | 38.1584 KOps/s | 37.8430 KOps/s | |
| test_compile_indexing[int-tensorclass-compile] | 0.1293ms | 67.7539μs | 14.7593 KOps/s | 14.5776 KOps/s | |
| test_compile_indexing[int-tensorclass-eager] | 0.2525ms | 20.8373μs | 47.9909 KOps/s | 47.0187 KOps/s | |
| test_compile_indexing[int-pytree-compile] | 0.1111ms | 67.6268μs | 14.7870 KOps/s | 14.5206 KOps/s | |
| test_compile_indexing[int-pytree-eager] | 0.2651ms | 20.9175μs | 47.8069 KOps/s | 46.8833 KOps/s | |
| test_compile_replace[single-eager] | 0.1063ms | 45.4142μs | 22.0196 KOps/s | 21.7527 KOps/s | |
| test_compile_replace[single-compile] | 0.2319ms | 0.1237ms | 8.0839 KOps/s | 7.8660 KOps/s | |
| test_compile_replace[multi-eager] | 0.6858ms | 0.5545ms | 1.8033 KOps/s | 1.8226 KOps/s | |
| test_compile_replace[multi-compile] | 0.3228ms | 0.1329ms | 7.5254 KOps/s | 7.4112 KOps/s | |
| test_compile_tc_getattr_20[eager] | 0.2380ms | 0.1650ms | 6.0622 KOps/s | 6.2033 KOps/s | |
| test_compile_tc_getattr_20[compile] | 0.3333ms | 0.1430ms | 6.9949 KOps/s | 6.8436 KOps/s | |
| test_compile_clone_shallow[20-eager] | 61.5710μs | 18.7721μs | 53.2704 KOps/s | 54.4692 KOps/s | |
| test_compile_clone_shallow[20-compile] | 0.1352ms | 15.8453μs | 63.1100 KOps/s | 61.0379 KOps/s | |
| test_compile_clone_shallow[40-eager] | 94.0020μs | 33.2029μs | 30.1178 KOps/s | 30.8432 KOps/s | |
| test_compile_clone_shallow[40-compile] | 71.2820μs | 17.6462μs | 56.6694 KOps/s | 55.0597 KOps/s | |
| test_compile_clone_shallow[80-eager] | 0.1051ms | 61.6627μs | 16.2173 KOps/s | 16.4878 KOps/s | |
| test_compile_clone_shallow[80-compile] | 83.9120μs | 21.4548μs | 46.6095 KOps/s | 45.6784 KOps/s | |
| test_compile_update_inplace[eager] | 0.2141ms | 59.6253μs | 16.7714 KOps/s | 16.8690 KOps/s | |
| test_compile_update_inplace[compile] | 0.3259ms | 0.1397ms | 7.1596 KOps/s | 6.9660 KOps/s | |
| test_mod_add[eager] | 0.2996ms | 0.2197ms | 4.5519 KOps/s | 4.5190 KOps/s | |
| test_mod_add[compile] | 0.5482ms | 0.1271ms | 7.8699 KOps/s | 7.5065 KOps/s | |
| test_mod_add[compile-overhead] | 0.3698ms | 0.1718ms | 5.8223 KOps/s | 5.7121 KOps/s | |
| test_mod_wrap[eager] | 0.5808ms | 0.4528ms | 2.2087 KOps/s | 2.1875 KOps/s | |
| test_mod_wrap[compile] | 0.4889ms | 0.3887ms | 2.5728 KOps/s | 2.5555 KOps/s | |
| test_mod_wrap[compile-overhead] | 8.7049ms | 4.6543ms | 214.8533 Ops/s | 220.8137 Ops/s | |
| test_mod_wrap_and_backward[eager] | 1.7786ms | 1.6519ms | 605.3487 Ops/s | 593.7330 Ops/s | |
| test_mod_wrap_and_backward[compile] | 2.3827ms | 1.5724ms | 635.9815 Ops/s | 654.7045 Ops/s | |
| test_mod_wrap_and_backward[compile-overhead] | 1.2810ms | 0.9163ms | 1.0914 KOps/s | 1.0617 KOps/s | |
| test_seq_add[eager] | 0.5887ms | 0.4980ms | 2.0081 KOps/s | 1.9976 KOps/s | |
| test_seq_add[compile] | 0.2678ms | 0.1422ms | 7.0301 KOps/s | 7.0922 KOps/s | |
| test_seq_add[compile-overhead] | 0.3339ms | 0.1796ms | 5.5678 KOps/s | 5.2319 KOps/s | |
| test_seq_wrap[eager] | 1.5860ms | 1.3714ms | 729.1893 Ops/s | 718.4127 Ops/s | |
| test_seq_wrap[compile] | 0.4753ms | 0.3972ms | 2.5175 KOps/s | 2.4430 KOps/s | |
| test_seq_wrap[compile-overhead] | 0.3693ms | 0.2931ms | 3.4113 KOps/s | 3.3114 KOps/s | |
| test_func_call_runtime[False-eager] | 0.8968ms | 0.8073ms | 1.2387 KOps/s | 1.2363 KOps/s | |
| test_func_call_runtime[False-compile] | 1.0451ms | 0.9872ms | 1.0130 KOps/s | 1.0434 KOps/s | |
| test_func_call_runtime[False-compile-overhead] | 0.6477ms | 0.4882ms | 2.0484 KOps/s | 2.0011 KOps/s | |
| test_func_call_runtime[True-eager] | 1.0881ms | 1.0072ms | 992.8076 Ops/s | 945.0619 Ops/s | |
| test_func_call_runtime[True-compile] | 1.0599ms | 0.9540ms | 1.0482 KOps/s | 1.0012 KOps/s | |
| test_func_call_runtime[True-compile-overhead] | 0.5727ms | 0.5001ms | 1.9996 KOps/s | 1.9203 KOps/s | |
| test_func_call_cm_runtime[False-eager] | 0.9013ms | 0.7714ms | 1.2963 KOps/s | 1.2095 KOps/s | |
| test_func_call_cm_runtime[False-compile] | 1.0038ms | 0.9266ms | 1.0792 KOps/s | 1.0539 KOps/s | |
| test_func_call_cm_runtime[False-compile-overhead] | 0.6287ms | 0.4721ms | 2.1180 KOps/s | 2.0770 KOps/s | |
| test_func_call_cm_runtime[True-eager] | 1.2441ms | 1.1331ms | 882.5154 Ops/s | 854.7894 Ops/s | |
| test_func_call_cm_runtime[True-compile] | 1.0890ms | 0.9808ms | 1.0195 KOps/s | 1.0108 KOps/s | |
| test_func_call_cm_runtime[True-compile-overhead] | 0.6021ms | 0.5198ms | 1.9237 KOps/s | 1.8998 KOps/s | |
| test_vmap_func_call_cm_runtime[eager] | 2.7428ms | 2.3166ms | 431.6600 Ops/s | 430.4191 Ops/s | |
| test_vmap_func_call_cm_runtime[compile] | 1.0886ms | 0.9855ms | 1.0147 KOps/s | 998.1458 Ops/s | |
| test_vmap_func_call_cm_runtime[compile-overhead] | 0.5963ms | 0.5138ms | 1.9464 KOps/s | 1.9340 KOps/s | |
| test_distributed | 0.6760ms | 0.1446ms | 6.9149 KOps/s | 6.6362 KOps/s | |
| test_tdmodule | 0.2875ms | 0.1874ms | 5.3360 KOps/s | 5.3186 KOps/s | |
| test_tdmodule_dispatch | 0.4592ms | 0.3593ms | 2.7835 KOps/s | 2.7528 KOps/s | |
| test_tdseq | 44.9710μs | 25.2562μs | 39.5942 KOps/s | 39.1884 KOps/s | |
| test_tdseq_dispatch | 0.2530ms | 0.2068ms | 4.8348 KOps/s | 4.7639 KOps/s | |
| test_instantiation_functorch | 2.0154ms | 1.9580ms | 510.7200 Ops/s | 507.4216 Ops/s | |
| test_exec_functorch | 0.2331ms | 0.1733ms | 5.7716 KOps/s | 5.7247 KOps/s | |
| test_exec_functional_call | 0.2492ms | 0.1521ms | 6.5758 KOps/s | 6.5988 KOps/s | |
| test_exec_td_decorator | 0.4482ms | 0.2259ms | 4.4277 KOps/s | 4.4022 KOps/s | |
| test_vmap_mlp_speed_decorator[True-True] | 1.1886ms | 0.9798ms | 1.0206 KOps/s | 1.0087 KOps/s | |
| test_vmap_mlp_speed_decorator[True-False] | 1.2044ms | 0.9789ms | 1.0216 KOps/s | 1.0044 KOps/s | |
| test_vmap_mlp_speed_decorator[False-True] | 0.8918ms | 0.6921ms | 1.4448 KOps/s | 1.4314 KOps/s | |
| test_vmap_mlp_speed_decorator[False-False] | 0.8950ms | 0.6955ms | 1.4379 KOps/s | 1.4348 KOps/s | |
| test_vmap_transformer_speed_decorator[True-True] | 20.8982ms | 20.4209ms | 48.9695 Ops/s | 48.8128 Ops/s | |
| test_vmap_transformer_speed_decorator[True-False] | 21.0715ms | 20.3173ms | 49.2191 Ops/s | 48.9311 Ops/s | |
| test_vmap_transformer_speed_decorator[False-True] | 20.8372ms | 20.0297ms | 49.9260 Ops/s | 49.7874 Ops/s | |
| test_vmap_transformer_speed_decorator[False-False] | 20.6878ms | 20.0298ms | 49.9256 Ops/s | 49.8250 Ops/s | |
| test_to_module_speed[True] | 2.0959ms | 1.4256ms | 701.4435 Ops/s | 701.2752 Ops/s | |
| test_to_module_speed[False] | 1.9588ms | 1.3942ms | 717.2485 Ops/s | 720.7488 Ops/s | |
| test_tc_init | 76.4810μs | 41.9138μs | 23.8585 KOps/s | 23.4832 KOps/s | |
| test_tc_init_tensor_only | 41.2010μs | 8.4621μs | 118.1738 KOps/s | 108.6211 KOps/s | |
| test_tc_init_nested | 0.1162ms | 81.6175μs | 12.2523 KOps/s | 11.7540 KOps/s | |
| test_tc_init_many_fields | 35.2110μs | 13.9019μs | 71.9324 KOps/s | 64.8309 KOps/s | |
| test_tc_first_layer_tensor | 26.0810μs | 1.7207μs | 581.1439 KOps/s | 580.9613 KOps/s | |
| test_tc_first_layer_tensor_only | 1.8746μs | 0.3847μs | 2.5997 MOps/s | 2.5938 MOps/s | |
| test_tc_first_layer_tensor_set | 34.8500μs | 3.7317μs | 267.9750 KOps/s | 266.1421 KOps/s | |
| test_tc_first_layer_tensor_only_set | 92.6220μs | 3.1452μs | 317.9484 KOps/s | 320.5111 KOps/s | |
| test_tc_first_layer_nontensor | 28.2910μs | 6.0784μs | 164.5176 KOps/s | 163.6690 KOps/s | |
| test_tc_second_layer_tensor | 37.9910μs | 4.2015μs | 238.0085 KOps/s | 240.0996 KOps/s | |
| test_tc_second_layer_nontensor | 70.6610μs | 8.3447μs | 119.8364 KOps/s | 118.1465 KOps/s | |
| test_unbind | 0.2835s | 16.2043ms | 61.7119 Ops/s | 71.3118 Ops/s | |
| test_full_like | 4.6387ms | 4.3833ms | 228.1374 Ops/s | 228.4717 Ops/s | |
| test_zeros_like | 4.5070ms | 4.3249ms | 231.2207 Ops/s | 228.7877 Ops/s | |
| test_ones_like | 4.4926ms | 4.3729ms | 228.6793 Ops/s | 228.3303 Ops/s | |
| test_clone | 6.5973ms | 6.4500ms | 155.0397 Ops/s | 155.9763 Ops/s | |
| test_squeeze | 64.9110μs | 13.3011μs | 75.1819 KOps/s | 74.6387 KOps/s | |
| test_unsqueeze | 0.3011ms | 0.1082ms | 9.2457 KOps/s | 9.5240 KOps/s | |
| test_split | 0.2420ms | 0.1720ms | 5.8137 KOps/s | 5.7430 KOps/s | |
| test_permute | 0.2365ms | 0.2005ms | 4.9870 KOps/s | 5.0656 KOps/s | |
| test_stack | 51.6035ms | 51.1657ms | 19.5443 Ops/s | 19.5557 Ops/s | |
| test_cat | 51.9011ms | 51.1902ms | 19.5350 Ops/s | 19.5522 Ops/s | |
| test_sequential_tensordict | 0.8102ms | 0.5506ms | 1.8161 KOps/s | 1.7844 KOps/s | |
| test_sequential_graph_module | 0.1863ms | 0.1202ms | 8.3185 KOps/s | 8.7798 KOps/s | |
| test_nested_tensordict | 0.9493ms | 0.7894ms | 1.2668 KOps/s | 1.2714 KOps/s | |
| test_nested_graph_module | 0.5381ms | 0.1294ms | 7.7307 KOps/s | 8.1422 KOps/s |
Same origin as #1708 (PR #1552's fast-path bypass), different guards: when a @Tensorclass is constructed under torch.compile with an omitted defaulted field, the default-fill and None-fill loops were both gated by `not is_compiling()`, leaving the field absent from _tensordict and raising KeyError on access. Drop both guards and the dead `else: pass` (with its stale TODO). Defaults and None-fill now run unconditionally, matching eager semantics. Extend the regression test class to cover concrete defaults, default_factory, and omitted None defaults under compile. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Closed
3 tasks
Tighten the regression tests for #1708 / #1710 with `fullgraph=True` to assert no graph breaks. Doing so surfaced a real graph break in the default-fill loop: `default not in (None, dataclasses.MISSING)` had Dynamo trying to `==`-compare a tensor against `_MISSING_TYPE`, which it can't proxy. Replace the `not in (...)` membership check with explicit `is` / isinstance checks. Hoist `_missing_type` out of the loop so it's resolved once. Behavior in eager is unchanged; under compile the loop now traces cleanly. All five regression tests pass under `backend="eager", fullgraph=True`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add an autouse module-level fixture in test_compile.py that calls torch._dynamo.reset_code_caches() before each test, then drop the 21 copy-pasted explicit calls scattered across individual test methods. The one surviving 4-space-indented call in the `_count_compiles()` helper is kept — it runs mid-test to make the recompile counter deterministic. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Collaborator
Author
|
@peterdsharpe |
Contributor
|
Thank you Vincent! We're about to cut a release for NVIDIA PhysicsNeMo and are currently planning to pin to |
vmoens
added a commit
that referenced
this pull request
May 21, 2026
Merged
6 tasks
vmoens
added a commit
that referenced
this pull request
May 21, 2026
6 tasks
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.
Summary
Fixes #1708 and #1710. Both bugs originate from PR #1552 (the
__init__fast-path bypass) — distinct guards in the same wrapper, gated bynot is_compiling(), that silently skip behavior the dataclass__init__would otherwise have provided.#1708 —
__post_init__silently skipped under compile#1710 — field defaults silently skipped under compile
Root cause
PR #1552 replaced the unconditional dataclass
__init__(self, **kwargs)with a fast-path bypass that writes only the kwargs the caller passed. Four pieces of dataclass-construction behavior were re-added to the fast path but guarded bynot is_compiling():__post_init__invocation in the bypass branch of_init_wrapper__post_init__invocation in_from_tensordictdefault_factoryfill (kwargs.setdefault(key, default))Under
torch.compile, all four were short-circuited. (1) and (2) silently produced wrong output; (3) and (4) caused omitted-but-defaulted fields to be missing from_tensordict, raisingKeyErroron access.Fix
Drop the
not is_compiling()half of all four guards. Also remove a deadelse: passbranch (with stale# TODO: Decide what to do here) that the second guard removal made redundant. The perf motivation of #1552 is preserved — these loops only matter at construction time and only do work proportional to the number of fields.Test plan
Two new regression test classes in
test/test_compile.py:TestTCPostInitCompile([BUG]@tensorclasssilently skips__post_init__undertorch.compile, producing wrong output #1708):__post_init__runs on direct construction under compile__post_init__runs via_from_tensordictunder compileTestTCDefaultsCompile([BUG]@tensorclassfield defaults are not applied undertorch.compile, raisingKeyError#1710):dataclasses.field(default_factory=...)applied under compile= Nonedefault doesn't raise under compileResults:
test/test_tensorclass.py— 144 passed, 1 skippedtest/test_compile.py— 68 passed, 9 skipped (CUDA), 2 xfailed (pre-existing)