Add HEIC decoder #1735
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Linux CUDA aarch64 | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - nightly | |
| - main | |
| - release/* | |
| tags: | |
| - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }} | |
| cancel-in-progress: true | |
| permissions: | |
| id-token: write | |
| contents: write | |
| defaults: | |
| run: | |
| shell: bash -l -eo pipefail {0} | |
| jobs: | |
| generate-matrix: | |
| uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main | |
| with: | |
| package-type: wheel | |
| os: linux-aarch64 | |
| test-infra-repository: pytorch/test-infra | |
| test-infra-ref: main | |
| with-cpu: disable | |
| with-xpu: disable | |
| with-rocm: disable | |
| with-cuda: enable | |
| build-python-only: "disable" | |
| build: | |
| needs: generate-matrix | |
| strategy: | |
| fail-fast: false | |
| name: Build and Upload wheel | |
| uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main | |
| with: | |
| repository: meta-pytorch/torchcodec | |
| ref: "" | |
| test-infra-repository: pytorch/test-infra | |
| test-infra-ref: main | |
| build-matrix: ${{ needs.generate-matrix.outputs.matrix }} | |
| pre-script: packaging/pre_build_script.sh | |
| post-script: packaging/post_build_script.sh | |
| smoke-test-script: packaging/fake_smoke_test.py | |
| package-name: torchcodec | |
| trigger-event: ${{ github.event_name }} | |
| architecture: aarch64 | |
| build-platform: "python-build-package" | |
| build-command: "BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 ENABLE_CUDA=1 python -m build --wheel -vvv --no-isolation" | |
| install-and-test: | |
| runs-on: linux.arm64.2xlarge | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10'] | |
| cuda-version: ['12.6'] | |
| ffmpeg-version-for-tests: ['4', '5', '6', '7', '8'] | |
| container: | |
| image: "pytorch/manylinuxaarch64-builder:cuda${{ matrix.cuda-version }}" | |
| needs: build | |
| steps: | |
| - name: Setup env vars | |
| run: | | |
| cuda_version_without_periods=$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g') | |
| echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV | |
| - name: Check out repo | |
| uses: actions/checkout@v6 | |
| - name: Remove src/ folder | |
| run: bash packaging/remove_src.sh | |
| - name: Setup conda env | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| auto-update-conda: true | |
| # 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 | |
| activate-environment: test | |
| python-version: ${{ matrix.python-version }} | |
| - name: Update pip | |
| run: python -m pip install --upgrade pip | |
| - name: Install PyTorch | |
| run: ${CONDA_RUN} bash packaging/install_pytorch.sh cu${{ env.cuda_version_without_periods }} "torch torchvision" | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_aarch64 | |
| path: dist/ | |
| - name: Install torchcodec from the wheel | |
| run: bash packaging/install_torchcodec_wheel.sh | |
| - name: Install ffmpeg, post build | |
| run: | | |
| bash packaging/install_ffmpeg.sh ${{ matrix.ffmpeg-version-for-tests }} | |
| echo LD_LIBRARY_PATH=$CONDA_PREFIX/lib:/usr/local/cuda/lib64/:${LD_LIBRARY_PATH} >> $GITHUB_ENV | |
| - name: Install test dependencies | |
| run: bash packaging/install_test_dependencies.sh | |
| # Install libheif (optional HEIC runtime dep) into the SAME env, only for | |
| # the FFmpeg-8 cell that runs the full suite (avoids the FFmpeg-4 aom | |
| # conflict). cuda-toolkit here comes from the container image (not conda), | |
| # so a post-hoc conda install doesn't hit the cuda-toolkit re-solve issue. | |
| # Sets LD_LIBRARY_PATH + FAIL_WITHOUT_HEIC via GITHUB_ENV on success. | |
| - name: Install libheif (HEIC runtime dep) | |
| if: ${{ matrix.ffmpeg-version-for-tests == '8' }} | |
| run: bash packaging/install_libheif.sh | |
| - name: Run Python smoke tests | |
| run: | | |
| FAIL_WITHOUT_JPEG=1 FAIL_WITHOUT_PNG=1 FAIL_WITHOUT_WEBP=1 FAIL_WITHOUT_AVIF=1 pytest --override-ini="addopts=-v" test/smoke_test.py --tb=short | |
| - name: Run Python tests | |
| if: ${{ matrix.ffmpeg-version-for-tests == '8' && !startsWith(github.ref, 'refs/heads/release/') }} | |
| run: | | |
| FAIL_WITHOUT_JPEG=1 FAIL_WITHOUT_PNG=1 FAIL_WITHOUT_WEBP=1 FAIL_WITHOUT_AVIF=1 pytest --override-ini="addopts=-v" test |