Skip to content

Commit 96e703a

Browse files
author
Vincent Moens
committed
amend
1 parent 96e1582 commit 96e703a

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

.ci/docker/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pytorch-lightning
3030
torchx
3131
# TODO: use stable 0.5 when released
3232
-e git+https://github.com/pytorch/rl.git#egg=torchrl
33-
-e git+https://github.com/pytorch/tensordict.git#egg=tensordict
33+
-e git+https://github.com/pytorch/tensordict.git@del-futures#egg=tensordict
3434
ax-platform
3535
nbformat>==5.9.2
3636
datasets

intermediate_source/pinmem_nonblock.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -500,18 +500,13 @@ def pin_copy_to_device_nonblocking(*tensors):
500500
from torch.utils.benchmark import Timer
501501

502502
# Create the dataset
503-
for s0 in (10, 100, 1000, 10_000, 100_000, 1_000_000):
504-
for s1 in (10, 100, 1000, 10_000, 100_000, 1_000_000):
505-
if s0 * s1 >= 1e9:
506-
continue
507-
print(f"\n\ns0={s0}, s1={s1}")
508-
td = TensorDict({str(i): torch.randn(s0) for i in range(s1)})
509-
510-
# Runtimes
511-
copy_blocking = timer("td.to('cuda:0', non_blocking=False)")
512-
copy_non_blocking = timer("td.to('cuda:0')")
513-
copy_pin_nb = timer("td.to('cuda:0', non_blocking_pin=True, num_threads=0)")
514-
copy_pin_multithread_nb = timer("td.to('cuda:0', non_blocking_pin=True, num_threads=4)")
503+
td = TensorDict({str(i): torch.randn(1_000_000) for i in range(1000)})
504+
505+
# Runtimes
506+
copy_blocking = timer("td.to('cuda:0', non_blocking=False)")
507+
copy_non_blocking = timer("td.to('cuda:0')")
508+
copy_pin_nb = timer("td.to('cuda:0', non_blocking_pin=True, num_threads=0)")
509+
copy_pin_multithread_nb = timer("td.to('cuda:0', non_blocking_pin=True, num_threads=4)")
515510

516511
# Rations
517512
r1 = copy_non_blocking / copy_blocking

0 commit comments

Comments
 (0)