7373 matrix :
7474 python-version : ['3.10']
7575 rocm-version : ['7.1']
76- ffmpeg-version-for-tests : ['7']
7776 uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
7877 permissions :
7978 id-token : write
@@ -94,20 +93,14 @@ jobs:
9493 script : |
9594 set -euo pipefail
9695
97- # The image's base conda uses the classic solver, which takes *hours* to
98- # solve conda-forge installs (ffmpeg's solve previously hit the 2h job
99- # timeout). Switch to libmamba, which solves in seconds. Install the
100- # plugin first in case this conda doesn't bundle it.
96+ # We use conda only to get a Python env matching the cp310 wheel (the
97+ # image's base env may be a different Python). Point conda at conda-forge
98+ # only, with libmamba, so env creation is fast and never touches the
99+ # 'defaults'/pkgs/main channel (repo.anaconda.com), which hangs from the
100+ # ROCm runners.
101101 echo '::group::Configure conda (libmamba solver, conda-forge only)'
102102 conda install -n base -y -c conda-forge conda-libmamba-solver
103103 conda config --set solver libmamba
104- # Use conda-forge EXCLUSIVELY. Root cause of the 2h timeouts: the ffmpeg
105- # solve finished in minutes, but its dep tree resolves libglib & wayland
106- # from the 'defaults' (pkgs/main) channel, and downloading those from
107- # repo.anaconda.com hangs forever on the ROCm runners (no timeout).
108- # conda-forge egress works fine here (python/pip download in seconds), so
109- # we wipe the channel list down to conda-forge only so pkgs/main can
110- # never be selected.
111104 conda config --remove-key channels 2>/dev/null || true
112105 conda config --add channels conda-forge
113106 conda config --set channel_priority strict
@@ -155,18 +148,23 @@ jobs:
155148 python -m pip install "${RUNNER_ARTIFACT_DIR}"/*.whl -vvv
156149 echo '::endgroup::'
157150
158- echo '::group::Install FFmpeg and test dependencies'
159- bash packaging/install_ffmpeg.sh ${{ matrix.ffmpeg-version-for-tests }}
160- # Pass false to skip the optional libheif conda install: HEIC is CPU-only,
161- # covered on other platforms, and not needed for this ROCm smoke test.
151+ # This job intentionally does NOT install FFmpeg: the rocJPEG decoder and
152+ # the other image decoders don't need it, and conda's heavy ffmpeg
153+ # install (~110MB, 100+ pkgs) is unreliable on the ROCm runners. So we
154+ # run only the FFmpeg-free image-decoder tests, mirroring the no-ffmpeg
155+ # CUDA job. Video decoding on ROCm (which needs FFmpeg) is a later step.
156+ echo '::group::Install test dependencies (no FFmpeg)'
157+ # false: skip the optional libheif conda install (HEIC is CPU-only and
158+ # covered elsewhere); this leaves a pip-only install (numpy/pytest/pillow).
162159 bash packaging/install_test_dependencies.sh false
163160 echo '::endgroup::'
164161
165- echo '::group::Run Python tests'
162+ echo '::group::Run FFmpeg-free image decoder tests'
166163 # torch.cuda.is_available() is True on ROCm (HIP masquerades as CUDA), so
167164 # conftest.py won't auto-skip needs_cuda tests. The rocJPEG GPU decode
168165 # path isn't validated yet (no ROCm-specific GPU tests), so we deselect
169166 # them for now; drop this filter once rocJPEG decode is exercised.
170167 FAIL_WITHOUT_JPEG=1 FAIL_WITHOUT_PNG=1 FAIL_WITHOUT_WEBP=1 FAIL_WITHOUT_AVIF=1 \
171- pytest -m "not needs_cuda" --override-ini="addopts=-v" test --tb=short
168+ pytest -m "not needs_cuda" --override-ini="addopts=-v" \
169+ test/test_ffmpeg_optional.py test/test_decoders.py::TestImageDecoder --tb=short
172170 echo '::endgroup::'
0 commit comments