Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions .github/workflows/linux_cuda_wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ jobs:
# We test against 12.6 and 13.0 to avoid having too big of a CI matrix,
# but for releases we should add 12.8.
cuda-version: ['12.6', '13.0']
# TODO: put back ffmpeg 5 https://github.com/pytorch/torchcodec/issues/325
ffmpeg-version-for-tests: ['4.4.2', '6', '7', '8.0']
ffmpeg-version-for-tests: ['4.4.2', '5', '6', '7', '8.0']

container:
image: "pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"
Expand All @@ -89,40 +88,46 @@ jobs:
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
path: pytorch/torchcodec/dist/
- name: Setup miniconda using test-infra
uses: pytorch/test-infra/.github/actions/setup-miniconda@main
uses: conda-incubator/setup-miniconda@v3
with:
# Using miniforge instead of miniconda ensures that the default
# conda channel is conda-forge instead of main/default. This ensures
# ABI consistency between dependencies:
# https://conda-forge.org/docs/user/transitioning_from_defaults/
miniforge-version: latest
python-version: ${{ matrix.python-version }}
# We install conda packages at the start because otherwise conda may have conflicts with dependencies.
- name: Install dependencies
run: |
# Note: xorg-libxau was addded to fix a problem with ffmpeg 4. We should consider removing it.
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"
conda install libnpp cuda-nvrtc=${{ matrix.cuda-version }} cuda-toolkit=${{ matrix.cuda-version }} cuda-cudart=${{ matrix.cuda-version }} cuda-driver-dev=${{ matrix.cuda-version }} ffmpeg=${{ matrix.ffmpeg-version-for-tests }} xorg-libxau
- name: Check env
run: |
${CONDA_RUN} env
${CONDA_RUN} conda info
${CONDA_RUN} nvidia-smi
${CONDA_RUN} conda list
env
conda info
nvidia-smi
conda list
- name: Assert ffmpeg exists
run: |
${CONDA_RUN} ffmpeg -buildconf
ffmpeg -buildconf
- name: Update pip
run: ${CONDA_RUN} python -m pip install --upgrade pip
- name: Install PyTorch
run: |
${CONDA_RUN} python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }}
${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")'
conda run python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }}
conda run python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")'
- name: Install torchcodec from the wheel
run: |
wheel_path=`find pytorch/torchcodec/dist -type f -name "*cu${{ env.cuda_version_without_periods }}-cp${{ env.python_version_without_periods }}*.whl"`
echo Installing $wheel_path
${CONDA_RUN} python -m pip install $wheel_path -vvv
python -m pip install $wheel_path -vvv

- name: Check out repo
uses: actions/checkout@v3

- name: Install test dependencies
run: |
# Ideally we would find a way to get those dependencies from pyproject.toml
${CONDA_RUN} python -m pip install numpy pytest pillow
python -m pip install numpy pytest pillow

- name: Delete the src/ folder just for fun
run: |
Expand All @@ -140,7 +145,7 @@ jobs:
ls
- name: Run Python tests
run: |
${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest --override-ini="addopts=-v" test --tb=short
FAIL_WITHOUT_CUDA=1 pytest --override-ini="addopts=-v" test --tb=short
- name: Run Python benchmark
run: |
${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none
time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none
Loading