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] Span slice indices on the left and on the right #2107

Merged
merged 2 commits into from
Apr 24, 2024
Merged

Conversation

vmoens
Copy link
Contributor

@vmoens vmoens commented Apr 24, 2024

Allows to sample from a replay buffer storing trajectories by indicating the left and right span.

For instance, span=(True, True) with trajectories of length 10 and slices of length (at most) 5 will lead to possible indices:

[0]
[0, 1]
[0, 1, 2]
...
[0, 1, 2, 3, 4]
[1, 2, 3, 4, 5]
...
[6, 7, 8, 9]
[7, 8, 9]
[8, 9]
[9]

and (False, True)

[0, 1, 2, 3, 4]
[1, 2, 3, 4, 5]
...
[6, 7, 8, 9]
[7, 8, 9]
[8, 9]
[9]

Hope that's useful!

Here's a piece of code to test the feature

from torchrl.collectors.utils import split_trajectories
from torchrl.data import SliceSampler, TensorDictReplayBuffer, LazyMemmapStorage
from tensordict import TensorDict
import torch
torch.manual_seed(0)
data = TensorDict(
    {"obs": torch.arange(1, 11).repeat(10),
     "eps": torch.arange(100) // 10 + 1} ,
    [100]
)

for N in (2, 4, ):
    rb = TensorDictReplayBuffer(sampler=SliceSampler(num_slices=10, traj_key="eps", span=(N, N)), batch_size=50, storage=LazyMemmapStorage(100))
    rb.extend(data)

    for _ in range(10):
        sample = rb.sample()
        sample = split_trajectories(sample)
        assert (sample["next", "truncated"].squeeze(-1).sum(-1) == 1).all()
        assert ((sample["obs"] == 0).sum(-1) <= N).all(), sample["obs"]
        assert ((sample["eps"] == 0).sum(-1) <= N).all()
        for i in range(sample.shape[0]):
            curr_eps = sample[i]["eps"]
            curr_eps = curr_eps[curr_eps != 0]
            assert curr_eps.unique().numel() == 1
        print(sample)
        print('episode')
        print(sample["eps"])
        print('obs')
        print(sample["obs"])
        print('trunc')
        print(sample["next", "truncated"].int().squeeze())

cc @Cadene @alexander-soare

Copy link

pytorch-bot bot commented Apr 24, 2024

🔗 Helpful Links

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

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

❌ 2 New Failures, 2 Unrelated Failures

As of commit e7cbbe7 with merge base 6f1c387 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs 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 Apr 24, 2024
Copy link

github-actions bot commented Apr 24, 2024

$\color{#D29922}\textsf{\Large&amp;#x26A0;\kern{0.2cm}\normalsize Warning}$ Result of CPU Benchmark Tests

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

Expand to view detailed results
Name Max Mean Ops Ops on Repo HEAD Change
test_single 56.2155ms 55.7272ms 17.9446 Ops/s 18.1445 Ops/s $\color{#d91a1a}-1.10\%$
test_sync 32.1902ms 30.4763ms 32.8124 Ops/s 30.2444 Ops/s $\textbf{\color{#35bf28}+8.49\%}$
test_async 45.8862ms 28.5969ms 34.9689 Ops/s 34.0063 Ops/s $\color{#35bf28}+2.83\%$
test_simple 0.3431s 0.3422s 2.9220 Ops/s 2.7759 Ops/s $\textbf{\color{#35bf28}+5.26\%}$
test_transformed 0.4976s 0.4961s 2.0158 Ops/s 2.0210 Ops/s $\color{#d91a1a}-0.26\%$
test_serial 1.3236s 1.2609s 0.7931 Ops/s 0.7987 Ops/s $\color{#d91a1a}-0.71\%$
test_parallel 1.1069s 1.0398s 0.9617 Ops/s 0.9696 Ops/s $\color{#d91a1a}-0.81\%$
test_step_mdp_speed[True-True-True-True-True] 0.1894ms 21.3551μs 46.8273 KOps/s 46.7701 KOps/s $\color{#35bf28}+0.12\%$
test_step_mdp_speed[True-True-True-True-False] 42.9910μs 12.8841μs 77.6153 KOps/s 76.2782 KOps/s $\color{#35bf28}+1.75\%$
test_step_mdp_speed[True-True-True-False-True] 63.4260μs 12.5205μs 79.8689 KOps/s 79.1254 KOps/s $\color{#35bf28}+0.94\%$
test_step_mdp_speed[True-True-True-False-False] 44.0520μs 7.4879μs 133.5493 KOps/s 131.7882 KOps/s $\color{#35bf28}+1.34\%$
test_step_mdp_speed[True-True-False-True-True] 69.6000μs 22.5792μs 44.2886 KOps/s 44.5024 KOps/s $\color{#d91a1a}-0.48\%$
test_step_mdp_speed[True-True-False-True-False] 57.5280μs 14.1611μs 70.6160 KOps/s 70.0474 KOps/s $\color{#35bf28}+0.81\%$
test_step_mdp_speed[True-True-False-False-True] 83.1880μs 13.5880μs 73.5946 KOps/s 73.3460 KOps/s $\color{#35bf28}+0.34\%$
test_step_mdp_speed[True-True-False-False-False] 41.4870μs 8.7083μs 114.8328 KOps/s 112.5690 KOps/s $\color{#35bf28}+2.01\%$
test_step_mdp_speed[True-False-True-True-True] 63.0680μs 24.1587μs 41.3929 KOps/s 41.4721 KOps/s $\color{#d91a1a}-0.19\%$
test_step_mdp_speed[True-False-True-True-False] 45.4050μs 15.5753μs 64.2044 KOps/s 63.5605 KOps/s $\color{#35bf28}+1.01\%$
test_step_mdp_speed[True-False-True-False-True] 47.3080μs 13.7297μs 72.8349 KOps/s 72.8110 KOps/s $\color{#35bf28}+0.03\%$
test_step_mdp_speed[True-False-True-False-False] 50.8050μs 8.8895μs 112.4928 KOps/s 111.7457 KOps/s $\color{#35bf28}+0.67\%$
test_step_mdp_speed[True-False-False-True-True] 85.6870μs 25.0980μs 39.8438 KOps/s 39.7124 KOps/s $\color{#35bf28}+0.33\%$
test_step_mdp_speed[True-False-False-True-False] 53.3590μs 16.6926μs 59.9069 KOps/s 59.3759 KOps/s $\color{#35bf28}+0.89\%$
test_step_mdp_speed[True-False-False-False-True] 74.9100μs 14.7209μs 67.9308 KOps/s 67.7273 KOps/s $\color{#35bf28}+0.30\%$
test_step_mdp_speed[True-False-False-False-False] 60.3320μs 9.8046μs 101.9933 KOps/s 99.0935 KOps/s $\color{#35bf28}+2.93\%$
test_step_mdp_speed[False-True-True-True-True] 82.0830μs 23.8925μs 41.8542 KOps/s 39.8450 KOps/s $\textbf{\color{#35bf28}+5.04\%}$
test_step_mdp_speed[False-True-True-True-False] 58.0180μs 15.4408μs 64.7635 KOps/s 64.0296 KOps/s $\color{#35bf28}+1.15\%$
test_step_mdp_speed[False-True-True-False-True] 65.0110μs 15.7577μs 63.4609 KOps/s 63.0877 KOps/s $\color{#35bf28}+0.59\%$
test_step_mdp_speed[False-True-True-False-False] 88.0610μs 10.2260μs 97.7897 KOps/s 98.5342 KOps/s $\color{#d91a1a}-0.76\%$
test_step_mdp_speed[False-True-False-True-True] 89.3560μs 26.2308μs 38.1232 KOps/s 39.3210 KOps/s $\color{#d91a1a}-3.05\%$
test_step_mdp_speed[False-True-False-True-False] 87.6730μs 16.4103μs 60.9372 KOps/s 58.7485 KOps/s $\color{#35bf28}+3.73\%$
test_step_mdp_speed[False-True-False-False-True] 66.2430μs 16.9095μs 59.1384 KOps/s 58.3001 KOps/s $\color{#35bf28}+1.44\%$
test_step_mdp_speed[False-True-False-False-False] 55.4630μs 10.9770μs 91.0995 KOps/s 87.5383 KOps/s $\color{#35bf28}+4.07\%$
test_step_mdp_speed[False-False-True-True-True] 81.2120μs 26.5322μs 37.6900 KOps/s 37.7281 KOps/s $\color{#d91a1a}-0.10\%$
test_step_mdp_speed[False-False-True-True-False] 73.3170μs 17.8702μs 55.9592 KOps/s 55.0475 KOps/s $\color{#35bf28}+1.66\%$
test_step_mdp_speed[False-False-True-False-True] 49.7220μs 17.0443μs 58.6706 KOps/s 58.2989 KOps/s $\color{#35bf28}+0.64\%$
test_step_mdp_speed[False-False-True-False-False] 68.1270μs 11.1084μs 90.0222 KOps/s 87.6710 KOps/s $\color{#35bf28}+2.68\%$
test_step_mdp_speed[False-False-False-True-True] 63.5980μs 27.7571μs 36.0268 KOps/s 36.4968 KOps/s $\color{#d91a1a}-1.29\%$
test_step_mdp_speed[False-False-False-True-False] 77.4840μs 18.9848μs 52.6737 KOps/s 51.3754 KOps/s $\color{#35bf28}+2.53\%$
test_step_mdp_speed[False-False-False-False-True] 51.3860μs 18.0557μs 55.3842 KOps/s 54.4979 KOps/s $\color{#35bf28}+1.63\%$
test_step_mdp_speed[False-False-False-False-False] 62.7670μs 12.0353μs 83.0887 KOps/s 80.2450 KOps/s $\color{#35bf28}+3.54\%$
test_values[generalized_advantage_estimate-True-True] 12.7754ms 9.5261ms 104.9745 Ops/s 103.6031 Ops/s $\color{#35bf28}+1.32\%$
test_values[vec_generalized_advantage_estimate-True-True] 46.1971ms 36.1814ms 27.6385 Ops/s 27.6937 Ops/s $\color{#d91a1a}-0.20\%$
test_values[td0_return_estimate-False-False] 0.3924ms 0.1896ms 5.2756 KOps/s 5.3254 KOps/s $\color{#d91a1a}-0.94\%$
test_values[td1_return_estimate-False-False] 27.0374ms 23.7414ms 42.1205 Ops/s 41.2187 Ops/s $\color{#35bf28}+2.19\%$
test_values[vec_td1_return_estimate-False-False] 39.8806ms 35.8988ms 27.8561 Ops/s 27.6190 Ops/s $\color{#35bf28}+0.86\%$
test_values[td_lambda_return_estimate-True-False] 35.2983ms 34.0835ms 29.3397 Ops/s 28.7230 Ops/s $\color{#35bf28}+2.15\%$
test_values[vec_td_lambda_return_estimate-True-False] 37.2793ms 35.8388ms 27.9027 Ops/s 27.7282 Ops/s $\color{#35bf28}+0.63\%$
test_gae_speed[generalized_advantage_estimate-False-1-512] 8.7801ms 8.0809ms 123.7481 Ops/s 119.2983 Ops/s $\color{#35bf28}+3.73\%$
test_gae_speed[vec_generalized_advantage_estimate-True-1-512] 2.3605ms 1.9935ms 501.6185 Ops/s 524.8825 Ops/s $\color{#d91a1a}-4.43\%$
test_gae_speed[vec_generalized_advantage_estimate-False-1-512] 0.6160ms 0.3594ms 2.7826 KOps/s 2.7892 KOps/s $\color{#d91a1a}-0.24\%$
test_gae_speed[vec_generalized_advantage_estimate-True-32-512] 46.9015ms 45.0604ms 22.1924 Ops/s 22.9872 Ops/s $\color{#d91a1a}-3.46\%$
test_gae_speed[vec_generalized_advantage_estimate-False-32-512] 3.8213ms 3.2017ms 312.3364 Ops/s 309.6755 Ops/s $\color{#35bf28}+0.86\%$
test_dqn_speed 1.8892ms 1.4178ms 705.3084 Ops/s 712.6510 Ops/s $\color{#d91a1a}-1.03\%$
test_ddpg_speed 3.5110ms 2.8346ms 352.7873 Ops/s 345.8823 Ops/s $\color{#35bf28}+2.00\%$
test_sac_speed 10.7661ms 9.1968ms 108.7340 Ops/s 105.3215 Ops/s $\color{#35bf28}+3.24\%$
test_redq_speed 16.1515ms 14.2589ms 70.1314 Ops/s 70.6608 Ops/s $\color{#d91a1a}-0.75\%$
test_redq_deprec_speed 16.4158ms 15.1916ms 65.8258 Ops/s 65.9660 Ops/s $\color{#d91a1a}-0.21\%$
test_td3_speed 12.5370ms 9.7190ms 102.8915 Ops/s 100.5587 Ops/s $\color{#35bf28}+2.32\%$
test_cql_speed 42.4101ms 40.1799ms 24.8881 Ops/s 25.1128 Ops/s $\color{#d91a1a}-0.89\%$
test_a2c_speed 12.7676ms 8.3479ms 119.7908 Ops/s 119.6859 Ops/s $\color{#35bf28}+0.09\%$
test_ppo_speed 11.1185ms 8.7358ms 114.4711 Ops/s 117.8443 Ops/s $\color{#d91a1a}-2.86\%$
test_reinforce_speed 7.7498ms 7.2156ms 138.5882 Ops/s 138.3835 Ops/s $\color{#35bf28}+0.15\%$
test_iql_speed 36.4078ms 35.1856ms 28.4207 Ops/s 28.9913 Ops/s $\color{#d91a1a}-1.97\%$
test_rb_sample[TensorDictReplayBuffer-ListStorage-RandomSampler-4000] 3.6627ms 2.5924ms 385.7370 Ops/s 394.3598 Ops/s $\color{#d91a1a}-2.19\%$
test_rb_sample[TensorDictReplayBuffer-LazyMemmapStorage-RandomSampler-10000] 1.0008ms 0.5376ms 1.8603 KOps/s 1.8635 KOps/s $\color{#d91a1a}-0.17\%$
test_rb_sample[TensorDictReplayBuffer-LazyTensorStorage-RandomSampler-10000] 0.7702ms 0.5082ms 1.9676 KOps/s 1.9756 KOps/s $\color{#d91a1a}-0.40\%$
test_rb_sample[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-4000] 3.0494ms 2.5600ms 390.6277 Ops/s 383.4686 Ops/s $\color{#35bf28}+1.87\%$
test_rb_sample[TensorDictReplayBuffer-LazyMemmapStorage-SamplerWithoutReplacement-10000] 1.0815ms 0.5242ms 1.9075 KOps/s 1.8765 KOps/s $\color{#35bf28}+1.65\%$
test_rb_sample[TensorDictReplayBuffer-LazyTensorStorage-SamplerWithoutReplacement-10000] 0.7689ms 0.5026ms 1.9896 KOps/s 1.9990 KOps/s $\color{#d91a1a}-0.47\%$
test_rb_sample[TensorDictReplayBuffer-LazyMemmapStorage-sampler6-10000] 1.6222ms 1.2686ms 788.2433 Ops/s 779.6081 Ops/s $\color{#35bf28}+1.11\%$
test_rb_sample[TensorDictReplayBuffer-LazyTensorStorage-sampler7-10000] 1.7927ms 1.2038ms 830.7371 Ops/s 828.1119 Ops/s $\color{#35bf28}+0.32\%$
test_rb_sample[TensorDictPrioritizedReplayBuffer-ListStorage-None-4000] 3.4695ms 2.7355ms 365.5609 Ops/s 369.6033 Ops/s $\color{#d91a1a}-1.09\%$
test_rb_sample[TensorDictPrioritizedReplayBuffer-LazyMemmapStorage-None-10000] 1.0376ms 0.6544ms 1.5282 KOps/s 1.5240 KOps/s $\color{#35bf28}+0.28\%$
test_rb_sample[TensorDictPrioritizedReplayBuffer-LazyTensorStorage-None-10000] 1.0083ms 0.6295ms 1.5886 KOps/s 1.5960 KOps/s $\color{#d91a1a}-0.46\%$
test_rb_iterate[TensorDictReplayBuffer-ListStorage-RandomSampler-4000] 3.1342ms 2.4811ms 403.0426 Ops/s 402.4805 Ops/s $\color{#35bf28}+0.14\%$
test_rb_iterate[TensorDictReplayBuffer-LazyMemmapStorage-RandomSampler-10000] 0.7511ms 0.5306ms 1.8846 KOps/s 1.8733 KOps/s $\color{#35bf28}+0.60\%$
test_rb_iterate[TensorDictReplayBuffer-LazyTensorStorage-RandomSampler-10000] 3.4904ms 0.5103ms 1.9596 KOps/s 1.9127 KOps/s $\color{#35bf28}+2.45\%$
test_rb_iterate[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-4000] 3.1131ms 2.5266ms 395.7865 Ops/s 381.8181 Ops/s $\color{#35bf28}+3.66\%$
test_rb_iterate[TensorDictReplayBuffer-LazyMemmapStorage-SamplerWithoutReplacement-10000] 1.1588ms 0.5269ms 1.8978 KOps/s 1.8642 KOps/s $\color{#35bf28}+1.80\%$
test_rb_iterate[TensorDictReplayBuffer-LazyTensorStorage-SamplerWithoutReplacement-10000] 0.6518ms 0.5038ms 1.9850 KOps/s 1.6557 KOps/s $\textbf{\color{#35bf28}+19.89\%}$
test_rb_iterate[TensorDictPrioritizedReplayBuffer-ListStorage-None-4000] 3.9018ms 2.7383ms 365.1840 Ops/s 348.6708 Ops/s $\color{#35bf28}+4.74\%$
test_rb_iterate[TensorDictPrioritizedReplayBuffer-LazyMemmapStorage-None-10000] 0.7983ms 0.6506ms 1.5371 KOps/s 1.4935 KOps/s $\color{#35bf28}+2.92\%$
test_rb_iterate[TensorDictPrioritizedReplayBuffer-LazyTensorStorage-None-10000] 3.8939ms 0.6378ms 1.5679 KOps/s 1.5839 KOps/s $\color{#d91a1a}-1.01\%$
test_rb_populate[TensorDictReplayBuffer-ListStorage-RandomSampler-400] 0.1341s 8.9004ms 112.3543 Ops/s 111.4822 Ops/s $\color{#35bf28}+0.78\%$
test_rb_populate[TensorDictReplayBuffer-LazyMemmapStorage-RandomSampler-400] 16.6418ms 13.2657ms 75.3826 Ops/s 77.2733 Ops/s $\color{#d91a1a}-2.45\%$
test_rb_populate[TensorDictReplayBuffer-LazyTensorStorage-RandomSampler-400] 1.7829ms 1.1048ms 905.1788 Ops/s 897.5376 Ops/s $\color{#35bf28}+0.85\%$
test_rb_populate[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-400] 0.1300s 6.5570ms 152.5094 Ops/s 155.1229 Ops/s $\color{#d91a1a}-1.68\%$
test_rb_populate[TensorDictReplayBuffer-LazyMemmapStorage-SamplerWithoutReplacement-400] 0.1322s 15.2609ms 65.5269 Ops/s 77.2180 Ops/s $\textbf{\color{#d91a1a}-15.14\%}$
test_rb_populate[TensorDictReplayBuffer-LazyTensorStorage-SamplerWithoutReplacement-400] 1.8683ms 1.0997ms 909.3239 Ops/s 825.1331 Ops/s $\textbf{\color{#35bf28}+10.20\%}$
test_rb_populate[TensorDictPrioritizedReplayBuffer-ListStorage-None-400] 0.1223s 6.6797ms 149.7069 Ops/s 107.3202 Ops/s $\textbf{\color{#35bf28}+39.50\%}$
test_rb_populate[TensorDictPrioritizedReplayBuffer-LazyMemmapStorage-None-400] 20.2059ms 13.7494ms 72.7304 Ops/s 74.8886 Ops/s $\color{#d91a1a}-2.88\%$
test_rb_populate[TensorDictPrioritizedReplayBuffer-LazyTensorStorage-None-400] 2.1587ms 1.4388ms 695.0014 Ops/s 672.0547 Ops/s $\color{#35bf28}+3.41\%$

Copy link

github-actions bot commented Apr 24, 2024

$\color{#D29922}\textsf{\Large&amp;#x26A0;\kern{0.2cm}\normalsize Warning}$ Result of GPU Benchmark Tests

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

Expand to view detailed results
Name Max Mean Ops Ops on Repo HEAD Change
test_single 96.9627ms 96.5083ms 10.3618 Ops/s 9.8206 Ops/s $\textbf{\color{#35bf28}+5.51\%}$
test_sync 87.9877ms 87.0572ms 11.4867 Ops/s 11.2157 Ops/s $\color{#35bf28}+2.42\%$
test_async 0.1691s 84.1918ms 11.8776 Ops/s 14.2825 Ops/s $\textbf{\color{#d91a1a}-16.84\%}$
test_single_pixels 0.1099s 0.1086s 9.2042 Ops/s 9.0561 Ops/s $\color{#35bf28}+1.64\%$
test_sync_pixels 0.1258s 69.5341ms 14.3814 Ops/s 14.3790 Ops/s $\color{#35bf28}+0.02\%$
test_async_pixels 0.1196s 61.4812ms 16.2651 Ops/s 16.3983 Ops/s $\color{#d91a1a}-0.81\%$
test_simple 0.6532s 0.6463s 1.5473 Ops/s 1.4654 Ops/s $\textbf{\color{#35bf28}+5.59\%}$
test_transformed 0.8602s 0.8596s 1.1634 Ops/s 1.1059 Ops/s $\textbf{\color{#35bf28}+5.20\%}$
test_serial 2.0648s 2.0056s 0.4986 Ops/s 0.4776 Ops/s $\color{#35bf28}+4.40\%$
test_parallel 1.7987s 1.7238s 0.5801 Ops/s 0.5696 Ops/s $\color{#35bf28}+1.84\%$
test_step_mdp_speed[True-True-True-True-True] 78.8840μs 31.9820μs 31.2675 KOps/s 30.7718 KOps/s $\color{#35bf28}+1.61\%$
test_step_mdp_speed[True-True-True-True-False] 35.4820μs 19.2721μs 51.8886 KOps/s 50.8304 KOps/s $\color{#35bf28}+2.08\%$
test_step_mdp_speed[True-True-True-False-True] 35.5820μs 18.5416μs 53.9327 KOps/s 54.5796 KOps/s $\color{#d91a1a}-1.19\%$
test_step_mdp_speed[True-True-True-False-False] 25.0910μs 10.9385μs 91.4200 KOps/s 89.3247 KOps/s $\color{#35bf28}+2.35\%$
test_step_mdp_speed[True-True-False-True-True] 50.8920μs 33.7709μs 29.6113 KOps/s 29.1220 KOps/s $\color{#35bf28}+1.68\%$
test_step_mdp_speed[True-True-False-True-False] 43.5830μs 21.1910μs 47.1899 KOps/s 47.0081 KOps/s $\color{#35bf28}+0.39\%$
test_step_mdp_speed[True-True-False-False-True] 46.9230μs 20.2090μs 49.4829 KOps/s 49.3942 KOps/s $\color{#35bf28}+0.18\%$
test_step_mdp_speed[True-True-False-False-False] 29.3010μs 13.0454μs 76.6555 KOps/s 75.7886 KOps/s $\color{#35bf28}+1.14\%$
test_step_mdp_speed[True-False-True-True-True] 62.8740μs 36.2138μs 27.6138 KOps/s 27.7350 KOps/s $\color{#d91a1a}-0.44\%$
test_step_mdp_speed[True-False-True-True-False] 89.4750μs 23.0431μs 43.3969 KOps/s 43.2150 KOps/s $\color{#35bf28}+0.42\%$
test_step_mdp_speed[True-False-True-False-True] 37.5520μs 20.2305μs 49.4304 KOps/s 49.4908 KOps/s $\color{#d91a1a}-0.12\%$
test_step_mdp_speed[True-False-True-False-False] 26.8510μs 12.8088μs 78.0713 KOps/s 75.9254 KOps/s $\color{#35bf28}+2.83\%$
test_step_mdp_speed[True-False-False-True-True] 0.1224ms 38.6279μs 25.8880 KOps/s 26.6361 KOps/s $\color{#d91a1a}-2.81\%$
test_step_mdp_speed[True-False-False-True-False] 42.1420μs 24.9250μs 40.1204 KOps/s 39.6340 KOps/s $\color{#35bf28}+1.23\%$
test_step_mdp_speed[True-False-False-False-True] 44.5420μs 21.8961μs 45.6702 KOps/s 45.1790 KOps/s $\color{#35bf28}+1.09\%$
test_step_mdp_speed[True-False-False-False-False] 39.8020μs 15.0229μs 66.5649 KOps/s 67.4747 KOps/s $\color{#d91a1a}-1.35\%$
test_step_mdp_speed[False-True-True-True-True] 59.6940μs 36.3621μs 27.5011 KOps/s 27.7570 KOps/s $\color{#d91a1a}-0.92\%$
test_step_mdp_speed[False-True-True-True-False] 41.3920μs 23.1571μs 43.1833 KOps/s 42.9097 KOps/s $\color{#35bf28}+0.64\%$
test_step_mdp_speed[False-True-True-False-True] 44.0630μs 23.9803μs 41.7009 KOps/s 40.7988 KOps/s $\color{#35bf28}+2.21\%$
test_step_mdp_speed[False-True-True-False-False] 29.9820μs 14.6683μs 68.1741 KOps/s 66.1323 KOps/s $\color{#35bf28}+3.09\%$
test_step_mdp_speed[False-True-False-True-True] 52.8030μs 38.0445μs 26.2850 KOps/s 26.1638 KOps/s $\color{#35bf28}+0.46\%$
test_step_mdp_speed[False-True-False-True-False] 94.6950μs 24.8632μs 40.2200 KOps/s 39.6595 KOps/s $\color{#35bf28}+1.41\%$
test_step_mdp_speed[False-True-False-False-True] 52.8330μs 26.0976μs 38.3177 KOps/s 38.5808 KOps/s $\color{#d91a1a}-0.68\%$
test_step_mdp_speed[False-True-False-False-False] 32.0820μs 16.6159μs 60.1835 KOps/s 59.3519 KOps/s $\color{#35bf28}+1.40\%$
test_step_mdp_speed[False-False-True-True-True] 60.3140μs 39.8963μs 25.0650 KOps/s 25.2750 KOps/s $\color{#d91a1a}-0.83\%$
test_step_mdp_speed[False-False-True-True-False] 47.5230μs 26.7406μs 37.3964 KOps/s 36.7485 KOps/s $\color{#35bf28}+1.76\%$
test_step_mdp_speed[False-False-True-False-True] 84.3450μs 26.0818μs 38.3410 KOps/s 38.2479 KOps/s $\color{#35bf28}+0.24\%$
test_step_mdp_speed[False-False-True-False-False] 34.7020μs 16.7782μs 59.6010 KOps/s 60.1561 KOps/s $\color{#d91a1a}-0.92\%$
test_step_mdp_speed[False-False-False-True-True] 70.3840μs 41.1584μs 24.2964 KOps/s 24.1372 KOps/s $\color{#35bf28}+0.66\%$
test_step_mdp_speed[False-False-False-True-False] 56.4530μs 28.6744μs 34.8743 KOps/s 34.4121 KOps/s $\color{#35bf28}+1.34\%$
test_step_mdp_speed[False-False-False-False-True] 45.3520μs 27.4400μs 36.4431 KOps/s 36.0733 KOps/s $\color{#35bf28}+1.03\%$
test_step_mdp_speed[False-False-False-False-False] 41.4030μs 18.5142μs 54.0126 KOps/s 53.6103 KOps/s $\color{#35bf28}+0.75\%$
test_values[generalized_advantage_estimate-True-True] 24.4119ms 22.7959ms 43.8675 Ops/s 41.4126 Ops/s $\textbf{\color{#35bf28}+5.93\%}$
test_values[vec_generalized_advantage_estimate-True-True] 79.3157ms 3.1245ms 320.0512 Ops/s 310.1959 Ops/s $\color{#35bf28}+3.18\%$
test_values[td0_return_estimate-False-False] 87.1150μs 59.7004μs 16.7503 KOps/s 16.3825 KOps/s $\color{#35bf28}+2.25\%$
test_values[td1_return_estimate-False-False] 50.5274ms 48.3929ms 20.6642 Ops/s 18.7713 Ops/s $\textbf{\color{#35bf28}+10.08\%}$
test_values[vec_td1_return_estimate-False-False] 2.0538ms 1.7248ms 579.7888 Ops/s 572.9084 Ops/s $\color{#35bf28}+1.20\%$
test_values[td_lambda_return_estimate-True-False] 83.3498ms 80.0710ms 12.4889 Ops/s 12.0775 Ops/s $\color{#35bf28}+3.41\%$
test_values[vec_td_lambda_return_estimate-True-False] 2.1264ms 1.7410ms 574.3983 Ops/s 572.5898 Ops/s $\color{#35bf28}+0.32\%$
test_gae_speed[generalized_advantage_estimate-False-1-512] 23.3495ms 22.9120ms 43.6452 Ops/s 44.3874 Ops/s $\color{#d91a1a}-1.67\%$
test_gae_speed[vec_generalized_advantage_estimate-True-1-512] 0.8374ms 0.6560ms 1.5245 KOps/s 1.4828 KOps/s $\color{#35bf28}+2.81\%$
test_gae_speed[vec_generalized_advantage_estimate-False-1-512] 0.6798ms 0.6086ms 1.6432 KOps/s 1.5929 KOps/s $\color{#35bf28}+3.15\%$
test_gae_speed[vec_generalized_advantage_estimate-True-32-512] 1.4404ms 1.4137ms 707.3824 Ops/s 697.1197 Ops/s $\color{#35bf28}+1.47\%$
test_gae_speed[vec_generalized_advantage_estimate-False-32-512] 0.9135ms 0.6320ms 1.5823 KOps/s 1.5371 KOps/s $\color{#35bf28}+2.95\%$
test_dqn_speed 8.0842ms 1.4475ms 690.8588 Ops/s 678.0160 Ops/s $\color{#35bf28}+1.89\%$
test_ddpg_speed 2.9633ms 2.6551ms 376.6309 Ops/s 365.0819 Ops/s $\color{#35bf28}+3.16\%$
test_sac_speed 8.6202ms 7.8749ms 126.9863 Ops/s 123.3282 Ops/s $\color{#35bf28}+2.97\%$
test_redq_speed 12.4854ms 10.0408ms 99.5939 Ops/s 97.2405 Ops/s $\color{#35bf28}+2.42\%$
test_redq_deprec_speed 11.3515ms 10.8498ms 92.1675 Ops/s 88.9581 Ops/s $\color{#35bf28}+3.61\%$
test_td3_speed 17.0687ms 7.9028ms 126.5374 Ops/s 122.8113 Ops/s $\color{#35bf28}+3.03\%$
test_cql_speed 27.3114ms 25.2415ms 39.6173 Ops/s 39.4275 Ops/s $\color{#35bf28}+0.48\%$
test_a2c_speed 5.7573ms 5.4610ms 183.1153 Ops/s 183.4924 Ops/s $\color{#d91a1a}-0.21\%$
test_ppo_speed 5.8512ms 5.7075ms 175.2072 Ops/s 173.0584 Ops/s $\color{#35bf28}+1.24\%$
test_reinforce_speed 4.6675ms 4.4271ms 225.8813 Ops/s 223.3782 Ops/s $\color{#35bf28}+1.12\%$
test_iql_speed 20.1490ms 19.2044ms 52.0713 Ops/s 51.7958 Ops/s $\color{#35bf28}+0.53\%$
test_rb_sample[TensorDictReplayBuffer-ListStorage-RandomSampler-4000] 2.8056ms 2.7160ms 368.1918 Ops/s 359.6825 Ops/s $\color{#35bf28}+2.37\%$
test_rb_sample[TensorDictReplayBuffer-LazyMemmapStorage-RandomSampler-10000] 1.3816ms 0.5359ms 1.8661 KOps/s 1.8359 KOps/s $\color{#35bf28}+1.65\%$
test_rb_sample[TensorDictReplayBuffer-LazyTensorStorage-RandomSampler-10000] 0.7234ms 0.5145ms 1.9435 KOps/s 1.8725 KOps/s $\color{#35bf28}+3.79\%$
test_rb_sample[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-4000] 2.9175ms 2.7738ms 360.5218 Ops/s 352.9949 Ops/s $\color{#35bf28}+2.13\%$
test_rb_sample[TensorDictReplayBuffer-LazyMemmapStorage-SamplerWithoutReplacement-10000] 0.6433ms 0.5264ms 1.8997 KOps/s 1.8561 KOps/s $\color{#35bf28}+2.35\%$
test_rb_sample[TensorDictReplayBuffer-LazyTensorStorage-SamplerWithoutReplacement-10000] 4.0275ms 0.5111ms 1.9567 KOps/s 1.9059 KOps/s $\color{#35bf28}+2.66\%$
test_rb_sample[TensorDictReplayBuffer-LazyMemmapStorage-sampler6-10000] 1.5203ms 1.3983ms 715.1307 Ops/s 681.9294 Ops/s $\color{#35bf28}+4.87\%$
test_rb_sample[TensorDictReplayBuffer-LazyTensorStorage-sampler7-10000] 1.5507ms 1.3300ms 751.8656 Ops/s 713.6798 Ops/s $\textbf{\color{#35bf28}+5.35\%}$
test_rb_sample[TensorDictPrioritizedReplayBuffer-ListStorage-None-4000] 3.0419ms 2.8872ms 346.3584 Ops/s 342.7070 Ops/s $\color{#35bf28}+1.07\%$
test_rb_sample[TensorDictPrioritizedReplayBuffer-LazyMemmapStorage-None-10000] 0.1171s 0.7588ms 1.3179 KOps/s 1.4735 KOps/s $\textbf{\color{#d91a1a}-10.56\%}$
test_rb_sample[TensorDictPrioritizedReplayBuffer-LazyTensorStorage-None-10000] 0.8056ms 0.6328ms 1.5802 KOps/s 1.5355 KOps/s $\color{#35bf28}+2.91\%$
test_rb_iterate[TensorDictReplayBuffer-ListStorage-RandomSampler-4000] 2.8759ms 2.7766ms 360.1534 Ops/s 359.3368 Ops/s $\color{#35bf28}+0.23\%$
test_rb_iterate[TensorDictReplayBuffer-LazyMemmapStorage-RandomSampler-10000] 0.6922ms 0.5388ms 1.8561 KOps/s 1.8382 KOps/s $\color{#35bf28}+0.97\%$
test_rb_iterate[TensorDictReplayBuffer-LazyTensorStorage-RandomSampler-10000] 4.4294ms 0.5208ms 1.9202 KOps/s 1.9266 KOps/s $\color{#d91a1a}-0.33\%$
test_rb_iterate[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-4000] 2.9625ms 2.7935ms 357.9783 Ops/s 358.1482 Ops/s $\color{#d91a1a}-0.05\%$
test_rb_iterate[TensorDictReplayBuffer-LazyMemmapStorage-SamplerWithoutReplacement-10000] 0.6457ms 0.5328ms 1.8767 KOps/s 1.8657 KOps/s $\color{#35bf28}+0.59\%$
test_rb_iterate[TensorDictReplayBuffer-LazyTensorStorage-SamplerWithoutReplacement-10000] 0.6878ms 0.5169ms 1.9346 KOps/s 1.9268 KOps/s $\color{#35bf28}+0.41\%$
test_rb_iterate[TensorDictPrioritizedReplayBuffer-ListStorage-None-4000] 3.0390ms 2.9105ms 343.5848 Ops/s 342.6412 Ops/s $\color{#35bf28}+0.28\%$
test_rb_iterate[TensorDictPrioritizedReplayBuffer-LazyMemmapStorage-None-10000] 1.3277ms 0.6612ms 1.5124 KOps/s 1.4814 KOps/s $\color{#35bf28}+2.10\%$
test_rb_iterate[TensorDictPrioritizedReplayBuffer-LazyTensorStorage-None-10000] 0.7963ms 0.6414ms 1.5591 KOps/s 1.5275 KOps/s $\color{#35bf28}+2.07\%$
test_rb_populate[TensorDictReplayBuffer-ListStorage-RandomSampler-400] 0.1385s 7.4597ms 134.0545 Ops/s 103.0754 Ops/s $\textbf{\color{#35bf28}+30.05\%}$
test_rb_populate[TensorDictReplayBuffer-LazyMemmapStorage-RandomSampler-400] 16.3906ms 14.1652ms 70.5954 Ops/s 66.5685 Ops/s $\textbf{\color{#35bf28}+6.05\%}$
test_rb_populate[TensorDictReplayBuffer-LazyTensorStorage-RandomSampler-400] 6.9874ms 1.3100ms 763.3546 Ops/s 813.5262 Ops/s $\textbf{\color{#d91a1a}-6.17\%}$
test_rb_populate[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-400] 0.1202s 9.3078ms 107.4368 Ops/s 140.3103 Ops/s $\textbf{\color{#d91a1a}-23.43\%}$
test_rb_populate[TensorDictReplayBuffer-LazyMemmapStorage-SamplerWithoutReplacement-400] 16.3971ms 14.1709ms 70.5670 Ops/s 66.3835 Ops/s $\textbf{\color{#35bf28}+6.30\%}$
test_rb_populate[TensorDictReplayBuffer-LazyTensorStorage-SamplerWithoutReplacement-400] 6.6389ms 1.2549ms 796.9068 Ops/s 758.4920 Ops/s $\textbf{\color{#35bf28}+5.06\%}$
test_rb_populate[TensorDictPrioritizedReplayBuffer-ListStorage-None-400] 0.1178s 7.3289ms 136.4466 Ops/s 100.1005 Ops/s $\textbf{\color{#35bf28}+36.31\%}$
test_rb_populate[TensorDictPrioritizedReplayBuffer-LazyMemmapStorage-None-400] 16.8972ms 14.4170ms 69.3624 Ops/s 62.8110 Ops/s $\textbf{\color{#35bf28}+10.43\%}$
test_rb_populate[TensorDictPrioritizedReplayBuffer-LazyTensorStorage-None-400] 2.6839ms 1.5015ms 666.0092 Ops/s 586.1722 Ops/s $\textbf{\color{#35bf28}+13.62\%}$

@vmoens vmoens added the enhancement New feature or request label Apr 24, 2024
@vmoens vmoens merged commit 93e9e30 into main Apr 24, 2024
63 of 67 checks passed
@vmoens vmoens deleted the extend-slices branch April 24, 2024 16:28
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