11name : Build and test Linux CUDA wheels
22
33on :
4- pull_request :
4+ # pull_request:
55 push :
66 branches :
77 - nightly
5656 build-platform : " python-build-package"
5757 build-command : " BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 ENABLE_CUDA=1 python -m build --wheel -vvv --no-isolation"
5858
59+ <<<<<<< HEAD
5960 # install-and-test:
6061 # runs-on: linux.g5.4xlarge.nvidia.gpu
6162 # strategy:
7071 # cuda-version: ['12.6', '12.8']
7172 # # TODO: put back ffmpeg 5 https://github.com/pytorch/torchcodec/issues/325
7273 # ffmpeg-version-for-tests: ['4.4.2', '6', '7']
74+ ||||||| 7945e6a
75+ install-and-test :
76+ runs-on : linux.g5.4xlarge.nvidia.gpu
77+ strategy :
78+ fail-fast : false
79+ matrix :
80+ # 3.9 corresponds to the minimum python version for which we build
81+ # the wheel unless the label cliflow/binaries/all is present in the
82+ # PR.
83+ # For the actual release we should add that label and change this to
84+ # include more python versions.
85+ python-version : ['3.9']
86+ cuda-version : ['12.6', '12.8']
87+ # TODO: put back ffmpeg 5 https://github.com/pytorch/torchcodec/issues/325
88+ ffmpeg-version-for-tests : ['4.4.2', '6', '7']
89+ =======
90+ install-and-test :
91+ runs-on : linux.g5.4xlarge.nvidia.gpu
92+ strategy :
93+ fail-fast : false
94+ matrix :
95+ # 3.9 corresponds to the minimum python version for which we build
96+ # the wheel unless the label cliflow/binaries/all is present in the
97+ # PR.
98+ # For the actual release we should add that label and change this to
99+ # include more python versions.
100+ python-version : ['3.9']
101+ # We test against 12.6 and 12.9 to avoid having too big of a CI matrix,
102+ # but for releases we should add 12.8.
103+ cuda-version : ['12.6', '12.9']
104+ # TODO: put back ffmpeg 5 https://github.com/pytorch/torchcodec/issues/325
105+ ffmpeg-version-for-tests : ['4.4.2', '6', '7']
106+ >>>>>>> 3c865b251bc90678621d5249083ea651c477ee8d
73107
108+ <<<<<<< HEAD
74109 # container:
75110 # image: "pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"
76111 # options: "--gpus all -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility"
@@ -112,6 +147,92 @@ jobs:
112147 # wheel_path=`find pytorch/torchcodec/dist -type f -name "*cu${{ env.cuda_version_without_periods }}-cp${{ env.python_version_without_periods }}*.whl"`
113148 # echo Installing $wheel_path
114149 # ${CONDA_RUN} python -m pip install $wheel_path -vvv
150+ ||||||| 7945e6a
151+ container :
152+ image : " pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"
153+ options : " --gpus all -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility"
154+ needs : build
155+ steps :
156+ - name : Setup env vars
157+ run : |
158+ cuda_version_without_periods=$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g')
159+ echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV
160+ python_version_without_periods=$(echo "${{ matrix.python-version }}" | sed 's/\.//g')
161+ echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV
162+ - uses : actions/download-artifact@v4
163+ with :
164+ name : pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
165+ path : pytorch/torchcodec/dist/
166+ - name : Setup miniconda using test-infra
167+ uses : pytorch/test-infra/.github/actions/setup-miniconda@main
168+ with :
169+ python-version : ${{ matrix.python-version }}
170+ # We install conda packages at the start because otherwise conda may have conflicts with dependencies.
171+ 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 }}"
172+ - name : Check env
173+ run : |
174+ ${CONDA_RUN} env
175+ ${CONDA_RUN} conda info
176+ ${CONDA_RUN} nvidia-smi
177+ ${CONDA_RUN} conda list
178+ - name : Assert ffmpeg exists
179+ run : |
180+ ${CONDA_RUN} ffmpeg -buildconf
181+ - name : Update pip
182+ run : ${CONDA_RUN} python -m pip install --upgrade pip
183+ - name : Install PyTorch
184+ run : |
185+ ${CONDA_RUN} python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }}
186+ ${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")'
187+ - name : Install torchcodec from the wheel
188+ run : |
189+ wheel_path=`find pytorch/torchcodec/dist -type f -name "*cu${{ env.cuda_version_without_periods }}-cp${{ env.python_version_without_periods }}*.whl"`
190+ echo Installing $wheel_path
191+ ${CONDA_RUN} python -m pip install $wheel_path -vvv
192+ =======
193+ container :
194+ image : " pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"
195+ options : " --gpus all -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility"
196+ needs : build
197+ steps :
198+ - name : Setup env vars
199+ run : |
200+ cuda_version_without_periods=$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g')
201+ echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV
202+ python_version_without_periods=$(echo "${{ matrix.python-version }}" | sed 's/\.//g')
203+ echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV
204+ - uses : actions/download-artifact@v4
205+ with :
206+ name : pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
207+ path : pytorch/torchcodec/dist/
208+ - name : Setup miniconda using test-infra
209+ uses : pytorch/test-infra/.github/actions/setup-miniconda@main
210+ with :
211+ python-version : ${{ matrix.python-version }}
212+ # We install conda packages at the start because otherwise conda may have conflicts with dependencies.
213+ # Note: xorg-libxau was addded to fix a problem with ffmpeg 4. We should consider removing it.
214+ 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"
215+ - name : Check env
216+ run : |
217+ ${CONDA_RUN} env
218+ ${CONDA_RUN} conda info
219+ ${CONDA_RUN} nvidia-smi
220+ ${CONDA_RUN} conda list
221+ - name : Assert ffmpeg exists
222+ run : |
223+ ${CONDA_RUN} ffmpeg -buildconf
224+ - name : Update pip
225+ run : ${CONDA_RUN} python -m pip install --upgrade pip
226+ - name : Install PyTorch
227+ run : |
228+ ${CONDA_RUN} python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }}
229+ ${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")'
230+ - name : Install torchcodec from the wheel
231+ run : |
232+ wheel_path=`find pytorch/torchcodec/dist -type f -name "*cu${{ env.cuda_version_without_periods }}-cp${{ env.python_version_without_periods }}*.whl"`
233+ echo Installing $wheel_path
234+ ${CONDA_RUN} python -m pip install $wheel_path -vvv
235+ >>>>>>> 3c865b251bc90678621d5249083ea651c477ee8d
115236
116237 # - name: Check out repo
117238 # uses: actions/checkout@v3
@@ -121,6 +242,7 @@ jobs:
121242 # # Ideally we would find a way to get those dependencies from pyproject.toml
122243 # ${CONDA_RUN} python -m pip install numpy pytest pillow
123244
245+ <<<<<<< HEAD
124246 # - name: Delete the src/ folder just for fun
125247 # run: |
126248 # # The only reason we checked-out the repo is to get access to the
@@ -141,3 +263,46 @@ jobs:
141263 # - name: Run Python benchmark
142264 # run: |
143265 # ${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none
266+ ||||||| 7945e6a
267+ - name : Delete the src/ folder just for fun
268+ run : |
269+ # The only reason we checked-out the repo is to get access to the
270+ # tests. We don't care about the rest. Out of precaution, we delete
271+ # the src/ folder to be extra sure that we're running the code from
272+ # the installed wheel rather than from the source.
273+ # This is just to be extra cautious and very overkill because a)
274+ # there's no way the `torchcodec` package from src/ can be found from
275+ # the PythonPath: the main point of `src/` is precisely to protect
276+ # against that and b) if we ever were to execute code from
277+ # `src/torchcodec`, it would fail loudly because the built .so files
278+ # aren't present there.
279+ rm -r src/
280+ ls
281+ - name : Run Python tests
282+ run : |
283+ ${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest test -v --tb=short
284+ - name : Run Python benchmark
285+ run : |
286+ ${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none
287+ =======
288+ - name : Delete the src/ folder just for fun
289+ run : |
290+ # The only reason we checked-out the repo is to get access to the
291+ # tests. We don't care about the rest. Out of precaution, we delete
292+ # the src/ folder to be extra sure that we're running the code from
293+ # the installed wheel rather than from the source.
294+ # This is just to be extra cautious and very overkill because a)
295+ # there's no way the `torchcodec` package from src/ can be found from
296+ # the PythonPath: the main point of `src/` is precisely to protect
297+ # against that and b) if we ever were to execute code from
298+ # `src/torchcodec`, it would fail loudly because the built .so files
299+ # aren't present there.
300+ rm -r src/
301+ ls
302+ - name : Run Python tests
303+ run : |
304+ ${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest --override-ini="addopts=-v" test --tb=short
305+ - name : Run Python benchmark
306+ run : |
307+ ${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none
308+ >>>>>>> 3c865b251bc90678621d5249083ea651c477ee8d
0 commit comments