From 0eedfe627b5d754b220abe7034f191a4df3c4b1d Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 16 Oct 2024 11:36:48 -0700 Subject: [PATCH 01/83] Add cuda wheel --- .github/workflows/linux_cuda_wheel.yaml | 127 ++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 .github/workflows/linux_cuda_wheel.yaml diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml new file mode 100644 index 00000000..51eb1c3e --- /dev/null +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -0,0 +1,127 @@ +name: Build and test Linux CUDA wheels + +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 + test-infra-repository: pytorch/test-infra + test-infra-ref: main + with-xpu: disable + with-rocm: disable + with-cuda: enable + 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: pytorch/torchcodec + ref: "" + test-infra-repository: pytorch/test-infra + test-infra-ref: main + build-matrix: ${{ needs.generate-matrix.outputs.matrix }} + post-script: packaging/post_build_script.sh + smoke-test-script: packaging/fake_smoke_test.py + package-name: torchcodec + trigger-event: ${{ github.event_name }} + 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: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ['3.9'] + ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1'] + if: ${{ always() }} + needs: build + steps: + - uses: actions/download-artifact@v3 + with: + name: pytorch_torchcodec__${{ matrix.python-version }}_cpu_x86_64 + path: pytorch/torchcodec/dist/ + - name: Setup conda env + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + miniconda-version: "latest" + activate-environment: test + python-version: ${{ matrix.python-version }} + - name: Update pip + run: python -m pip install --upgrade pip + - name: Install PyTorch + run: | + python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu + - name: Install torchcodec from the wheel + run: | + wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"` + echo Installing $wheel_path + python -m pip install $wheel_path -vvv + + - name: Check out repo + uses: actions/checkout@v3 + - name: Install ffmpeg, post build + run: | + # Ideally we would have checked for that before installing the wheel, + # but we need to checkout the repo to access this file, and we don't + # want to checkout the repo before installing the wheel to avoid any + # side-effect. It's OK. + source packaging/helpers.sh + assert_ffmpeg_not_installed + + conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge + ffmpeg -version + + - name: Install test dependencies + run: | + python -m pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cpu + # Ideally we would find a way to get those dependencies from pyproject.toml + python -m pip install numpy pytest pillow + + - name: Delete the src/ folder just for fun + run: | + # The only reason we checked-out the repo is to get access to the + # tests. We don't care about the rest. Out of precaution, we delete + # the src/ folder to be extra sure that we're running the code from + # the installed wheel rather than from the source. + # This is just to be extra cautious and very overkill because a) + # there's no way the `torchcodec` package from src/ can be found from + # the PythonPath: the main point of `src/` is precisely to protect + # against that and b) if we ever were to execute code from + # `src/torchcodec`, it would fail loudly because the built .so files + # aren't present there. + rm -r src/ + ls + - name: Smoke test + run: | + python test/decoders/manual_smoke_test.py + - name: Run Python tests + run: | + pytest test -vvv From 9996cc119826e76e954f389dbb2eadcef26ae7d1 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 16 Oct 2024 12:19:17 -0700 Subject: [PATCH 02/83] . --- .github/workflows/linux_cuda_wheel.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 51eb1c3e..c960b285 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -31,6 +31,7 @@ jobs: os: linux test-infra-repository: pytorch/test-infra test-infra-ref: main + with-cpu: disable with-xpu: disable with-rocm: disable with-cuda: enable From 40dcc4cda6859728909f6fe3d729447298d0e800 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 16 Oct 2024 12:48:31 -0700 Subject: [PATCH 03/83] . --- .github/workflows/linux_cuda_wheel.yaml | 1 + src/torchcodec/decoders/_core/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index c960b285..a5179494 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -47,6 +47,7 @@ jobs: test-infra-repository: pytorch/test-infra test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} + pre-script: packaging/linux_cuda_pre_build_script.sh post-script: packaging/post_build_script.sh smoke-test-script: packaging/fake_smoke_test.py package-name: torchcodec diff --git a/src/torchcodec/decoders/_core/CMakeLists.txt b/src/torchcodec/decoders/_core/CMakeLists.txt index 2527c217..c42ced5c 100644 --- a/src/torchcodec/decoders/_core/CMakeLists.txt +++ b/src/torchcodec/decoders/_core/CMakeLists.txt @@ -76,7 +76,7 @@ if(DEFINED ENV{BUILD_AGAINST_ALL_FFMPEG_FROM_S3}) ${CMAKE_CURRENT_SOURCE_DIR}/fetch_and_expose_non_gpl_ffmpeg_libs.cmake ) - make_torchcodec_library(libtorchcodec4 ffmpeg4) + make_torchcodec_library(libtorchcodec5 ffmpeg5) make_torchcodec_library(libtorchcodec6 ffmpeg6) make_torchcodec_library(libtorchcodec7 ffmpeg7) From 1392d9781c38469132e1044160e96f45804cdfd9 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 16 Oct 2024 13:07:45 -0700 Subject: [PATCH 04/83] . --- packaging/linux_cuda_pre_build_script.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 packaging/linux_cuda_pre_build_script.sh diff --git a/packaging/linux_cuda_pre_build_script.sh b/packaging/linux_cuda_pre_build_script.sh new file mode 100644 index 00000000..30d33638 --- /dev/null +++ b/packaging/linux_cuda_pre_build_script.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +conda install From b6e991d449bec4bf7761afd13a9dbd72e5f6716f Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 16 Oct 2024 13:17:54 -0700 Subject: [PATCH 05/83] . --- packaging/linux_cuda_pre_build_script.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packaging/linux_cuda_pre_build_script.sh b/packaging/linux_cuda_pre_build_script.sh index 30d33638..bb2fd171 100644 --- a/packaging/linux_cuda_pre_build_script.sh +++ b/packaging/linux_cuda_pre_build_script.sh @@ -1,3 +1,5 @@ #!/bin/bash -conda install +set -x + +ffmpeg -v From 4939eab5c016447804f3a2ed392c497298077026 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 16 Oct 2024 13:32:55 -0700 Subject: [PATCH 06/83] . --- packaging/linux_cuda_pre_build_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/linux_cuda_pre_build_script.sh b/packaging/linux_cuda_pre_build_script.sh index bb2fd171..b4674ffb 100644 --- a/packaging/linux_cuda_pre_build_script.sh +++ b/packaging/linux_cuda_pre_build_script.sh @@ -2,4 +2,4 @@ set -x -ffmpeg -v +conda info From da42e6b37784cda5fe1576616030d51925ea7cfc Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 16 Oct 2024 13:41:27 -0700 Subject: [PATCH 07/83] . --- src/torchcodec/decoders/_core/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/torchcodec/decoders/_core/CMakeLists.txt b/src/torchcodec/decoders/_core/CMakeLists.txt index c42ced5c..7df7f71d 100644 --- a/src/torchcodec/decoders/_core/CMakeLists.txt +++ b/src/torchcodec/decoders/_core/CMakeLists.txt @@ -77,9 +77,10 @@ if(DEFINED ENV{BUILD_AGAINST_ALL_FFMPEG_FROM_S3}) ) - make_torchcodec_library(libtorchcodec5 ffmpeg5) - make_torchcodec_library(libtorchcodec6 ffmpeg6) make_torchcodec_library(libtorchcodec7 ffmpeg7) + make_torchcodec_library(libtorchcodec6 ffmpeg6) + make_torchcodec_library(libtorchcodec5 ffmpeg5) + make_torchcodec_library(libtorchcodec7 ffmpeg4) else() message( STATUS From 6be7b7674de95a894c272313285eceb4ceb55230 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 16 Oct 2024 14:13:52 -0700 Subject: [PATCH 08/83] . --- src/torchcodec/decoders/_core/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/torchcodec/decoders/_core/CMakeLists.txt b/src/torchcodec/decoders/_core/CMakeLists.txt index 7df7f71d..3f8a5f11 100644 --- a/src/torchcodec/decoders/_core/CMakeLists.txt +++ b/src/torchcodec/decoders/_core/CMakeLists.txt @@ -80,7 +80,7 @@ if(DEFINED ENV{BUILD_AGAINST_ALL_FFMPEG_FROM_S3}) make_torchcodec_library(libtorchcodec7 ffmpeg7) make_torchcodec_library(libtorchcodec6 ffmpeg6) make_torchcodec_library(libtorchcodec5 ffmpeg5) - make_torchcodec_library(libtorchcodec7 ffmpeg4) + make_torchcodec_library(libtorchcodec4 ffmpeg4) else() message( STATUS From a2d1156bf39670fe3da061ecaadade644e2e5795 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 16 Oct 2024 15:05:04 -0700 Subject: [PATCH 09/83] . --- src/torchcodec/decoders/_core/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/torchcodec/decoders/_core/CMakeLists.txt b/src/torchcodec/decoders/_core/CMakeLists.txt index 3f8a5f11..b8958f02 100644 --- a/src/torchcodec/decoders/_core/CMakeLists.txt +++ b/src/torchcodec/decoders/_core/CMakeLists.txt @@ -77,10 +77,17 @@ if(DEFINED ENV{BUILD_AGAINST_ALL_FFMPEG_FROM_S3}) ) +if(ENABLE_CUDA) + # TODO: Enable more ffmpeg versions for cuda. + make_torchcodec_library(libtorchcodec7 ffmpeg7) + make_torchcodec_library(libtorchcodec6 ffmpeg6) +#else() make_torchcodec_library(libtorchcodec7 ffmpeg7) make_torchcodec_library(libtorchcodec6 ffmpeg6) make_torchcodec_library(libtorchcodec5 ffmpeg5) make_torchcodec_library(libtorchcodec4 ffmpeg4) +#endif() + else() message( STATUS From f4e087997724d4526682adac73e746024d728a9d Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 16 Oct 2024 15:29:52 -0700 Subject: [PATCH 10/83] . --- src/torchcodec/decoders/_core/CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/torchcodec/decoders/_core/CMakeLists.txt b/src/torchcodec/decoders/_core/CMakeLists.txt index b8958f02..e63e8e7d 100644 --- a/src/torchcodec/decoders/_core/CMakeLists.txt +++ b/src/torchcodec/decoders/_core/CMakeLists.txt @@ -77,16 +77,16 @@ if(DEFINED ENV{BUILD_AGAINST_ALL_FFMPEG_FROM_S3}) ) -if(ENABLE_CUDA) - # TODO: Enable more ffmpeg versions for cuda. - make_torchcodec_library(libtorchcodec7 ffmpeg7) - make_torchcodec_library(libtorchcodec6 ffmpeg6) -#else() - make_torchcodec_library(libtorchcodec7 ffmpeg7) - make_torchcodec_library(libtorchcodec6 ffmpeg6) - make_torchcodec_library(libtorchcodec5 ffmpeg5) - make_torchcodec_library(libtorchcodec4 ffmpeg4) -#endif() + if(ENABLE_CUDA) + # TODO: Enable more ffmpeg versions for cuda. + make_torchcodec_library(libtorchcodec7 ffmpeg7) + make_torchcodec_library(libtorchcodec6 ffmpeg6) + #else() + make_torchcodec_library(libtorchcodec7 ffmpeg7) + make_torchcodec_library(libtorchcodec6 ffmpeg6) + make_torchcodec_library(libtorchcodec5 ffmpeg5) + make_torchcodec_library(libtorchcodec4 ffmpeg4) + #endif() else() message( From 3358fa8369c9e9938ddd625e619ff8842ac1db92 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 05:19:50 -0700 Subject: [PATCH 11/83] . --- src/torchcodec/decoders/_core/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/torchcodec/decoders/_core/CMakeLists.txt b/src/torchcodec/decoders/_core/CMakeLists.txt index e63e8e7d..72939c53 100644 --- a/src/torchcodec/decoders/_core/CMakeLists.txt +++ b/src/torchcodec/decoders/_core/CMakeLists.txt @@ -81,12 +81,12 @@ if(DEFINED ENV{BUILD_AGAINST_ALL_FFMPEG_FROM_S3}) # TODO: Enable more ffmpeg versions for cuda. make_torchcodec_library(libtorchcodec7 ffmpeg7) make_torchcodec_library(libtorchcodec6 ffmpeg6) - #else() + else() make_torchcodec_library(libtorchcodec7 ffmpeg7) make_torchcodec_library(libtorchcodec6 ffmpeg6) make_torchcodec_library(libtorchcodec5 ffmpeg5) make_torchcodec_library(libtorchcodec4 ffmpeg4) - #endif() + endif() else() message( From bb655ed94615715dfb99ea505df7dd8a93505cf2 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 11:58:16 -0700 Subject: [PATCH 12/83] . --- packaging/post_build_script.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packaging/post_build_script.sh b/packaging/post_build_script.sh index 84686d84..7124ec05 100755 --- a/packaging/post_build_script.sh +++ b/packaging/post_build_script.sh @@ -6,7 +6,12 @@ wheel_path=$(pwd)/$(find dist -type f -name "*.whl") echo "Wheel content:" unzip -l $wheel_path -for ffmpeg_major_version in 4 5 6 7; do +ffmpeg_versions=(4 5 6 7) +if [ "$ENABLE_CUDA" -eq 1 ]; then + ffmpeg_versions=(5 6 7) +fi + +for ffmpeg_major_version in ${ffmepg_versions[@]}; do assert_in_wheel $wheel_path torchcodec/libtorchcodec${ffmpeg_major_version}.so done assert_not_in_wheel $wheel_path libtorchcodec.so From cb9506702411cb01861bf4dcbd2956612179cff3 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 12:17:19 -0700 Subject: [PATCH 13/83] . --- .github/workflows/linux_cuda_wheel.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index a5179494..73640d21 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -61,13 +61,14 @@ jobs: fail-fast: false matrix: python-version: ['3.9'] + cuda-version: ['124'] ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1'] if: ${{ always() }} needs: build steps: - uses: actions/download-artifact@v3 with: - name: pytorch_torchcodec__${{ matrix.python-version }}_cpu_x86_64 + name: pytorch_torchcodec__${{ matrix.python-version }}_${{ matrix.cuda-version }}_x86_64 path: pytorch/torchcodec/dist/ - name: Setup conda env uses: conda-incubator/setup-miniconda@v2 From 5ca956c88ea7f9c835ba977e7b0d7ad804005ac2 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 12:28:04 -0700 Subject: [PATCH 14/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- packaging/post_build_script.sh | 2 ++ src/torchcodec/decoders/_core/CMakeLists.txt | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 73640d21..78e4fe5c 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -68,7 +68,7 @@ jobs: steps: - uses: actions/download-artifact@v3 with: - name: pytorch_torchcodec__${{ matrix.python-version }}_${{ matrix.cuda-version }}_x86_64 + name: pytorch_torchcodec__${{ matrix.python-version }}_cu${{ matrix.cuda-version }}_x86_64 path: pytorch/torchcodec/dist/ - name: Setup conda env uses: conda-incubator/setup-miniconda@v2 diff --git a/packaging/post_build_script.sh b/packaging/post_build_script.sh index 7124ec05..721f0b61 100755 --- a/packaging/post_build_script.sh +++ b/packaging/post_build_script.sh @@ -7,6 +7,8 @@ echo "Wheel content:" unzip -l $wheel_path ffmpeg_versions=(4 5 6 7) + +# TODO: Make ffmpeg4 work with nvcc. if [ "$ENABLE_CUDA" -eq 1 ]; then ffmpeg_versions=(5 6 7) fi diff --git a/src/torchcodec/decoders/_core/CMakeLists.txt b/src/torchcodec/decoders/_core/CMakeLists.txt index 72939c53..21129bc9 100644 --- a/src/torchcodec/decoders/_core/CMakeLists.txt +++ b/src/torchcodec/decoders/_core/CMakeLists.txt @@ -81,6 +81,7 @@ if(DEFINED ENV{BUILD_AGAINST_ALL_FFMPEG_FROM_S3}) # TODO: Enable more ffmpeg versions for cuda. make_torchcodec_library(libtorchcodec7 ffmpeg7) make_torchcodec_library(libtorchcodec6 ffmpeg6) + make_torchcodec_library(libtorchcodec5 ffmpeg5) else() make_torchcodec_library(libtorchcodec7 ffmpeg7) make_torchcodec_library(libtorchcodec6 ffmpeg6) From 2592372c38d769940c716af49bd381f067182659 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 12:45:58 -0700 Subject: [PATCH 15/83] . --- .github/workflows/linux_cuda_wheel.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 78e4fe5c..793dda74 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -81,7 +81,10 @@ jobs: run: python -m pip install --upgrade pip - name: Install PyTorch run: | - python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu + python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ matrix.cuda-version }} + - name: Install cuda dependencies + run: | + conda install --yes nvidia::libnpp - name: Install torchcodec from the wheel run: | wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"` From 9dfea8100fb4e728968473e9e7369cd168746cf5 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 13:14:28 -0700 Subject: [PATCH 16/83] . --- .github/workflows/linux_cuda_wheel.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 793dda74..4f5a31fd 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -61,8 +61,9 @@ jobs: fail-fast: false matrix: python-version: ['3.9'] - cuda-version: ['124'] - ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1'] + cuda-version: ['12.4'] + cuda-version-without-period: ${{ replace(matrix.cuda-version, ".", "")}} + ffmpeg-version-for-tests: ['5.1.2', '6.1.1', '7.0.1'] if: ${{ always() }} needs: build steps: @@ -81,7 +82,7 @@ jobs: run: python -m pip install --upgrade pip - name: Install PyTorch run: | - python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ matrix.cuda-version }} + python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ matrix.cuda-version-without-period }} - name: Install cuda dependencies run: | conda install --yes nvidia::libnpp From c6605c209e412c13e95756ac95f7c7cf9d5f97aa Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 13:32:42 -0700 Subject: [PATCH 17/83] . --- .github/workflows/linux_cuda_wheel.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 4f5a31fd..d6b92e04 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -62,7 +62,6 @@ jobs: matrix: python-version: ['3.9'] cuda-version: ['12.4'] - cuda-version-without-period: ${{ replace(matrix.cuda-version, ".", "")}} ffmpeg-version-for-tests: ['5.1.2', '6.1.1', '7.0.1'] if: ${{ always() }} needs: build @@ -82,10 +81,11 @@ jobs: run: python -m pip install --upgrade pip - name: Install PyTorch run: | - python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ matrix.cuda-version-without-period }} + python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ matrix.cuda-version//./ }} - name: Install cuda dependencies run: | conda install --yes nvidia::libnpp + conda install --yes nvidia::cuda-nvrtc - name: Install torchcodec from the wheel run: | wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"` From 4bcab19de01e849c3dfffc93bb02815c1374957b Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 13:38:34 -0700 Subject: [PATCH 18/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index d6b92e04..b537e7cd 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -81,7 +81,7 @@ jobs: run: python -m pip install --upgrade pip - name: Install PyTorch run: | - python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ matrix.cuda-version//./ }} + python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ matrix.cuda-version }} - name: Install cuda dependencies run: | conda install --yes nvidia::libnpp From c94d5a1c1f7a3055561ef1d49fdc18355ff84a89 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 13:41:01 -0700 Subject: [PATCH 19/83] . --- .github/workflows/linux_cuda_wheel.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index b537e7cd..3354c895 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -81,7 +81,8 @@ jobs: run: python -m pip install --upgrade pip - name: Install PyTorch run: | - python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ matrix.cuda-version }} + cuda_version_without_periods=$(echo ${{ matrix-cuda-version }} | sed 's/\.//g') + python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu$cuda_version_without_periods - name: Install cuda dependencies run: | conda install --yes nvidia::libnpp From a400d0fc043b70a003e7230f19294d0c07592790 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 13:43:23 -0700 Subject: [PATCH 20/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 3354c895..b22caf9e 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -81,7 +81,7 @@ jobs: run: python -m pip install --upgrade pip - name: Install PyTorch run: | - cuda_version_without_periods=$(echo ${{ matrix-cuda-version }} | sed 's/\.//g') + cuda_version_without_periods=$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g') python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu$cuda_version_without_periods - name: Install cuda dependencies run: | From f3945b92d4e106e55002d87c15d171999681b72e Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 14:03:11 -0700 Subject: [PATCH 21/83] . --- .github/workflows/linux_cuda_wheel.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index b22caf9e..438a1239 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -66,9 +66,13 @@ jobs: if: ${{ always() }} 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 - uses: actions/download-artifact@v3 with: - name: pytorch_torchcodec__${{ matrix.python-version }}_cu${{ matrix.cuda-version }}_x86_64 + name: pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64 path: pytorch/torchcodec/dist/ - name: Setup conda env uses: conda-incubator/setup-miniconda@v2 From 26d70a4b0104d6fe5f8336ca2cb76cb353d6639f Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 14:06:04 -0700 Subject: [PATCH 22/83] . --- .github/workflows/linux_cuda_wheel.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 438a1239..d1b53f4b 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -85,8 +85,7 @@ jobs: run: python -m pip install --upgrade pip - name: Install PyTorch run: | - cuda_version_without_periods=$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g') - python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu$cuda_version_without_periods + python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} - name: Install cuda dependencies run: | conda install --yes nvidia::libnpp From c98878b48f5508405c630460929959f41bb1df81 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 14:19:13 -0700 Subject: [PATCH 23/83] . --- .github/workflows/linux_cuda_wheel.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index d1b53f4b..72d3501b 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -88,8 +88,7 @@ jobs: python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} - name: Install cuda dependencies run: | - conda install --yes nvidia::libnpp - conda install --yes nvidia::cuda-nvrtc + conda install --yes nvidia::libnpp nvidia::cuda-nvrtc nvidia::cuda-toolkit nvidia::cuda-cudart - name: Install torchcodec from the wheel run: | wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"` From 318c950df988dd0a1c94cca9853cfb6b7ecaf35e Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 14:32:27 -0700 Subject: [PATCH 24/83] . --- .github/workflows/linux_cuda_wheel.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 72d3501b..02acdccc 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -86,9 +86,6 @@ jobs: - name: Install PyTorch run: | python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} - - name: Install cuda dependencies - run: | - conda install --yes nvidia::libnpp nvidia::cuda-nvrtc nvidia::cuda-toolkit nvidia::cuda-cudart - name: Install torchcodec from the wheel run: | wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"` @@ -109,6 +106,9 @@ jobs: conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge ffmpeg -version + - name: Install cuda runtime dependencies + run: | + conda install --yes nvidia::libnpp nvidia::cuda-nvrtc nvidia::cuda-toolkit nvidia::cuda-cudart - name: Install test dependencies run: | python -m pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cpu From 4ef67fde10db02f5e39e9b40ad1cfd8c3628d980 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 15:47:45 -0700 Subject: [PATCH 25/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 02acdccc..bb9e9db5 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -131,6 +131,8 @@ jobs: ls - name: Smoke test run: | + find $CONDA_PREFIX -name libtorchcodec\*.so | xargs ldd + find $CONDA_PREFIX -name libcuda\*.so\* python test/decoders/manual_smoke_test.py - name: Run Python tests run: | From c29219b6a3b0ed6f70d8943a7d9a7ecfb126bf97 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 16:21:41 -0700 Subject: [PATCH 26/83] . --- .github/workflows/linux_cuda_wheel.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index bb9e9db5..2ec6e213 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -108,7 +108,7 @@ jobs: - name: Install cuda runtime dependencies run: | - conda install --yes nvidia::libnpp nvidia::cuda-nvrtc nvidia::cuda-toolkit nvidia::cuda-cudart + conda install --yes nvidia::libnpp= nvidia::cuda-nvrtc nvidia::cuda-toolkit nvidia::cuda-cudart nvidia::cuda-driver-dev - name: Install test dependencies run: | python -m pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cpu @@ -133,6 +133,9 @@ jobs: run: | find $CONDA_PREFIX -name libtorchcodec\*.so | xargs ldd find $CONDA_PREFIX -name libcuda\*.so\* + echo $CONDA_PREFIX + find / -name libcuda.so + find / -name libcuda.so.1 python test/decoders/manual_smoke_test.py - name: Run Python tests run: | From 68dc6e674fd44679d7ff52c34e9511587bae30aa Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 18:44:45 -0700 Subject: [PATCH 27/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 2ec6e213..ded668a8 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -134,8 +134,6 @@ jobs: find $CONDA_PREFIX -name libtorchcodec\*.so | xargs ldd find $CONDA_PREFIX -name libcuda\*.so\* echo $CONDA_PREFIX - find / -name libcuda.so - find / -name libcuda.so.1 python test/decoders/manual_smoke_test.py - name: Run Python tests run: | From 9d1a505f78346b3266ce4231e5f4d1325b3fb756 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 19:06:18 -0700 Subject: [PATCH 28/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index ded668a8..a44b176c 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -108,7 +108,7 @@ jobs: - name: Install cuda runtime dependencies run: | - conda install --yes nvidia::libnpp= nvidia::cuda-nvrtc nvidia::cuda-toolkit nvidia::cuda-cudart nvidia::cuda-driver-dev + conda install --yes nvidia::libnpp nvidia::cuda-nvrtc=12.4 nvidia::cuda-toolkit=12.4 nvidia::cuda-cudart=12.4 nvidia::cuda-driver-dev=12.4 - name: Install test dependencies run: | python -m pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cpu From df7c4e544dd678202bb02142711324719b5720de Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 17 Oct 2024 19:29:01 -0700 Subject: [PATCH 29/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index a44b176c..bff341b7 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -56,7 +56,7 @@ jobs: build-command: "BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 ENABLE_CUDA=1 python -m build --wheel -vvv --no-isolation" install-and-test: - runs-on: ubuntu-latest + runs-on: linux.gcp.a100.large strategy: fail-fast: false matrix: From 0ed2cd9d78dce15b9c8392cf3094d6c1506bf897 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 05:43:58 -0700 Subject: [PATCH 30/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index bff341b7..e1853811 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -56,7 +56,7 @@ jobs: 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.gcp.a100.large + runs-on: linux.4xlarge.nvidia.gpu strategy: fail-fast: false matrix: From 83b34b4b8503a7815dc5789eac29eb3c16c5642d Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 08:48:31 -0700 Subject: [PATCH 31/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index e1853811..eac47dfa 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -63,6 +63,8 @@ jobs: python-version: ['3.9'] cuda-version: ['12.4'] ffmpeg-version-for-tests: ['5.1.2', '6.1.1', '7.0.1'] + container: + image: "pytorch/manylinux-builder:cuda${{ matrix.cuda-version }}" if: ${{ always() }} needs: build steps: From 1c0b022ea2c733d39c8679c70b9150c71d9398cc Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 10:04:09 -0700 Subject: [PATCH 32/83] . --- .github/workflows/linux_cuda_wheel.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index eac47dfa..3c158761 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -84,15 +84,15 @@ jobs: activate-environment: test python-version: ${{ matrix.python-version }} - name: Update pip - run: python -m pip install --upgrade pip + run: ${CONDA_RUN} python -m pip install --upgrade pip - name: Install PyTorch run: | - python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} + ${CONDA_RUN} python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} - name: Install torchcodec from the wheel run: | wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"` echo Installing $wheel_path - python -m pip install $wheel_path -vvv + ${CONDA_RUN} python -m pip install $wheel_path -vvv - name: Check out repo uses: actions/checkout@v3 @@ -105,17 +105,17 @@ jobs: source packaging/helpers.sh assert_ffmpeg_not_installed - conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge - ffmpeg -version + ${CONDA_RUN} conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge + ${CONDA_RUN} ffmpeg -version - name: Install cuda runtime dependencies run: | - conda install --yes nvidia::libnpp nvidia::cuda-nvrtc=12.4 nvidia::cuda-toolkit=12.4 nvidia::cuda-cudart=12.4 nvidia::cuda-driver-dev=12.4 + ${CONDA_RUN} conda install --yes nvidia::libnpp nvidia::cuda-nvrtc=12.4 nvidia::cuda-toolkit=12.4 nvidia::cuda-cudart=12.4 nvidia::cuda-driver-dev=12.4 - name: Install test dependencies run: | - python -m pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cpu + ${CONDA_RUN} python -m pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cpu # Ideally we would find a way to get those dependencies from pyproject.toml - python -m pip install numpy pytest pillow + ${CONDA_RUN} python -m pip install numpy pytest pillow - name: Delete the src/ folder just for fun run: | From 9e8e9cd3bbd9b433dd2797b9d52524a1a110f79e Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 10:34:12 -0700 Subject: [PATCH 33/83] . --- .github/workflows/linux_cuda_wheel.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 3c158761..af53d9ff 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -83,16 +83,22 @@ jobs: miniconda-version: "latest" activate-environment: test python-version: ${{ matrix.python-version }} + - name: Check env + run: | + env + conda info - name: Update pip - run: ${CONDA_RUN} python -m pip install --upgrade pip + run: python -m pip install --upgrade pip - name: Install PyTorch run: | - ${CONDA_RUN} python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} + conda activate test + python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} - name: Install torchcodec from the wheel run: | wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"` echo Installing $wheel_path - ${CONDA_RUN} python -m pip install $wheel_path -vvv + conda activate test + python -m pip install $wheel_path -vvv - name: Check out repo uses: actions/checkout@v3 From e78986a85a32e8f4f1a834ef3efad1767c113fe9 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 10:47:24 -0700 Subject: [PATCH 34/83] . --- .github/workflows/linux_cuda_wheel.yaml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index af53d9ff..a175dd01 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -76,29 +76,24 @@ jobs: with: name: pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64 path: pytorch/torchcodec/dist/ - - name: Setup conda env - uses: conda-incubator/setup-miniconda@v2 + - name: Setup miniconda using test-infra + uses: pytorch/test-infra/.github/actions/setup-miniconda@main with: - auto-update-conda: true - miniconda-version: "latest" - activate-environment: test - python-version: ${{ matrix.python-version }} + python-version: "3.9" - name: Check env run: | - env - conda info + ${CONDA_RUN} env + ${CONDA_RUN} conda info - name: Update pip - run: python -m pip install --upgrade pip + run: ${CONDA_RUN} python -m pip install --upgrade pip - name: Install PyTorch run: | - conda activate test - python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} + ${CONDA_RUN} python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} - name: Install torchcodec from the wheel run: | wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"` echo Installing $wheel_path - conda activate test - python -m pip install $wheel_path -vvv + ${CONDA_RUN} python -m pip install $wheel_path -vvv - name: Check out repo uses: actions/checkout@v3 From 08cf4fa8eea22fa41ea8b752f3a12734f7fd7685 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 11:17:39 -0700 Subject: [PATCH 35/83] . --- .github/workflows/linux_cuda_wheel.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index a175dd01..46126b93 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -106,8 +106,7 @@ jobs: source packaging/helpers.sh assert_ffmpeg_not_installed - ${CONDA_RUN} conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge - ${CONDA_RUN} ffmpeg -version + ${CONDA_RUN} conda install --yes conda-forge::ffmpeg=${{ matrix.ffmpeg-version-for-tests }} - name: Install cuda runtime dependencies run: | From 411e077f9435625656e9db073d15459ef70df6f1 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 11:33:56 -0700 Subject: [PATCH 36/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 46126b93..08e8a629 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -62,7 +62,7 @@ jobs: matrix: python-version: ['3.9'] cuda-version: ['12.4'] - ffmpeg-version-for-tests: ['5.1.2', '6.1.1', '7.0.1'] + ffmpeg-version-for-tests: ['5', '6', '7'] container: image: "pytorch/manylinux-builder:cuda${{ matrix.cuda-version }}" if: ${{ always() }} From da3458f301c1f2bc688a66df273b591e575051bf Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 12:02:59 -0700 Subject: [PATCH 37/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 08e8a629..ad7276c1 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -106,7 +106,7 @@ jobs: source packaging/helpers.sh assert_ffmpeg_not_installed - ${CONDA_RUN} conda install --yes conda-forge::ffmpeg=${{ matrix.ffmpeg-version-for-tests }} + ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge - name: Install cuda runtime dependencies run: | From f2728c8080034899e9ea762c66437dc05d61a834 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 12:25:46 -0700 Subject: [PATCH 38/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index ad7276c1..fb86ab0d 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -106,7 +106,7 @@ jobs: source packaging/helpers.sh assert_ffmpeg_not_installed - ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge + ${CONDA_RUN} conda install --yes zlib ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge - name: Install cuda runtime dependencies run: | From 0b22a39e4677ca6847376e5de03befcaf3f932e9 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 13:16:38 -0700 Subject: [PATCH 39/83] . --- .github/workflows/linux_cuda_wheel.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index fb86ab0d..8125a094 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -106,7 +106,8 @@ jobs: source packaging/helpers.sh assert_ffmpeg_not_installed - ${CONDA_RUN} conda install --yes zlib ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge + ${CONDA_RUN} conda update --all --yes + ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge - name: Install cuda runtime dependencies run: | From 605152bb04d8204e0bf01993a5edd6cf333a44d4 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 13:40:06 -0700 Subject: [PATCH 40/83] . --- .github/workflows/linux_cuda_wheel.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 8125a094..d466caa5 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -107,6 +107,7 @@ jobs: assert_ffmpeg_not_installed ${CONDA_RUN} conda update --all --yes + ${CONDA_RUN} conda config --show ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge - name: Install cuda runtime dependencies From 0194995aa4e904f56fd821d815ed68f1fdc4c100 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 14:09:28 -0700 Subject: [PATCH 41/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index d466caa5..0fc5e480 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -107,6 +107,8 @@ jobs: assert_ffmpeg_not_installed ${CONDA_RUN} conda update --all --yes + ${CONDA_RUN} conda update --yes conda + ${CONDA_RUN} conda config --set channel_priority flexible ${CONDA_RUN} conda config --show ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge From 297e0b2974be84b35c7c07a76ae3dcda88035b49 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Fri, 18 Oct 2024 14:44:54 -0700 Subject: [PATCH 42/83] . --- .github/workflows/linux_cuda_wheel.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 0fc5e480..24904656 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -110,6 +110,7 @@ jobs: ${CONDA_RUN} conda update --yes conda ${CONDA_RUN} conda config --set channel_priority flexible ${CONDA_RUN} conda config --show + ${CONDA_INSTALL} --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge - name: Install cuda runtime dependencies From 45ce5a3c7f3aaf47a3640882c0d164cd2effd368 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Sun, 20 Oct 2024 17:24:59 -0700 Subject: [PATCH 43/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 24904656..ea1b251b 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -106,8 +106,8 @@ jobs: source packaging/helpers.sh assert_ffmpeg_not_installed + ${CONDA_RUN} conda install --yes conda ${CONDA_RUN} conda update --all --yes - ${CONDA_RUN} conda update --yes conda ${CONDA_RUN} conda config --set channel_priority flexible ${CONDA_RUN} conda config --show ${CONDA_INSTALL} --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge From 272f1d99ed308ba9743a95c7dc7cc0b03a599c3a Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Sun, 20 Oct 2024 18:03:32 -0700 Subject: [PATCH 44/83] . --- .github/workflows/linux_cuda_wheel.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index ea1b251b..8de74794 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -108,7 +108,8 @@ jobs: ${CONDA_RUN} conda install --yes conda ${CONDA_RUN} conda update --all --yes - ${CONDA_RUN} conda config --set channel_priority flexible + ${CONDA_RUN} conda config --add channels conda-forge + ${CONDA_RUN} conda config --set channel_priority strict ${CONDA_RUN} conda config --show ${CONDA_INSTALL} --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge From de07c6c2c305ea0e02243fd9a399930b1be3cb80 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 06:06:04 -0700 Subject: [PATCH 45/83] . --- .github/workflows/linux_cuda_wheel.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 8de74794..add31c92 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -111,6 +111,7 @@ jobs: ${CONDA_RUN} conda config --add channels conda-forge ${CONDA_RUN} conda config --set channel_priority strict ${CONDA_RUN} conda config --show + ${CONDA_RUN} $CONDA_PREFIX/bin/conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge ${CONDA_INSTALL} --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge From 899c915e39c997f1eee104880c8b9295a68417d0 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 07:20:26 -0700 Subject: [PATCH 46/83] . --- .github/workflows/linux_cuda_wheel.yaml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index add31c92..a26e3c16 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -105,16 +105,17 @@ jobs: # side-effect. It's OK. source packaging/helpers.sh assert_ffmpeg_not_installed - - ${CONDA_RUN} conda install --yes conda - ${CONDA_RUN} conda update --all --yes - ${CONDA_RUN} conda config --add channels conda-forge - ${CONDA_RUN} conda config --set channel_priority strict - ${CONDA_RUN} conda config --show - ${CONDA_RUN} $CONDA_PREFIX/bin/conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge - ${CONDA_INSTALL} --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge + # ${CONDA_RUN} conda install --yes conda + # ${CONDA_RUN} conda update --all --yes + # ${CONDA_RUN} conda config --add channels conda-forge + # ${CONDA_RUN} conda config --set channel_priority strict + # ${CONDA_RUN} conda config --show + # ${CONDA_RUN} $CONDA_PREFIX/bin/conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge + # ${CONDA_INSTALL} --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge + # ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge + - name: Install cuda runtime dependencies run: | ${CONDA_RUN} conda install --yes nvidia::libnpp nvidia::cuda-nvrtc=12.4 nvidia::cuda-toolkit=12.4 nvidia::cuda-cudart=12.4 nvidia::cuda-driver-dev=12.4 @@ -143,7 +144,7 @@ jobs: find $CONDA_PREFIX -name libtorchcodec\*.so | xargs ldd find $CONDA_PREFIX -name libcuda\*.so\* echo $CONDA_PREFIX - python test/decoders/manual_smoke_test.py + ${CONDA_RUN} python test/decoders/manual_smoke_test.py - name: Run Python tests run: | - pytest test -vvv + ${CONDA_RUN} pytest test -vvv From 68793fc0b36bfb8b59eac2336bf0c1655700ad00 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 07:55:22 -0700 Subject: [PATCH 47/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index a26e3c16..63e1f197 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -53,7 +53,7 @@ jobs: package-name: torchcodec trigger-event: ${{ github.event_name }} build-platform: "python-build-package" - build-command: "BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 ENABLE_CUDA=1 python -m build --wheel -vvv --no-isolation" + build-command: "BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 ENABLE_CUDA=1 LDFLAGS=\"-Wl,--allow-shlib-undefined -Wl,-rpath,$CONDA_PREFIX/lib -Wl,-rpath-link,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib\" python -m build --wheel -vvv --no-isolation" install-and-test: runs-on: linux.4xlarge.nvidia.gpu From f1cf7c3ccf0f505862730651ec16151bc42f58c4 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 08:02:36 -0700 Subject: [PATCH 48/83] . --- .github/workflows/linux_cuda_wheel.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 63e1f197..dc09fb9a 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -142,6 +142,7 @@ jobs: - name: Smoke test run: | find $CONDA_PREFIX -name libtorchcodec\*.so | xargs ldd + find $CONDA_PREFIX -name libtorchcodec\*.so | xargs readelf -d find $CONDA_PREFIX -name libcuda\*.so\* echo $CONDA_PREFIX ${CONDA_RUN} python test/decoders/manual_smoke_test.py From ecb5cb91a738fcd7a36e8ee86b9e5e4d0178df8c Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 08:09:58 -0700 Subject: [PATCH 49/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index dc09fb9a..8b5af0dd 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -53,7 +53,7 @@ jobs: package-name: torchcodec trigger-event: ${{ github.event_name }} build-platform: "python-build-package" - build-command: "BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 ENABLE_CUDA=1 LDFLAGS=\"-Wl,--allow-shlib-undefined -Wl,-rpath,$CONDA_PREFIX/lib -Wl,-rpath-link,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib\" python -m build --wheel -vvv --no-isolation" + 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.4xlarge.nvidia.gpu From 8886a0f0cb362580f29c792694458fb5f9366636 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 08:40:41 -0700 Subject: [PATCH 50/83] . --- src/torchcodec/decoders/_core/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/torchcodec/decoders/_core/CMakeLists.txt b/src/torchcodec/decoders/_core/CMakeLists.txt index 21129bc9..c97ffcb5 100644 --- a/src/torchcodec/decoders/_core/CMakeLists.txt +++ b/src/torchcodec/decoders/_core/CMakeLists.txt @@ -37,7 +37,7 @@ function(make_torchcodec_library library_name ffmpeg_target) set(NEEDED_LIBRARIES ${ffmpeg_target} ${TORCH_LIBRARIES} ${Python3_LIBRARIES}) if(ENABLE_CUDA) - list(APPEND NEEDED_LIBRARIES ${CUDA_CUDA_LIBRARY} + list(APPEND NEEDED_LIBRARIES ${CUDA_nppi_LIBRARY} ${CUDA_nppicc_LIBRARY} ) endif() target_link_libraries( From d2d84675007977b4c6160ba4936a81e95826647d Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 09:02:12 -0700 Subject: [PATCH 51/83] . --- .github/workflows/linux_cuda_wheel.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 8b5af0dd..27cdacfe 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -89,6 +89,7 @@ jobs: - name: Install PyTorch run: | ${CONDA_RUN} python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} + ${CONDA_RUN} python -c 'import torch; print(f"{torch.cuda.is_available()=}")' - name: Install torchcodec from the wheel run: | wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"` From 75e9edcb5cf4c809ce9a8c9c73cc7552b3eb9112 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 09:55:48 -0700 Subject: [PATCH 52/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 27cdacfe..bda0d788 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -89,7 +89,7 @@ jobs: - name: Install PyTorch run: | ${CONDA_RUN} python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} - ${CONDA_RUN} python -c 'import torch; print(f"{torch.cuda.is_available()=}")' + ${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.cuda.is_available()=}")' - name: Install torchcodec from the wheel run: | wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"` From a4b85d4a9e7d07d26bf1acc08e09469408fcb1eb Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 09:56:42 -0700 Subject: [PATCH 53/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index bda0d788..9bca7397 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -89,7 +89,7 @@ jobs: - name: Install PyTorch run: | ${CONDA_RUN} python -m pip install --pre torch --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.cuda.is_available()=}")' + ${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 "*.whl"` From 483d147bcef3b514045733182628f8310654fa4b Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 10:18:24 -0700 Subject: [PATCH 54/83] . --- .github/workflows/linux_cuda_wheel.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 9bca7397..51a9262b 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -77,9 +77,10 @@ jobs: name: 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: ahmadsharif1/test-infra/.github/actions/setup-miniconda@14bc3c2 with: python-version: "3.9" + default-packages: "" - name: Check env run: | ${CONDA_RUN} env @@ -88,7 +89,8 @@ jobs: run: ${CONDA_RUN} python -m pip install --upgrade pip - name: Install PyTorch run: | - ${CONDA_RUN} python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} + # ${CONDA_RUN} python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} + ${CONDA_RUN} python -m pip install torch torchvision torchaudio ${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: | @@ -106,7 +108,7 @@ jobs: # side-effect. It's OK. source packaging/helpers.sh assert_ffmpeg_not_installed - ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge + ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge -vvv # ${CONDA_RUN} conda install --yes conda # ${CONDA_RUN} conda update --all --yes From 1f5ed251b2cfe227774b4c23ed8116d024711272 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 10:33:07 -0700 Subject: [PATCH 55/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 51a9262b..10f1c7f2 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -77,7 +77,7 @@ jobs: name: pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64 path: pytorch/torchcodec/dist/ - name: Setup miniconda using test-infra - uses: ahmadsharif1/test-infra/.github/actions/setup-miniconda@14bc3c2 + uses: ahmadsharif1/test-infra/.github/actions/setup-miniconda@14bc3c29f88d13b0237ab4ddf00aa409e45ade40 with: python-version: "3.9" default-packages: "" From 738cdf3e716ff6b97c9cbed6262d3580076ad57e Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 10:56:38 -0700 Subject: [PATCH 56/83] . --- .github/workflows/linux_cuda_wheel.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 10f1c7f2..0b26cbed 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -60,9 +60,9 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.9'] + python-version: ['3.10', '3.11', '3.12'] cuda-version: ['12.4'] - ffmpeg-version-for-tests: ['5', '6', '7'] + ffmpeg-version-for-tests: ['6'] container: image: "pytorch/manylinux-builder:cuda${{ matrix.cuda-version }}" if: ${{ always() }} From 399c3072c0488b5e3a7f526f160c54cf7215249b Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 11:21:33 -0700 Subject: [PATCH 57/83] . --- .github/workflows/linux_cuda_wheel.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 0b26cbed..b41266a9 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -35,6 +35,7 @@ jobs: with-xpu: disable with-rocm: disable with-cuda: enable + build-python-only: "disable" build: needs: generate-matrix strategy: @@ -60,7 +61,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12'] cuda-version: ['12.4'] ffmpeg-version-for-tests: ['6'] container: @@ -108,7 +109,7 @@ jobs: # side-effect. It's OK. source packaging/helpers.sh assert_ffmpeg_not_installed - ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge -vvv + ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -vv # ${CONDA_RUN} conda install --yes conda # ${CONDA_RUN} conda update --all --yes From 425336bf8fd64388400aab728c2b6b06753ab359 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 11:39:48 -0700 Subject: [PATCH 58/83] . --- .github/workflows/linux_cuda_wheel.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index b41266a9..77c42d85 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -81,7 +81,7 @@ jobs: uses: ahmadsharif1/test-infra/.github/actions/setup-miniconda@14bc3c29f88d13b0237ab4ddf00aa409e45ade40 with: python-version: "3.9" - default-packages: "" + default-packages: "ffmpeg=conda-forge::${{ matrix.ffmpeg-version-for-tests }}" - name: Check env run: | ${CONDA_RUN} env @@ -101,16 +101,17 @@ jobs: - name: Check out repo uses: actions/checkout@v3 - - name: Install ffmpeg, post build + - name: Build & install ffmpeg after installing torchcodec run: | # Ideally we would have checked for that before installing the wheel, # but we need to checkout the repo to access this file, and we don't # want to checkout the repo before installing the wheel to avoid any # side-effect. It's OK. - source packaging/helpers.sh - assert_ffmpeg_not_installed - ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -vv + # source packaging/helpers.sh + # assert_ffmpeg_not_installed + # It seems like conda can't install ffmpeg cleanly in many cases. So we just build it from source. + # ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -vv -c conda-forge # ${CONDA_RUN} conda install --yes conda # ${CONDA_RUN} conda update --all --yes # ${CONDA_RUN} conda config --add channels conda-forge From b4f526238a5b99110b73d96c65e0aa6a2360ea5c Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 12:07:35 -0700 Subject: [PATCH 59/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 77c42d85..c2c03efe 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -81,7 +81,7 @@ jobs: uses: ahmadsharif1/test-infra/.github/actions/setup-miniconda@14bc3c29f88d13b0237ab4ddf00aa409e45ade40 with: python-version: "3.9" - default-packages: "ffmpeg=conda-forge::${{ matrix.ffmpeg-version-for-tests }}" + default-packages: "conda-forge::ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" - name: Check env run: | ${CONDA_RUN} env From 4fad5c26f573daf22fc7843e69b9f7a5ea041e63 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 12:26:28 -0700 Subject: [PATCH 60/83] . --- .github/workflows/linux_cuda_wheel.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index c2c03efe..e6572463 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -75,7 +75,9 @@ jobs: echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV - uses: actions/download-artifact@v3 with: - name: pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64 + # This was originally: + # name: pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64 + name: pytorch_torchcodec__3.9_cu${{ env.cuda_version_without_periods }}_x86_64 path: pytorch/torchcodec/dist/ - name: Setup miniconda using test-infra uses: ahmadsharif1/test-infra/.github/actions/setup-miniconda@14bc3c29f88d13b0237ab4ddf00aa409e45ade40 @@ -90,8 +92,8 @@ jobs: run: ${CONDA_RUN} python -m pip install --upgrade pip - name: Install PyTorch run: | - # ${CONDA_RUN} python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} - ${CONDA_RUN} python -m pip install torch torchvision torchaudio + ${CONDA_RUN} python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} + # ${CONDA_RUN} python -m pip install torch torchvision torchaudio ${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: | From c92d64c4bb19b9c64e86a85ceeb33aae4b40c507 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 12:42:20 -0700 Subject: [PATCH 61/83] . --- .github/workflows/linux_cuda_wheel.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index e6572463..204756c0 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -88,6 +88,7 @@ jobs: run: | ${CONDA_RUN} env ${CONDA_RUN} conda info + ${CONDA_RUN} nvidia-smi - name: Update pip run: ${CONDA_RUN} python -m pip install --upgrade pip - name: Install PyTorch From 7730c4b5de4050dacdc7f36cdceae960d38a5603 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 13:59:57 -0700 Subject: [PATCH 62/83] . --- .github/workflows/linux_cuda_wheel.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 204756c0..02b96770 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -66,6 +66,7 @@ jobs: ffmpeg-version-for-tests: ['6'] container: image: "pytorch/manylinux-builder:cuda${{ matrix.cuda-version }}" + options: "--gpus all" if: ${{ always() }} needs: build steps: From 796e637a4666f4d363c06f729ff6722eb7db082e Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 16:39:52 -0700 Subject: [PATCH 63/83] . --- .github/workflows/linux_cuda_wheel.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 02b96770..03ed47dc 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -150,10 +150,12 @@ jobs: ls - name: Smoke test run: | - find $CONDA_PREFIX -name libtorchcodec\*.so | xargs ldd - find $CONDA_PREFIX -name libtorchcodec\*.so | xargs readelf -d - find $CONDA_PREFIX -name libcuda\*.so\* - echo $CONDA_PREFIX + ${CONDA_RUN} find $CONDA_PREFIX -name av\*.so | xargs ldd + ${CONDA_RUN} find $CONDA_PREFIX -name av\*.so | readelf -d + ${CONDA_RUN} find $CONDA_PREFIX -name libtorchcodec\*.so | xargs ldd + ${CONDA_RUN} find $CONDA_PREFIX -name libtorchcodec\*.so | xargs readelf -d + ${CONDA_RUN} find $CONDA_PREFIX -name libcuda\*.so\* + ${CONDA_RUN} echo $CONDA_PREFIX ${CONDA_RUN} python test/decoders/manual_smoke_test.py - name: Run Python tests run: | From 52f49dd2b0c54dfb24ff0bfe4522114026daa322 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 16:46:57 -0700 Subject: [PATCH 64/83] . --- .github/workflows/linux_cuda_wheel.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 03ed47dc..fa28d6c6 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -150,8 +150,8 @@ jobs: ls - name: Smoke test run: | - ${CONDA_RUN} find $CONDA_PREFIX -name av\*.so | xargs ldd - ${CONDA_RUN} find $CONDA_PREFIX -name av\*.so | readelf -d + ${CONDA_RUN} find $CONDA_PREFIX -name libav\*.so | xargs ldd + ${CONDA_RUN} find $CONDA_PREFIX -name libav\*.so | readelf -d ${CONDA_RUN} find $CONDA_PREFIX -name libtorchcodec\*.so | xargs ldd ${CONDA_RUN} find $CONDA_PREFIX -name libtorchcodec\*.so | xargs readelf -d ${CONDA_RUN} find $CONDA_PREFIX -name libcuda\*.so\* From 768641acc37c18ce7de32940b46aaee818f6f9ff Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 16:48:46 -0700 Subject: [PATCH 65/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index fa28d6c6..cf958f63 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -152,6 +152,8 @@ jobs: run: | ${CONDA_RUN} find $CONDA_PREFIX -name libav\*.so | xargs ldd ${CONDA_RUN} find $CONDA_PREFIX -name libav\*.so | readelf -d + ${CONDA_RUN} find / -name libnvcuvid\* + find / -name libnvcuvid\* ${CONDA_RUN} find $CONDA_PREFIX -name libtorchcodec\*.so | xargs ldd ${CONDA_RUN} find $CONDA_PREFIX -name libtorchcodec\*.so | xargs readelf -d ${CONDA_RUN} find $CONDA_PREFIX -name libcuda\*.so\* From d9ae6d0ea17bb58927adc9774577510513f36915 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Mon, 21 Oct 2024 17:54:30 -0700 Subject: [PATCH 66/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index cf958f63..c8a2ad57 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -151,7 +151,7 @@ jobs: - name: Smoke test run: | ${CONDA_RUN} find $CONDA_PREFIX -name libav\*.so | xargs ldd - ${CONDA_RUN} find $CONDA_PREFIX -name libav\*.so | readelf -d + ${CONDA_RUN} find $CONDA_PREFIX -name libav\*.so | xargs readelf -d ${CONDA_RUN} find / -name libnvcuvid\* find / -name libnvcuvid\* ${CONDA_RUN} find $CONDA_PREFIX -name libtorchcodec\*.so | xargs ldd From abe3ed0f24426776c2fd94c1e5b6106ffe4de4c2 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Tue, 22 Oct 2024 10:59:43 -0700 Subject: [PATCH 67/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index c8a2ad57..8eebd6b7 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -66,7 +66,7 @@ jobs: ffmpeg-version-for-tests: ['6'] container: image: "pytorch/manylinux-builder:cuda${{ matrix.cuda-version }}" - options: "--gpus all" + options: "--gpus all,capabilities=all" if: ${{ always() }} needs: build steps: From fb619baa30affb2ca68180a9c800237a2751aec0 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Tue, 22 Oct 2024 11:16:49 -0700 Subject: [PATCH 68/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 8eebd6b7..cd47b0ce 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -66,7 +66,7 @@ jobs: ffmpeg-version-for-tests: ['6'] container: image: "pytorch/manylinux-builder:cuda${{ matrix.cuda-version }}" - options: "--gpus all,capabilities=all" + options: "--gpus all,capabilities=utility,compute,video" if: ${{ always() }} needs: build steps: From 6097f328ae88214f5a5cc417786329b0e6e8cee6 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Tue, 22 Oct 2024 11:18:30 -0700 Subject: [PATCH 69/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index cd47b0ce..16100eb1 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -66,7 +66,7 @@ jobs: ffmpeg-version-for-tests: ['6'] container: image: "pytorch/manylinux-builder:cuda${{ matrix.cuda-version }}" - options: "--gpus all,capabilities=utility,compute,video" + options: "--gpus all,\"capabilities=all\"" if: ${{ always() }} needs: build steps: From 6add20f07f59d50cc2cade31a3e8204e09da5f98 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Tue, 22 Oct 2024 12:26:19 -0700 Subject: [PATCH 70/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 16100eb1..ac8de934 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -66,7 +66,7 @@ jobs: ffmpeg-version-for-tests: ['6'] container: image: "pytorch/manylinux-builder:cuda${{ matrix.cuda-version }}" - options: "--gpus all,\"capabilities=all\"" + options: "--gpus all,\"capabilities=video\"" if: ${{ always() }} needs: build steps: From f6e61879505231313a6e46b676d7085224515b6d Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Tue, 22 Oct 2024 12:40:43 -0700 Subject: [PATCH 71/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index ac8de934..bb903d73 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -66,7 +66,7 @@ jobs: ffmpeg-version-for-tests: ['6'] container: image: "pytorch/manylinux-builder:cuda${{ matrix.cuda-version }}" - options: "--gpus all,\"capabilities=video\"" + options: "--gpus all -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility" if: ${{ always() }} needs: build steps: From 3456b1a5e12bde363cfbddbbdf873528236d08d3 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Tue, 22 Oct 2024 13:43:24 -0700 Subject: [PATCH 72/83] . --- .github/workflows/linux_cuda_wheel.yaml | 34 +++---------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index bb903d73..45ab0e1e 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -63,7 +63,7 @@ jobs: matrix: python-version: ['3.9', '3.10', '3.11', '3.12'] cuda-version: ['12.4'] - ffmpeg-version-for-tests: ['6'] + ffmpeg-version-for-tests: ['5', '6', '7'] container: image: "pytorch/manylinux-builder:cuda${{ matrix.cuda-version }}" options: "--gpus all -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility" @@ -76,8 +76,8 @@ jobs: echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV - uses: actions/download-artifact@v3 with: - # This was originally: - # name: pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64 + # We use 3.9 because it's the minimum version we build. + # We test version 3.9 against all other python versions in the matrix. name: pytorch_torchcodec__3.9_cu${{ env.cuda_version_without_periods }}_x86_64 path: pytorch/torchcodec/dist/ - name: Setup miniconda using test-infra @@ -95,7 +95,6 @@ jobs: - name: Install PyTorch run: | ${CONDA_RUN} python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} - # ${CONDA_RUN} python -m pip install torch torchvision torchaudio ${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: | @@ -105,25 +104,6 @@ jobs: - name: Check out repo uses: actions/checkout@v3 - - name: Build & install ffmpeg after installing torchcodec - run: | - # Ideally we would have checked for that before installing the wheel, - # but we need to checkout the repo to access this file, and we don't - # want to checkout the repo before installing the wheel to avoid any - # side-effect. It's OK. - # source packaging/helpers.sh - # assert_ffmpeg_not_installed - # It seems like conda can't install ffmpeg cleanly in many cases. So we just build it from source. - - # ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -vv -c conda-forge - # ${CONDA_RUN} conda install --yes conda - # ${CONDA_RUN} conda update --all --yes - # ${CONDA_RUN} conda config --add channels conda-forge - # ${CONDA_RUN} conda config --set channel_priority strict - # ${CONDA_RUN} conda config --show - # ${CONDA_RUN} $CONDA_PREFIX/bin/conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge - # ${CONDA_INSTALL} --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge - # ${CONDA_RUN} conda install --yes ffmpeg=${{ matrix.ffmpeg-version-for-tests }} -c conda-forge - name: Install cuda runtime dependencies run: | @@ -150,14 +130,6 @@ jobs: ls - name: Smoke test run: | - ${CONDA_RUN} find $CONDA_PREFIX -name libav\*.so | xargs ldd - ${CONDA_RUN} find $CONDA_PREFIX -name libav\*.so | xargs readelf -d - ${CONDA_RUN} find / -name libnvcuvid\* - find / -name libnvcuvid\* - ${CONDA_RUN} find $CONDA_PREFIX -name libtorchcodec\*.so | xargs ldd - ${CONDA_RUN} find $CONDA_PREFIX -name libtorchcodec\*.so | xargs readelf -d - ${CONDA_RUN} find $CONDA_PREFIX -name libcuda\*.so\* - ${CONDA_RUN} echo $CONDA_PREFIX ${CONDA_RUN} python test/decoders/manual_smoke_test.py - name: Run Python tests run: | From fad4e2b53706cfc4fa8639d2d1d45f7c9b96e368 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Tue, 22 Oct 2024 13:44:15 -0700 Subject: [PATCH 73/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 45ab0e1e..56c7e2e3 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -83,7 +83,7 @@ jobs: - name: Setup miniconda using test-infra uses: ahmadsharif1/test-infra/.github/actions/setup-miniconda@14bc3c29f88d13b0237ab4ddf00aa409e45ade40 with: - python-version: "3.9" + python-version: ${{ matrix.python-version }} default-packages: "conda-forge::ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" - name: Check env run: | From e6e74d1a1337349780fe27d86c73c6b4d7336bb3 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Tue, 22 Oct 2024 13:46:05 -0700 Subject: [PATCH 74/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- test/utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 56c7e2e3..f4327a64 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -133,4 +133,4 @@ jobs: ${CONDA_RUN} python test/decoders/manual_smoke_test.py - name: Run Python tests run: | - ${CONDA_RUN} pytest test -vvv + ${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest test -vvv diff --git a/test/utils.py b/test/utils.py index 99f53d33..a32ede2b 100644 --- a/test/utils.py +++ b/test/utils.py @@ -15,6 +15,8 @@ # Decorator for skipping CUDA tests when CUDA isn't available def needs_cuda(test_item): if not torch.cuda.is_available(): + if os.environ.get("FAIL_WITHOUT_CUDA") == "1": + raise RuntimeError("CUDA is required for this test") return pytest.mark.skip(reason="CUDA not available")(test_item) return test_item From 7fa4d6d39d036b32befcc17e20338d48c76d57f4 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Tue, 22 Oct 2024 14:16:39 -0700 Subject: [PATCH 75/83] . --- .github/workflows/linux_cuda_wheel.yaml | 1 - packaging/linux_cuda_pre_build_script.sh | 5 ----- 2 files changed, 6 deletions(-) delete mode 100644 packaging/linux_cuda_pre_build_script.sh diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index f4327a64..1cdedbd0 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -48,7 +48,6 @@ jobs: test-infra-repository: pytorch/test-infra test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} - pre-script: packaging/linux_cuda_pre_build_script.sh post-script: packaging/post_build_script.sh smoke-test-script: packaging/fake_smoke_test.py package-name: torchcodec diff --git a/packaging/linux_cuda_pre_build_script.sh b/packaging/linux_cuda_pre_build_script.sh deleted file mode 100644 index b4674ffb..00000000 --- a/packaging/linux_cuda_pre_build_script.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -x - -conda info From aae6aafd58aaf3be9a8de48d800e45d472dbf246 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Tue, 22 Oct 2024 15:55:17 -0700 Subject: [PATCH 76/83] . --- .github/workflows/linux_cuda_wheel.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 1cdedbd0..27023d61 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -60,7 +60,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9'] cuda-version: ['12.4'] ffmpeg-version-for-tests: ['5', '6', '7'] container: @@ -133,3 +133,4 @@ jobs: - name: Run Python tests run: | ${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest test -vvv + ${CONDA_RUN} python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none From 8e0ef0e7f967e8c26802aa167a1692813986d2e0 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 23 Oct 2024 09:13:17 -0700 Subject: [PATCH 77/83] . --- .github/workflows/linux_cuda_wheel.yaml | 9 ++++++--- src/torchcodec/decoders/_core/CMakeLists.txt | 18 +++++++----------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 27023d61..05d9f30d 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -60,6 +60,11 @@ jobs: strategy: fail-fast: false matrix: + # 3.9 corresponds to the minimum python version for which we build + # the wheel unless the label cliflow/binaries/all is present in the + # PR. + # For the actual release we should add that label and change this to + # include more python versions. python-version: ['3.9'] cuda-version: ['12.4'] ffmpeg-version-for-tests: ['5', '6', '7'] @@ -75,8 +80,6 @@ jobs: echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV - uses: actions/download-artifact@v3 with: - # We use 3.9 because it's the minimum version we build. - # We test version 3.9 against all other python versions in the matrix. name: pytorch_torchcodec__3.9_cu${{ env.cuda_version_without_periods }}_x86_64 path: pytorch/torchcodec/dist/ - name: Setup miniconda using test-infra @@ -133,4 +136,4 @@ jobs: - name: Run Python tests run: | ${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest test -vvv - ${CONDA_RUN} python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none + ${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none diff --git a/src/torchcodec/decoders/_core/CMakeLists.txt b/src/torchcodec/decoders/_core/CMakeLists.txt index c97ffcb5..22bcd654 100644 --- a/src/torchcodec/decoders/_core/CMakeLists.txt +++ b/src/torchcodec/decoders/_core/CMakeLists.txt @@ -77,17 +77,13 @@ if(DEFINED ENV{BUILD_AGAINST_ALL_FFMPEG_FROM_S3}) ) - if(ENABLE_CUDA) - # TODO: Enable more ffmpeg versions for cuda. - make_torchcodec_library(libtorchcodec7 ffmpeg7) - make_torchcodec_library(libtorchcodec6 ffmpeg6) - make_torchcodec_library(libtorchcodec5 ffmpeg5) - else() - make_torchcodec_library(libtorchcodec7 ffmpeg7) - make_torchcodec_library(libtorchcodec6 ffmpeg6) - make_torchcodec_library(libtorchcodec5 ffmpeg5) - make_torchcodec_library(libtorchcodec4 ffmpeg4) - endif() + if(NOT ENABLE_CUDA) + # TODO: Enable more ffmpeg versions for cuda. + make_torchcodec_library(libtorchcodec4 ffmpeg4) + endif() + make_torchcodec_library(libtorchcodec7 ffmpeg7) + make_torchcodec_library(libtorchcodec6 ffmpeg6) + make_torchcodec_library(libtorchcodec5 ffmpeg5) else() message( From 164882c02798f5fc11f03e63568445669faeaaad Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 23 Oct 2024 09:13:54 -0700 Subject: [PATCH 78/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 05d9f30d..2b810fc6 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -66,7 +66,7 @@ jobs: # For the actual release we should add that label and change this to # include more python versions. python-version: ['3.9'] - cuda-version: ['12.4'] + cuda-version: ['11.8', '12.1', '12.4'] ffmpeg-version-for-tests: ['5', '6', '7'] container: image: "pytorch/manylinux-builder:cuda${{ matrix.cuda-version }}" From 878153d5fc9a7cf269875ba80e5dfae8cfae81ea Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 23 Oct 2024 09:38:38 -0700 Subject: [PATCH 79/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 2b810fc6..956126dd 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -109,7 +109,7 @@ jobs: - name: Install cuda runtime dependencies run: | - ${CONDA_RUN} conda install --yes nvidia::libnpp nvidia::cuda-nvrtc=12.4 nvidia::cuda-toolkit=12.4 nvidia::cuda-cudart=12.4 nvidia::cuda-driver-dev=12.4 + ${CONDA_RUN} conda install --yes nvidia::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 }} - name: Install test dependencies run: | ${CONDA_RUN} python -m pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cpu From e123c65af48a14bf61ffc54f18f77d1874d63b4d Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 23 Oct 2024 09:40:20 -0700 Subject: [PATCH 80/83] . --- .github/workflows/linux_cuda_wheel.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 956126dd..b98f4a89 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -135,5 +135,6 @@ jobs: ${CONDA_RUN} python test/decoders/manual_smoke_test.py - name: Run Python tests run: | - ${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest test -vvv + # We skip test_get_ffmpeg_version because it may not have a micro version. + ${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest test -k "not test_get_ffmpeg_version" -vvv ${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none From 370f3ee005864b2c95268126ae31897dcc68cf35 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 23 Oct 2024 10:19:25 -0700 Subject: [PATCH 81/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index b98f4a89..6693de4f 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -109,7 +109,7 @@ jobs: - name: Install cuda runtime dependencies run: | - ${CONDA_RUN} conda install --yes nvidia::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_RUN} conda install --yes nvidia::libnpp=${{ matrix.cuda-version }} 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 }} - name: Install test dependencies run: | ${CONDA_RUN} python -m pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cpu From 250c3a8d8a310cb68d3b2d4408d43eeaacfbd264 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 23 Oct 2024 10:52:07 -0700 Subject: [PATCH 82/83] . --- .github/workflows/linux_cuda_wheel.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 6693de4f..239eee52 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -109,7 +109,9 @@ jobs: - name: Install cuda runtime dependencies run: | - ${CONDA_RUN} conda install --yes nvidia::libnpp=${{ matrix.cuda-version }} 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 }} + # For some reason nvidia::libnpp=12.4 doesn't install but nvidia/label/cuda-12.4.0::libnpp does. + # So we use the latter convention for libnpp. + ${CONDA_RUN} conda install --yes 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 }} - name: Install test dependencies run: | ${CONDA_RUN} python -m pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cpu From 3a51218adcc8bf4cf4a41a79a16d8e633cf6fb21 Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Wed, 23 Oct 2024 11:10:55 -0700 Subject: [PATCH 83/83] . --- .github/workflows/linux_cuda_wheel.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 239eee52..acc036cb 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -139,4 +139,6 @@ jobs: run: | # We skip test_get_ffmpeg_version because it may not have a micro version. ${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest test -k "not test_get_ffmpeg_version" -vvv + - name: Run Python benchmark + run: | ${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none