@@ -59,72 +59,61 @@ jobs:
5959
6060 install-and-test :
6161 runs-on : linux.arm64.2xlarge
62+ container :
63+ image : pytorch/manylinuxaarch64-builder:cuda12.6
64+ env :
65+ cuda_version_without_periods : " 126"
6266 strategy :
6367 fail-fast : false
6468 matrix :
65- # 3.10 corresponds to the minimum python version for which we build
66- # the wheel unless the label cliflow/binaries/all is present in the
67- # PR.
68- # For the actual release we should add that label and change this to
69- # include more python versions.
7069 python-version : ['3.10']
71- # We test against 12.6 and 13.0 to avoid having too big of a CI matrix,
72- # but for releases we should add 12.8.
73- cuda-version : ['12.6', '13.0']
74- # TODO: put back ffmpeg 5 https://github.com/pytorch/torchcodec/issues/325
75- ffmpeg-version-for-tests : ['4.4.2', '6', '7', '8.0']
76-
77- container :
78- image : " pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"
79- options : " --gpus all -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility"
70+ ffmpeg-version-for-tests : ['4.4.2', '5.1.2', '6.1.1', '7.0.1', '8.0']
8071 needs : build
8172 steps :
82- - name : Setup env vars
83- run : |
84- cuda_version_without_periods=$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g')
85- echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV
86- python_version_without_periods=$(echo "${{ matrix.python-version }}" | sed 's/\.//g')
87- echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV
8873 - uses : actions/download-artifact@v4
8974 with :
9075 name : meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_aarch64
9176 path : pytorch/torchcodec/dist/
92- - name : Setup miniconda using test-infra
93- uses : pytorch/test-infra/.github/actions/ setup-miniconda@main
77+ - name : Setup conda env
78+ uses : conda-incubator/ setup-miniconda@v3
9479 with :
80+ auto-update-conda : true
81+ # Using miniforge instead of miniconda ensures that the default
82+ # conda channel is conda-forge instead of main/default. This ensures
83+ # ABI consistency between dependencies:
84+ # https://conda-forge.org/docs/user/transitioning_from_defaults/
85+ miniforge-version : latest
86+ activate-environment : test
9587 python-version : ${{ matrix.python-version }}
96- # We install conda packages at the start because otherwise conda may have conflicts with dependencies.
97- # Note: xorg-libxau was addded to fix a problem with ffmpeg 4. We should consider removing it.
98- default-packages : " nvidia/label/cuda-${{ matrix.cuda-version }}.0::libnpp nvidia::cuda-nvrtc=${{ matrix.cuda-version }} nvidia::cuda-toolkit=${{ matrix.cuda-version }} nvidia::cuda-cudart=${{ matrix.cuda-version }} nvidia::cuda-driver-dev=${{ matrix.cuda-version }} conda-forge::ffmpeg=${{ matrix.ffmpeg-version-for-tests }} conda-forge::xorg-libxau"
99- - name : Check env, set LD_LIBRARY_PATH
100- run : |
101- ${CONDA_RUN} env
102- ${CONDA_RUN} conda info
103- ${CONDA_RUN} nvidia-smi
104- ${CONDA_RUN} conda list
105- echo LD_LIBRARY_PATH=$CONDA_PREFIX/lib:/usr/local/cuda/lib64/:${LD_LIBRARY_PATH} >> $GITHUB_ENV
106- - name : Assert ffmpeg exists
107- run : |
108- ${CONDA_RUN} ffmpeg -buildconf
10988 - name : Update pip
110- run : ${CONDA_RUN} python -m pip install --upgrade pip
89+ run : python -m pip install --upgrade pip
11190 - name : Install PyTorch
11291 run : |
113- ${CONDA_RUN} python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }}
114- ${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")'
92+ python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
11593 - name : Install torchcodec from the wheel
11694 run : |
117- wheel_path=`find pytorch/torchcodec/dist -type f -name "*cu${{ env.cuda_version_without_periods }}-cp${{ env.python_version_without_periods }}* .whl"`
95+ wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"`
11896 echo Installing $wheel_path
119- ${CONDA_RUN} python -m pip install $wheel_path -vvv
97+ python -m pip install $wheel_path -vvv
12098
12199 - name : Check out repo
122100 uses : actions/checkout@v3
101+ - name : Install ffmpeg, post build
102+ run : |
103+ # Ideally we would have checked for that before installing the wheel,
104+ # but we need to checkout the repo to access this file, and we don't
105+ # want to checkout the repo before installing the wheel to avoid any
106+ # side-effect. It's OK.
107+ source packaging/helpers.sh
108+ assert_ffmpeg_not_installed
109+
110+ conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge
111+ ffmpeg -version
123112
124113 - name : Install test dependencies
125114 run : |
126115 # Ideally we would find a way to get those dependencies from pyproject.toml
127- ${CONDA_RUN} python -m pip install numpy pytest pillow
116+ python -m pip install numpy pytest pillow
128117
129118 - name : Delete the src/ folder just for fun
130119 run : |
@@ -142,7 +131,5 @@ jobs:
142131 ls
143132 - name : Run Python tests
144133 run : |
145- ${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest --override-ini="addopts=-v" test --tb=short
146- - name : Run Python benchmark
147- run : |
148- ${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none
134+ pytest --override-ini="addopts=-v" test
135+
0 commit comments