Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Feature] Batched actions wrapper #2018

Merged
merged 8 commits into from
Mar 19, 2024
Merged

[Feature] Batched actions wrapper #2018

merged 8 commits into from
Mar 19, 2024

Conversation

vmoens
Copy link
Contributor

@vmoens vmoens commented Mar 18, 2024

TODO:

  • Tests
  • Register class in docs

Example code:

import torch.nn

from torchrl.modules.tensordict_module.actors import BatchedActionWrapper, Actor

from torchrl.envs import CatFrames, GymEnv, TransformedEnv, SerialEnv, InitTracker, Compose
from tensordict.nn import TensorDictSequential as Seq, TensorDictModule as Mod

time_steps = 6
n_obs = 4
n_action = 2
batch = 5


def reshape_cat(data: torch.Tensor):
    return data.unflatten(-1, (time_steps, n_obs))


actor_base = Seq(
    Mod(reshape_cat, in_keys=["obs_cat"], out_keys=["obs_cat_reshape"]),
    Mod(torch.nn.Linear(n_obs, n_action), in_keys=["obs_cat_reshape"], out_keys=["action"])
)
actor = BatchedActionWrapper(actor_base, n_steps=time_steps)

env = TransformedEnv(SerialEnv(batch, lambda: GymEnv("CartPole-v1")),
                     Compose(InitTracker(),
                             CatFrames(N=time_steps, in_keys=["observation"], out_keys=["obs_cat"], dim=-1)
                             ))

print(env.rollout(100, policy=actor, break_when_any_done=False))

Copy link

pytorch-bot bot commented Mar 18, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/2018

Note: Links to docs will display an error until the docs builds have been completed.

❌ 3 New Failures, 1 Unrelated Failure

As of commit 7de1582 with merge base 4bce371 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 18, 2024
@vmoens vmoens changed the title [WIP] Batched actions wrapper [Feature] Batched actions wrapper Mar 18, 2024
@vmoens vmoens added the enhancement New feature or request label Mar 18, 2024
Copy link

github-actions bot commented Mar 18, 2024

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

Total Benchmarks: 91. Improved: $\large\color{#35bf28}4$. Worsened: $\large\color{#d91a1a}4$.

Expand to view detailed results
Name Max Mean Ops Ops on Repo HEAD Change
test_single 53.8058ms 53.5968ms 18.6578 Ops/s 17.8007 Ops/s $\color{#35bf28}+4.82\%$
test_sync 37.5463ms 30.2147ms 33.0964 Ops/s 30.3002 Ops/s $\textbf{\color{#35bf28}+9.23\%}$
test_async 48.4419ms 28.0764ms 35.6171 Ops/s 37.3935 Ops/s $\color{#d91a1a}-4.75\%$
test_simple 0.3917s 0.3386s 2.9536 Ops/s 3.0673 Ops/s $\color{#d91a1a}-3.71\%$
test_transformed 0.5152s 0.4690s 2.1320 Ops/s 2.1112 Ops/s $\color{#35bf28}+0.98\%$
test_serial 1.2475s 1.2065s 0.8289 Ops/s 0.8253 Ops/s $\color{#35bf28}+0.43\%$
test_parallel 1.0944s 1.0526s 0.9500 Ops/s 0.9544 Ops/s $\color{#d91a1a}-0.46\%$
test_step_mdp_speed[True-True-True-True-True] 0.2077ms 21.4429μs 46.6355 KOps/s 46.7998 KOps/s $\color{#d91a1a}-0.35\%$
test_step_mdp_speed[True-True-True-True-False] 41.4770μs 12.9639μs 77.1375 KOps/s 78.4966 KOps/s $\color{#d91a1a}-1.73\%$
test_step_mdp_speed[True-True-True-False-True] 37.6710μs 12.5882μs 79.4396 KOps/s 79.8090 KOps/s $\color{#d91a1a}-0.46\%$
test_step_mdp_speed[True-True-True-False-False] 40.5060μs 7.6114μs 131.3821 KOps/s 131.5132 KOps/s $\color{#d91a1a}-0.10\%$
test_step_mdp_speed[True-True-False-True-True] 53.6800μs 22.9542μs 43.5651 KOps/s 43.9499 KOps/s $\color{#d91a1a}-0.88\%$
test_step_mdp_speed[True-True-False-True-False] 33.9130μs 14.3622μs 69.6271 KOps/s 70.5475 KOps/s $\color{#d91a1a}-1.30\%$
test_step_mdp_speed[True-True-False-False-True] 42.5090μs 13.8313μs 72.3000 KOps/s 73.0318 KOps/s $\color{#d91a1a}-1.00\%$
test_step_mdp_speed[True-True-False-False-False] 29.4350μs 8.8401μs 113.1208 KOps/s 113.9794 KOps/s $\color{#d91a1a}-0.75\%$
test_step_mdp_speed[True-False-True-True-True] 55.5130μs 24.1170μs 41.4645 KOps/s 42.0196 KOps/s $\color{#d91a1a}-1.32\%$
test_step_mdp_speed[True-False-True-True-False] 39.3530μs 15.5428μs 64.3384 KOps/s 64.7773 KOps/s $\color{#d91a1a}-0.68\%$
test_step_mdp_speed[True-False-True-False-True] 47.7190μs 13.8713μs 72.0914 KOps/s 72.6762 KOps/s $\color{#d91a1a}-0.80\%$
test_step_mdp_speed[True-False-True-False-False] 31.9000μs 8.7774μs 113.9283 KOps/s 114.6127 KOps/s $\color{#d91a1a}-0.60\%$
test_step_mdp_speed[True-False-False-True-True] 57.9880μs 25.4115μs 39.3523 KOps/s 40.3893 KOps/s $\color{#d91a1a}-2.57\%$
test_step_mdp_speed[True-False-False-True-False] 37.9200μs 16.8298μs 59.4183 KOps/s 60.9570 KOps/s $\color{#d91a1a}-2.52\%$
test_step_mdp_speed[True-False-False-False-True] 36.2170μs 15.0768μs 66.3272 KOps/s 68.7135 KOps/s $\color{#d91a1a}-3.47\%$
test_step_mdp_speed[True-False-False-False-False] 31.9090μs 10.1408μs 98.6115 KOps/s 101.1688 KOps/s $\color{#d91a1a}-2.53\%$
test_step_mdp_speed[False-True-True-True-True] 54.6520μs 24.1283μs 41.4452 KOps/s 41.9488 KOps/s $\color{#d91a1a}-1.20\%$
test_step_mdp_speed[False-True-True-True-False] 36.0570μs 15.6146μs 64.0424 KOps/s 64.6690 KOps/s $\color{#d91a1a}-0.97\%$
test_step_mdp_speed[False-True-True-False-True] 58.3270μs 15.9361μs 62.7508 KOps/s 63.0718 KOps/s $\color{#d91a1a}-0.51\%$
test_step_mdp_speed[False-True-True-False-False] 32.1400μs 10.1142μs 98.8708 KOps/s 100.8147 KOps/s $\color{#d91a1a}-1.93\%$
test_step_mdp_speed[False-True-False-True-True] 37.6300μs 25.0326μs 39.9479 KOps/s 39.2954 KOps/s $\color{#35bf28}+1.66\%$
test_step_mdp_speed[False-True-False-True-False] 43.4210μs 16.7699μs 59.6306 KOps/s 59.7324 KOps/s $\color{#d91a1a}-0.17\%$
test_step_mdp_speed[False-True-False-False-True] 52.4480μs 17.2055μs 58.1210 KOps/s 59.1114 KOps/s $\color{#d91a1a}-1.68\%$
test_step_mdp_speed[False-True-False-False-False] 36.5680μs 11.0768μs 90.2787 KOps/s 90.7296 KOps/s $\color{#d91a1a}-0.50\%$
test_step_mdp_speed[False-False-True-True-True] 56.3950μs 26.4670μs 37.7829 KOps/s 38.6371 KOps/s $\color{#d91a1a}-2.21\%$
test_step_mdp_speed[False-False-True-True-False] 47.5390μs 18.0585μs 55.3756 KOps/s 55.8025 KOps/s $\color{#d91a1a}-0.76\%$
test_step_mdp_speed[False-False-True-False-True] 53.5290μs 17.0488μs 58.6553 KOps/s 57.9470 KOps/s $\color{#35bf28}+1.22\%$
test_step_mdp_speed[False-False-True-False-False] 36.7480μs 11.2160μs 89.1581 KOps/s 89.7713 KOps/s $\color{#d91a1a}-0.68\%$
test_step_mdp_speed[False-False-False-True-True] 74.3100μs 27.5583μs 36.2867 KOps/s 36.7526 KOps/s $\color{#d91a1a}-1.27\%$
test_step_mdp_speed[False-False-False-True-False] 53.7700μs 19.2397μs 51.9759 KOps/s 52.8599 KOps/s $\color{#d91a1a}-1.67\%$
test_step_mdp_speed[False-False-False-False-True] 61.1760μs 18.0538μs 55.3899 KOps/s 55.4781 KOps/s $\color{#d91a1a}-0.16\%$
test_step_mdp_speed[False-False-False-False-False] 39.5240μs 12.1583μs 82.2484 KOps/s 81.8460 KOps/s $\color{#35bf28}+0.49\%$
test_values[generalized_advantage_estimate-True-True] 9.4426ms 9.2020ms 108.6717 Ops/s 106.2265 Ops/s $\color{#35bf28}+2.30\%$
test_values[vec_generalized_advantage_estimate-True-True] 38.2063ms 35.3206ms 28.3121 Ops/s 28.0238 Ops/s $\color{#35bf28}+1.03\%$
test_values[td0_return_estimate-False-False] 0.2353ms 0.1644ms 6.0810 KOps/s 6.2083 KOps/s $\color{#d91a1a}-2.05\%$
test_values[td1_return_estimate-False-False] 24.6476ms 23.0315ms 43.4188 Ops/s 42.8730 Ops/s $\color{#35bf28}+1.27\%$
test_values[vec_td1_return_estimate-False-False] 39.7909ms 35.3401ms 28.2965 Ops/s 28.4407 Ops/s $\color{#d91a1a}-0.51\%$
test_values[td_lambda_return_estimate-True-False] 36.3825ms 33.4198ms 29.9224 Ops/s 29.6665 Ops/s $\color{#35bf28}+0.86\%$
test_values[vec_td_lambda_return_estimate-True-False] 37.1055ms 35.3516ms 28.2872 Ops/s 28.2801 Ops/s $\color{#35bf28}+0.03\%$
test_gae_speed[generalized_advantage_estimate-False-1-512] 8.2292ms 8.0842ms 123.6974 Ops/s 120.3778 Ops/s $\color{#35bf28}+2.76\%$
test_gae_speed[vec_generalized_advantage_estimate-True-1-512] 2.2387ms 1.9520ms 512.3081 Ops/s 495.9634 Ops/s $\color{#35bf28}+3.30\%$
test_gae_speed[vec_generalized_advantage_estimate-False-1-512] 0.4302ms 0.3451ms 2.8974 KOps/s 2.8614 KOps/s $\color{#35bf28}+1.26\%$
test_gae_speed[vec_generalized_advantage_estimate-True-32-512] 55.1143ms 47.8260ms 20.9091 Ops/s 21.7465 Ops/s $\color{#d91a1a}-3.85\%$
test_gae_speed[vec_generalized_advantage_estimate-False-32-512] 3.7395ms 3.0039ms 332.8984 Ops/s 331.9726 Ops/s $\color{#35bf28}+0.28\%$
test_dqn_speed 3.3546ms 1.3464ms 742.7301 Ops/s 728.7356 Ops/s $\color{#35bf28}+1.92\%$
test_ddpg_speed 3.2845ms 2.6739ms 373.9849 Ops/s 370.3708 Ops/s $\color{#35bf28}+0.98\%$
test_sac_speed 8.6165ms 8.1107ms 123.2946 Ops/s 121.3509 Ops/s $\color{#35bf28}+1.60\%$
test_redq_speed 14.5237ms 12.8676ms 77.7147 Ops/s 77.5705 Ops/s $\color{#35bf28}+0.19\%$
test_redq_deprec_speed 13.6745ms 12.7969ms 78.1441 Ops/s 77.4357 Ops/s $\color{#35bf28}+0.91\%$
test_td3_speed 8.2399ms 8.0554ms 124.1398 Ops/s 122.0180 Ops/s $\color{#35bf28}+1.74\%$
test_cql_speed 0.1043s 38.3278ms 26.0907 Ops/s 27.5969 Ops/s $\textbf{\color{#d91a1a}-5.46\%}$
test_a2c_speed 8.7025ms 7.3026ms 136.9382 Ops/s 136.8868 Ops/s $\color{#35bf28}+0.04\%$
test_ppo_speed 10.7986ms 7.6654ms 130.4568 Ops/s 131.7291 Ops/s $\color{#d91a1a}-0.97\%$
test_reinforce_speed 7.4210ms 6.5116ms 153.5732 Ops/s 153.5172 Ops/s $\color{#35bf28}+0.04\%$
test_iql_speed 33.3613ms 32.3626ms 30.8999 Ops/s 30.8507 Ops/s $\color{#35bf28}+0.16\%$
test_rb_sample[TensorDictReplayBuffer-ListStorage-RandomSampler-4000] 2.4444ms 2.1950ms 455.5743 Ops/s 456.9733 Ops/s $\color{#d91a1a}-0.31\%$
test_rb_sample[TensorDictReplayBuffer-LazyMemmapStorage-RandomSampler-10000] 0.9139ms 0.4931ms 2.0281 KOps/s 1.8240 KOps/s $\textbf{\color{#35bf28}+11.19\%}$
test_rb_sample[TensorDictReplayBuffer-LazyTensorStorage-RandomSampler-10000] 0.6445ms 0.4660ms 2.1461 KOps/s 2.1440 KOps/s $\color{#35bf28}+0.10\%$
test_rb_sample[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-4000] 2.5300ms 2.1680ms 461.2512 Ops/s 452.6160 Ops/s $\color{#35bf28}+1.91\%$
test_rb_sample[TensorDictReplayBuffer-LazyMemmapStorage-SamplerWithoutReplacement-10000] 0.9872ms 0.4862ms 2.0567 KOps/s 2.0556 KOps/s $\color{#35bf28}+0.05\%$
test_rb_sample[TensorDictReplayBuffer-LazyTensorStorage-SamplerWithoutReplacement-10000] 0.6253ms 0.4619ms 2.1649 KOps/s 2.1656 KOps/s $\color{#d91a1a}-0.03\%$
test_rb_sample[TensorDictReplayBuffer-LazyMemmapStorage-sampler6-10000] 2.5639ms 1.2927ms 773.5667 Ops/s 785.1893 Ops/s $\color{#d91a1a}-1.48\%$
test_rb_sample[TensorDictReplayBuffer-LazyTensorStorage-sampler7-10000] 1.7927ms 1.1999ms 833.3913 Ops/s 823.5718 Ops/s $\color{#35bf28}+1.19\%$
test_rb_sample[TensorDictPrioritizedReplayBuffer-ListStorage-None-4000] 2.5731ms 2.3036ms 434.1031 Ops/s 436.2397 Ops/s $\color{#d91a1a}-0.49\%$
test_rb_sample[TensorDictPrioritizedReplayBuffer-LazyMemmapStorage-None-10000] 87.2963ms 0.6779ms 1.4752 KOps/s 1.6426 KOps/s $\textbf{\color{#d91a1a}-10.19\%}$
test_rb_sample[TensorDictPrioritizedReplayBuffer-LazyTensorStorage-None-10000] 0.7265ms 0.5788ms 1.7277 KOps/s 1.7230 KOps/s $\color{#35bf28}+0.27\%$
test_rb_iterate[TensorDictReplayBuffer-ListStorage-RandomSampler-4000] 2.3130ms 2.1382ms 467.6785 Ops/s 447.2413 Ops/s $\color{#35bf28}+4.57\%$
test_rb_iterate[TensorDictReplayBuffer-LazyMemmapStorage-RandomSampler-10000] 0.9975ms 0.4948ms 2.0212 KOps/s 2.0305 KOps/s $\color{#d91a1a}-0.46\%$
test_rb_iterate[TensorDictReplayBuffer-LazyTensorStorage-RandomSampler-10000] 0.7442ms 0.4716ms 2.1202 KOps/s 2.1187 KOps/s $\color{#35bf28}+0.07\%$
test_rb_iterate[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-4000] 2.5624ms 2.1321ms 469.0193 Ops/s 453.1042 Ops/s $\color{#35bf28}+3.51\%$
test_rb_iterate[TensorDictReplayBuffer-LazyMemmapStorage-SamplerWithoutReplacement-10000] 0.9605ms 0.4882ms 2.0485 KOps/s 2.0439 KOps/s $\color{#35bf28}+0.22\%$
test_rb_iterate[TensorDictReplayBuffer-LazyTensorStorage-SamplerWithoutReplacement-10000] 3.8207ms 0.4662ms 2.1448 KOps/s 2.1395 KOps/s $\color{#35bf28}+0.25\%$
test_rb_iterate[TensorDictPrioritizedReplayBuffer-ListStorage-None-4000] 2.4260ms 2.2420ms 446.0313 Ops/s 431.2636 Ops/s $\color{#35bf28}+3.42\%$
test_rb_iterate[TensorDictPrioritizedReplayBuffer-LazyMemmapStorage-None-10000] 1.1675ms 0.6073ms 1.6465 KOps/s 1.6388 KOps/s $\color{#35bf28}+0.47\%$
test_rb_iterate[TensorDictPrioritizedReplayBuffer-LazyTensorStorage-None-10000] 0.7895ms 0.5848ms 1.7101 KOps/s 1.7319 KOps/s $\color{#d91a1a}-1.26\%$
test_rb_populate[TensorDictReplayBuffer-ListStorage-RandomSampler-400] 0.1008s 7.2242ms 138.4242 Ops/s 140.7427 Ops/s $\color{#d91a1a}-1.65\%$
test_rb_populate[TensorDictReplayBuffer-LazyMemmapStorage-RandomSampler-400] 14.5254ms 12.0404ms 83.0535 Ops/s 80.9928 Ops/s $\color{#35bf28}+2.54\%$
test_rb_populate[TensorDictReplayBuffer-LazyTensorStorage-RandomSampler-400] 1.8972ms 1.0973ms 911.3664 Ops/s 966.8674 Ops/s $\textbf{\color{#d91a1a}-5.74\%}$
test_rb_populate[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-400] 82.8809ms 5.1881ms 192.7496 Ops/s 142.8083 Ops/s $\textbf{\color{#35bf28}+34.97\%}$
test_rb_populate[TensorDictReplayBuffer-LazyMemmapStorage-SamplerWithoutReplacement-400] 14.0673ms 11.8527ms 84.3691 Ops/s 81.2865 Ops/s $\color{#35bf28}+3.79\%$
test_rb_populate[TensorDictReplayBuffer-LazyTensorStorage-SamplerWithoutReplacement-400] 3.8802ms 1.1153ms 896.6526 Ops/s 936.5648 Ops/s $\color{#d91a1a}-4.26\%$
test_rb_populate[TensorDictPrioritizedReplayBuffer-ListStorage-None-400] 87.5626ms 7.2140ms 138.6202 Ops/s 177.6329 Ops/s $\textbf{\color{#d91a1a}-21.96\%}$
test_rb_populate[TensorDictPrioritizedReplayBuffer-LazyMemmapStorage-None-400] 14.9046ms 12.2307ms 81.7613 Ops/s 70.0661 Ops/s $\textbf{\color{#35bf28}+16.69\%}$
test_rb_populate[TensorDictPrioritizedReplayBuffer-LazyTensorStorage-None-400] 4.0743ms 1.4192ms 704.6437 Ops/s 696.8171 Ops/s $\color{#35bf28}+1.12\%$

Copy link

github-actions bot commented Mar 18, 2024

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

Total Benchmarks: 94. Improved: $\large\color{#35bf28}5$. Worsened: $\large\color{#d91a1a}4$.

Expand to view detailed results
Name Max Mean Ops Ops on Repo HEAD Change
test_single 0.1017s 0.1013s 9.8685 Ops/s 9.9829 Ops/s $\color{#d91a1a}-1.15\%$
test_sync 92.5780ms 89.1321ms 11.2193 Ops/s 11.1594 Ops/s $\color{#35bf28}+0.54\%$
test_async 0.1655s 70.0949ms 14.2664 Ops/s 11.2203 Ops/s $\textbf{\color{#35bf28}+27.15\%}$
test_single_pixels 0.1113s 0.1111s 9.0016 Ops/s 9.0914 Ops/s $\color{#d91a1a}-0.99\%$
test_sync_pixels 67.4937ms 66.3441ms 15.0729 Ops/s 15.0506 Ops/s $\color{#35bf28}+0.15\%$
test_async_pixels 0.1210s 56.3088ms 17.7592 Ops/s 17.6466 Ops/s $\color{#35bf28}+0.64\%$
test_simple 0.6678s 0.6632s 1.5078 Ops/s 1.5014 Ops/s $\color{#35bf28}+0.42\%$
test_transformed 0.8649s 0.8642s 1.1572 Ops/s 1.1515 Ops/s $\color{#35bf28}+0.49\%$
test_serial 2.1371s 2.0807s 0.4806 Ops/s 0.4865 Ops/s $\color{#d91a1a}-1.21\%$
test_parallel 1.8767s 1.8207s 0.5492 Ops/s 0.5549 Ops/s $\color{#d91a1a}-1.03\%$
test_step_mdp_speed[True-True-True-True-True] 85.1820μs 32.3542μs 30.9078 KOps/s 30.5779 KOps/s $\color{#35bf28}+1.08\%$
test_step_mdp_speed[True-True-True-True-False] 48.1910μs 19.3943μs 51.5616 KOps/s 50.9760 KOps/s $\color{#35bf28}+1.15\%$
test_step_mdp_speed[True-True-True-False-True] 45.9710μs 18.1820μs 54.9994 KOps/s 54.1084 KOps/s $\color{#35bf28}+1.65\%$
test_step_mdp_speed[True-True-True-False-False] 32.6710μs 10.9826μs 91.0534 KOps/s 89.3121 KOps/s $\color{#35bf28}+1.95\%$
test_step_mdp_speed[True-True-False-True-True] 65.5010μs 34.4245μs 29.0490 KOps/s 29.0470 KOps/s $+0.01\%$
test_step_mdp_speed[True-True-False-True-False] 48.2000μs 21.2674μs 47.0203 KOps/s 46.4196 KOps/s $\color{#35bf28}+1.29\%$
test_step_mdp_speed[True-True-False-False-True] 48.1600μs 20.0989μs 49.7541 KOps/s 49.6785 KOps/s $\color{#35bf28}+0.15\%$
test_step_mdp_speed[True-True-False-False-False] 90.1910μs 12.9317μs 77.3294 KOps/s 76.2957 KOps/s $\color{#35bf28}+1.35\%$
test_step_mdp_speed[True-False-True-True-True] 67.2710μs 36.7502μs 27.2107 KOps/s 27.8677 KOps/s $\color{#d91a1a}-2.36\%$
test_step_mdp_speed[True-False-True-True-False] 59.7800μs 23.3492μs 42.8281 KOps/s 42.4739 KOps/s $\color{#35bf28}+0.83\%$
test_step_mdp_speed[True-False-True-False-True] 53.3000μs 20.0940μs 49.7662 KOps/s 50.3882 KOps/s $\color{#d91a1a}-1.23\%$
test_step_mdp_speed[True-False-True-False-False] 34.3100μs 12.9376μs 77.2940 KOps/s 76.8999 KOps/s $\color{#35bf28}+0.51\%$
test_step_mdp_speed[True-False-False-True-True] 77.3710μs 38.4590μs 26.0017 KOps/s 26.6036 KOps/s $\color{#d91a1a}-2.26\%$
test_step_mdp_speed[True-False-False-True-False] 52.1100μs 25.1399μs 39.7774 KOps/s 39.4298 KOps/s $\color{#35bf28}+0.88\%$
test_step_mdp_speed[True-False-False-False-True] 48.0810μs 21.8143μs 45.8415 KOps/s 45.4267 KOps/s $\color{#35bf28}+0.91\%$
test_step_mdp_speed[True-False-False-False-False] 37.2900μs 14.7036μs 68.0107 KOps/s 66.7724 KOps/s $\color{#35bf28}+1.85\%$
test_step_mdp_speed[False-True-True-True-True] 66.5300μs 36.1457μs 27.6658 KOps/s 27.3063 KOps/s $\color{#35bf28}+1.32\%$
test_step_mdp_speed[False-True-True-True-False] 55.8910μs 23.1759μs 43.1482 KOps/s 42.5708 KOps/s $\color{#35bf28}+1.36\%$
test_step_mdp_speed[False-True-True-False-True] 51.2310μs 24.0953μs 41.5018 KOps/s 41.4546 KOps/s $\color{#35bf28}+0.11\%$
test_step_mdp_speed[False-True-True-False-False] 37.9500μs 14.7240μs 67.9163 KOps/s 67.0956 KOps/s $\color{#35bf28}+1.22\%$
test_step_mdp_speed[False-True-False-True-True] 69.0110μs 37.9175μs 26.3730 KOps/s 26.3580 KOps/s $\color{#35bf28}+0.06\%$
test_step_mdp_speed[False-True-False-True-False] 54.0500μs 25.0318μs 39.9493 KOps/s 39.3732 KOps/s $\color{#35bf28}+1.46\%$
test_step_mdp_speed[False-True-False-False-True] 53.2420μs 25.7512μs 38.8331 KOps/s 38.8316 KOps/s $+0.00\%$
test_step_mdp_speed[False-True-False-False-False] 40.0310μs 16.4729μs 60.7057 KOps/s 59.4690 KOps/s $\color{#35bf28}+2.08\%$
test_step_mdp_speed[False-False-True-True-True] 76.8510μs 39.9377μs 25.0390 KOps/s 25.0839 KOps/s $\color{#d91a1a}-0.18\%$
test_step_mdp_speed[False-False-True-True-False] 59.8120μs 27.1468μs 36.8368 KOps/s 36.7278 KOps/s $\color{#35bf28}+0.30\%$
test_step_mdp_speed[False-False-True-False-True] 53.1800μs 26.2606μs 38.0799 KOps/s 39.1488 KOps/s $\color{#d91a1a}-2.73\%$
test_step_mdp_speed[False-False-True-False-False] 41.6210μs 16.3997μs 60.9768 KOps/s 59.8328 KOps/s $\color{#35bf28}+1.91\%$
test_step_mdp_speed[False-False-False-True-True] 73.5910μs 41.0107μs 24.3839 KOps/s 24.2569 KOps/s $\color{#35bf28}+0.52\%$
test_step_mdp_speed[False-False-False-True-False] 64.4010μs 28.8713μs 34.6365 KOps/s 34.4342 KOps/s $\color{#35bf28}+0.59\%$
test_step_mdp_speed[False-False-False-False-True] 0.1047ms 27.0698μs 36.9416 KOps/s 36.3269 KOps/s $\color{#35bf28}+1.69\%$
test_step_mdp_speed[False-False-False-False-False] 42.6110μs 17.9681μs 55.6541 KOps/s 54.1033 KOps/s $\color{#35bf28}+2.87\%$
test_values[generalized_advantage_estimate-True-True] 25.5510ms 24.7792ms 40.3564 Ops/s 42.2763 Ops/s $\color{#d91a1a}-4.54\%$
test_values[vec_generalized_advantage_estimate-True-True] 86.1641ms 3.2815ms 304.7341 Ops/s 309.7133 Ops/s $\color{#d91a1a}-1.61\%$
test_values[td0_return_estimate-False-False] 93.4510μs 62.5332μs 15.9915 KOps/s 16.0134 KOps/s $\color{#d91a1a}-0.14\%$
test_values[td1_return_estimate-False-False] 53.5259ms 52.2343ms 19.1445 Ops/s 19.9030 Ops/s $\color{#d91a1a}-3.81\%$
test_values[vec_td1_return_estimate-False-False] 2.0512ms 1.7508ms 571.1669 Ops/s 574.6518 Ops/s $\color{#d91a1a}-0.61\%$
test_values[td_lambda_return_estimate-True-False] 85.8542ms 83.6028ms 11.9613 Ops/s 12.5279 Ops/s $\color{#d91a1a}-4.52\%$
test_values[vec_td_lambda_return_estimate-True-False] 2.0489ms 1.7452ms 572.9852 Ops/s 575.6776 Ops/s $\color{#d91a1a}-0.47\%$
test_gae_speed[generalized_advantage_estimate-False-1-512] 24.0336ms 23.4322ms 42.6762 Ops/s 45.7153 Ops/s $\textbf{\color{#d91a1a}-6.65\%}$
test_gae_speed[vec_generalized_advantage_estimate-True-1-512] 0.8723ms 0.6875ms 1.4545 KOps/s 1.4826 KOps/s $\color{#d91a1a}-1.90\%$
test_gae_speed[vec_generalized_advantage_estimate-False-1-512] 0.7091ms 0.6538ms 1.5294 KOps/s 1.5827 KOps/s $\color{#d91a1a}-3.37\%$
test_gae_speed[vec_generalized_advantage_estimate-True-32-512] 1.6102ms 1.4454ms 691.8707 Ops/s 697.9861 Ops/s $\color{#d91a1a}-0.88\%$
test_gae_speed[vec_generalized_advantage_estimate-False-32-512] 0.9352ms 0.6637ms 1.5068 KOps/s 1.5356 KOps/s $\color{#d91a1a}-1.87\%$
test_dqn_speed 8.3359ms 1.3978ms 715.3947 Ops/s 700.2385 Ops/s $\color{#35bf28}+2.16\%$
test_ddpg_speed 2.9319ms 2.6426ms 378.4186 Ops/s 375.8937 Ops/s $\color{#35bf28}+0.67\%$
test_sac_speed 8.4627ms 7.8568ms 127.2783 Ops/s 127.2275 Ops/s $\color{#35bf28}+0.04\%$
test_redq_speed 10.9557ms 9.9857ms 100.1436 Ops/s 97.6981 Ops/s $\color{#35bf28}+2.50\%$
test_redq_deprec_speed 11.4323ms 10.7894ms 92.6833 Ops/s 91.2499 Ops/s $\color{#35bf28}+1.57\%$
test_td3_speed 7.8552ms 7.7688ms 128.7194 Ops/s 126.6483 Ops/s $\color{#35bf28}+1.64\%$
test_cql_speed 25.6880ms 24.6582ms 40.5544 Ops/s 39.3316 Ops/s $\color{#35bf28}+3.11\%$
test_a2c_speed 5.6457ms 5.4255ms 184.3137 Ops/s 166.8786 Ops/s $\textbf{\color{#35bf28}+10.45\%}$
test_ppo_speed 5.9807ms 5.7381ms 174.2750 Ops/s 170.5841 Ops/s $\color{#35bf28}+2.16\%$
test_reinforce_speed 5.3971ms 4.4340ms 225.5288 Ops/s 221.9210 Ops/s $\color{#35bf28}+1.63\%$
test_iql_speed 19.4697ms 18.9736ms 52.7049 Ops/s 51.7560 Ops/s $\color{#35bf28}+1.83\%$
test_rb_sample[TensorDictReplayBuffer-ListStorage-RandomSampler-4000] 2.9785ms 2.8460ms 351.3731 Ops/s 352.8116 Ops/s $\color{#d91a1a}-0.41\%$
test_rb_sample[TensorDictReplayBuffer-LazyMemmapStorage-RandomSampler-10000] 1.3950ms 0.5421ms 1.8446 KOps/s 1.8234 KOps/s $\color{#35bf28}+1.16\%$
test_rb_sample[TensorDictReplayBuffer-LazyTensorStorage-RandomSampler-10000] 0.7112ms 0.5225ms 1.9139 KOps/s 1.9167 KOps/s $\color{#d91a1a}-0.15\%$
test_rb_sample[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-4000] 3.0398ms 2.8277ms 353.6502 Ops/s 351.7889 Ops/s $\color{#35bf28}+0.53\%$
test_rb_sample[TensorDictReplayBuffer-LazyMemmapStorage-SamplerWithoutReplacement-10000] 1.5425ms 0.5320ms 1.8796 KOps/s 1.8676 KOps/s $\color{#35bf28}+0.64\%$
test_rb_sample[TensorDictReplayBuffer-LazyTensorStorage-SamplerWithoutReplacement-10000] 0.7544ms 0.5113ms 1.9560 KOps/s 1.9422 KOps/s $\color{#35bf28}+0.71\%$
test_rb_sample[TensorDictReplayBuffer-LazyMemmapStorage-sampler6-10000] 1.6149ms 1.4869ms 672.5493 Ops/s 668.9990 Ops/s $\color{#35bf28}+0.53\%$
test_rb_sample[TensorDictReplayBuffer-LazyTensorStorage-sampler7-10000] 1.6343ms 1.4378ms 695.5276 Ops/s 693.9078 Ops/s $\color{#35bf28}+0.23\%$
test_rb_sample[TensorDictPrioritizedReplayBuffer-ListStorage-None-4000] 3.1774ms 2.9784ms 335.7465 Ops/s 342.4995 Ops/s $\color{#d91a1a}-1.97\%$
test_rb_sample[TensorDictPrioritizedReplayBuffer-LazyMemmapStorage-None-10000] 0.7959ms 0.6660ms 1.5015 KOps/s 1.4775 KOps/s $\color{#35bf28}+1.62\%$
test_rb_sample[TensorDictPrioritizedReplayBuffer-LazyTensorStorage-None-10000] 4.6759ms 0.6431ms 1.5549 KOps/s 1.4137 KOps/s $\textbf{\color{#35bf28}+9.98\%}$
test_rb_iterate[TensorDictReplayBuffer-ListStorage-RandomSampler-4000] 3.0572ms 2.8522ms 350.6071 Ops/s 354.9945 Ops/s $\color{#d91a1a}-1.24\%$
test_rb_iterate[TensorDictReplayBuffer-LazyMemmapStorage-RandomSampler-10000] 0.8298ms 0.5462ms 1.8308 KOps/s 1.8320 KOps/s $\color{#d91a1a}-0.07\%$
test_rb_iterate[TensorDictReplayBuffer-LazyTensorStorage-RandomSampler-10000] 0.1050s 0.6479ms 1.5434 KOps/s 1.8841 KOps/s $\textbf{\color{#d91a1a}-18.08\%}$
test_rb_iterate[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-4000] 3.0743ms 2.8843ms 346.7065 Ops/s 351.2030 Ops/s $\color{#d91a1a}-1.28\%$
test_rb_iterate[TensorDictReplayBuffer-LazyMemmapStorage-SamplerWithoutReplacement-10000] 0.8008ms 0.5451ms 1.8345 KOps/s 1.8636 KOps/s $\color{#d91a1a}-1.56\%$
test_rb_iterate[TensorDictReplayBuffer-LazyTensorStorage-SamplerWithoutReplacement-10000] 0.6856ms 0.5210ms 1.9193 KOps/s 1.9516 KOps/s $\color{#d91a1a}-1.66\%$
test_rb_iterate[TensorDictPrioritizedReplayBuffer-ListStorage-None-4000] 3.1835ms 2.9618ms 337.6315 Ops/s 340.5127 Ops/s $\color{#d91a1a}-0.85\%$
test_rb_iterate[TensorDictPrioritizedReplayBuffer-LazyMemmapStorage-None-10000] 0.7908ms 0.6711ms 1.4901 KOps/s 1.4862 KOps/s $\color{#35bf28}+0.27\%$
test_rb_iterate[TensorDictPrioritizedReplayBuffer-LazyTensorStorage-None-10000] 0.1070s 0.7842ms 1.2752 KOps/s 1.5349 KOps/s $\textbf{\color{#d91a1a}-16.92\%}$
test_rb_populate[TensorDictReplayBuffer-ListStorage-RandomSampler-400] 0.1045s 6.7121ms 148.9852 Ops/s 116.2764 Ops/s $\textbf{\color{#35bf28}+28.13\%}$
test_rb_populate[TensorDictReplayBuffer-LazyMemmapStorage-RandomSampler-400] 17.0832ms 14.5386ms 68.7825 Ops/s 67.9150 Ops/s $\color{#35bf28}+1.28\%$
test_rb_populate[TensorDictReplayBuffer-LazyTensorStorage-RandomSampler-400] 2.3748ms 1.1096ms 901.2117 Ops/s 942.3386 Ops/s $\color{#d91a1a}-4.36\%$
test_rb_populate[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-400] 0.1022s 8.5472ms 116.9978 Ops/s 151.3560 Ops/s $\textbf{\color{#d91a1a}-22.70\%}$
test_rb_populate[TensorDictReplayBuffer-LazyMemmapStorage-SamplerWithoutReplacement-400] 16.8618ms 14.5792ms 68.5907 Ops/s 68.1103 Ops/s $\color{#35bf28}+0.71\%$
test_rb_populate[TensorDictReplayBuffer-LazyTensorStorage-SamplerWithoutReplacement-400] 2.1875ms 1.0984ms 910.4287 Ops/s 933.7899 Ops/s $\color{#d91a1a}-2.50\%$
test_rb_populate[TensorDictPrioritizedReplayBuffer-ListStorage-None-400] 0.1012s 7.0027ms 142.8012 Ops/s 110.4211 Ops/s $\textbf{\color{#35bf28}+29.32\%}$
test_rb_populate[TensorDictPrioritizedReplayBuffer-LazyMemmapStorage-None-400] 17.0195ms 14.8866ms 67.1747 Ops/s 66.5410 Ops/s $\color{#35bf28}+0.95\%$
test_rb_populate[TensorDictPrioritizedReplayBuffer-LazyTensorStorage-None-400] 2.5714ms 1.4441ms 692.4719 Ops/s 705.8810 Ops/s $\color{#d91a1a}-1.90\%$

@vmoens vmoens merged commit 76b296d into main Mar 19, 2024
63 of 67 checks passed
@vmoens vmoens deleted the batched-actions branch March 19, 2024 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants