Skip to content

Commit dccf466

Browse files
authored
Add CI testing job with CV-CUDA support (#9285)
1 parent 617079d commit dccf466

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

.github/scripts/setup-env.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ echo '::group::Install TorchVision'
8282
pip install -e . -v --no-build-isolation
8383
echo '::endgroup::'
8484

85+
if [[ "${CVCUDA:-}" == "1" ]]; then
86+
echo '::group::Install CV-CUDA'
87+
pip install --progress-bar=off cvcuda-cu12
88+
echo '::endgroup::'
89+
fi
90+
8591
echo '::group::Install torchvision-extra-decoders'
8692
# This can be done after torchvision was built
8793
if [[ "$(uname)" == "Linux" && "$(uname -m)" != "aarch64" ]]; then

.github/workflows/tests.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,36 @@ jobs:
4545
4646
./.github/scripts/unittest.sh
4747
48+
unittests-linux-cvcuda:
49+
strategy:
50+
matrix:
51+
python-version:
52+
- "3.10"
53+
runner: ["linux.g5.4xlarge.nvidia.gpu"]
54+
gpu-arch-type: ["cuda"]
55+
gpu-arch-version: ["12.6"]
56+
fail-fast: false
57+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
58+
permissions:
59+
id-token: write
60+
contents: read
61+
with:
62+
repository: pytorch/vision
63+
runner: ${{ matrix.runner }}
64+
gpu-arch-type: ${{ matrix.gpu-arch-type }}
65+
gpu-arch-version: ${{ matrix.gpu-arch-version }}
66+
timeout: 120
67+
test-infra-ref: main
68+
script: |
69+
set -euo pipefail
70+
71+
export PYTHON_VERSION=${{ matrix.python-version }}
72+
export GPU_ARCH_TYPE=${{ matrix.gpu-arch-type }}
73+
export GPU_ARCH_VERSION=${{ matrix.gpu-arch-version }}
74+
export CVCUDA="1"
75+
76+
./.github/scripts/unittest.sh
77+
4878
unittests-macos:
4979
strategy:
5080
matrix:

test/test_transforms_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6825,7 +6825,7 @@ def test_functional_and_transform(self, dtype, device, color_space, batch_dims,
68256825
assert F.get_size(output) == F.get_size(input_tensor)
68266826

68276827
def test_functional_error(self):
6828-
with pytest.raises(TypeError, match="cvcuda_img should be `cvcuda.Tensor`"):
6828+
with pytest.raises(TypeError, match=r"cvcuda_img should be ``cvcuda\.Tensor``\. Got .+\."):
68296829
F.cvcuda_to_tensor(object())
68306830

68316831

0 commit comments

Comments
 (0)