Skip to content

Commit

Permalink
Enable the tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
  • Loading branch information
mzient committed Oct 21, 2024
1 parent 8c80a22 commit 672f6f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dali/test/python/dlpack/test_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import nvidia.dali.fn as fn
import torch
import numpy as np
import time
from nose.plugins.attrib import attr


@dali.pipeline_def(batch_size=4, num_threads=1, device_id=0, prefetch_queue_depth=2)
Expand All @@ -14,14 +14,14 @@ def _test_pipe():
return ext + row + col


@attr("pytorch")
def test_dlpack():
print("Testing dlpack")
# get a DALI pipeline that produces batches of very large tensors
pipe = _test_pipe(experimental_exec_dynamic=True)
pipe.build()
pipe.run()

results = []
s = torch.cuda.Stream(0)
with torch.cuda.stream(s):
sum = torch.zeros((), dtype=torch.float32).cuda()

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable sum is not used.
Expand Down
2 changes: 2 additions & 0 deletions dali/test/python/dlpack/test_torch_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import torch
import numpy as np
import time
from nose.plugins.attrib import attr


@dali.pipeline_def(batch_size=32, num_threads=8, device_id=0)
Expand Down Expand Up @@ -80,6 +81,7 @@ def to_torch(dali_tensor):
return (end - start) * 1e-6


@attr("pytorch")
def test_perf():
"""Test that DLPack zero-copy output is faster than copying."""
dlpack_times = []
Expand Down
1 change: 1 addition & 0 deletions qa/TL0_python-self-test-core/test_body.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ test_pytorch() {
${python_invoke_test} --attr '!slow,pytorch' test_dali_variable_batch_size.py
if [ -z "$DALI_ENABLE_SANITIZERS" ]; then
${python_new_invoke_test} -A 'pytorch' -s type_annotations
${python_new_invoke_test} -A 'pytorch' -s dlpack
${python_new_invoke_test} -A '!slow' checkpointing.test_dali_checkpointing_fw_iterators.TestPytorch
${python_new_invoke_test} -A '!slow' checkpointing.test_dali_checkpointing_fw_iterators.TestPytorchRagged
fi
Expand Down

0 comments on commit 672f6f9

Please sign in to comment.