From 686a17932a5f98e55d0213b87c2147241edfe8cd Mon Sep 17 00:00:00 2001 From: Sam Anklesaria Date: Tue, 9 Sep 2025 02:50:18 +0000 Subject: [PATCH 01/21] Use CI workflow based on torchcodec docs yml file --- .github/workflows/unittest-linux-cpu.yml | 132 ++++++++++++----------- 1 file changed, 69 insertions(+), 63 deletions(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index f34fb4c255..eef5ba64f1 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -1,71 +1,77 @@ name: Unit-tests on Linux CPU on: - pull_request: - push: - branches: - - nightly - - main - - release/* - workflow_dispatch: - + pull_request: + push: + branches: + - nightly + - main + - release/* + workflow_dispatch: jobs: - tests: - strategy: - matrix: - # TODO all from 3.9 to 3.13 - python_version: ["3.11"] - fail-fast: false - uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main - permissions: - id-token: write - contents: read - with: - runner: linux.12xlarge - repository: pytorch/audio - timeout: 120 - script: | - echo '::group::Setup Environment Variables' - # Mark Build Directory Safe - git config --global --add safe.directory /__w/audio/audio - - # Set up Environment Variables - export PYTHON_VERSION="${{ matrix.python_version }}" - export PIP_PROGRESS_BAR=off - export CONDA_QUIET=1 - export CUDA_TESTS_ONLY="0" - unset CUDA_VERSION - - # Set CHANNEL - if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then - export UPLOAD_CHANNEL=test - else - export UPLOAD_CHANNEL=nightly - fi + build: + strategy: + matrix: + # TODO add up to 3.13 + python_version: ["3.10"] + fail-fast: false + uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main + permissions: + id-token: write + contents: read + with: + repository: pytorch/audio + timeout: 120 + job-name: test + script: | + set -ex + # Set up Environment Variables + export PYTHON_VERSION="${{ matrix.python_version }}" + export PIP_PROGRESS_BAR=off + export CONDA_QUIET=1 - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_APPLY_CMVN_SLIDING=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_FBANK_FEATS=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_KALDI_PITCH_FEATS=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_MFCC_FEATS=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_SPECTROGRAM_FEATS=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_KALDI=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CUDA=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_HW_ACCEL=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_ON_PYTHON_310=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_AUDIO_OUT_DEVICE=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MACOS=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_TEMPORARY_DISABLED=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_DECODER=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_ENCODER=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_FFMPEG=true - echo '::endgroup::' + # Set UPLOAD_CHANNEL + if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then + export UPLOAD_CHANNEL=test + else + export UPLOAD_CHANNEL=nightly + fi - set -euxo pipefail + echo "::group::Create conda env" + # Mark Build Directory Safe + git config --global --add safe.directory /__w/audio/audio + conda create -c conda-forge --strict-channel-priority -y --prefix ci_env python="${PYTHON_VERSION}" "ffmpeg=7" cmake ninja + conda activate ./ci_env + conda info - echo '::group::Install PyTorch and Torchaudio' - ./.github/scripts/unittest-linux/install.sh - echo '::endgroup::' + python -m pip install --upgrade pip - echo '::group::Run Tests' - ./.github/scripts/unittest-linux/run_test.sh - echo '::endgroup::' + echo "::endgroup::" + echo "::group::Install PyTorch and TorchCodec" + PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu" + python -m pip install --progress-bar=off --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" + python -m pip install parameterized requests coverage pytest pytest-cov scipy numpy expecttest + python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")' + echo "::endgroup::" + echo "::group::Build and install TorchAudio" + python -m pip install . -v --no-build-isolation + echo "::endgroup::" + echo "::group::Run Tests" + cd test + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_APPLY_CMVN_SLIDING=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_FBANK_FEATS=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_KALDI_PITCH_FEATS=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_MFCC_FEATS=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_SPECTROGRAM_FEATS=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_KALDI=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CUDA=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_HW_ACCEL=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_ON_PYTHON_310=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_AUDIO_OUT_DEVICE=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MACOS=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_TEMPORARY_DISABLED=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_DECODER=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_ENCODER=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_FFMPEG=true + pytest torchaudio_unittest -k "not torchscript and not fairseq and not demucs" + echo "::endgroup::" From 4ca1da388589b047c848f3466925f91f4e5e9f18 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 19:42:27 +0300 Subject: [PATCH 02/21] Copy and adjust docs workflow for linux CPU tests workflow --- .github/workflows/unittest-linux-cpu.yml | 131 ++++++++++++----------- 1 file changed, 69 insertions(+), 62 deletions(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index eef5ba64f1..a01ed1fff3 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -8,70 +8,77 @@ on: - main - release/* workflow_dispatch: + jobs: - build: - strategy: - matrix: - # TODO add up to 3.13 - python_version: ["3.10"] - fail-fast: false - uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main - permissions: - id-token: write - contents: read - with: - repository: pytorch/audio - timeout: 120 - job-name: test - script: | - set -ex - # Set up Environment Variables - export PYTHON_VERSION="${{ matrix.python_version }}" - export PIP_PROGRESS_BAR=off - export CONDA_QUIET=1 + build: + strategy: + matrix: + python-version: ["3.11"] + ffmpeg-version: ["7"] + fail-fast: false + uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main + permissions: + id-token: write + contents: read + with: + runner: linux.4xlarge.nvidia.gpu + repository: pytorch/audio + gpu-arch-type: cpu + gpu-arch-version: + timeout: 120 + job-name: test + + script: | + set -ex + # Set up Environment Variables + export PYTHON_VERSION="${{ matrix.python-version }}" + export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}" + export PIP_PROGRESS_BAR=off + export CONDA_QUIET=1 + + # Set UPLOAD_CHANNEL + if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then + export UPLOAD_CHANNEL=test + else + export UPLOAD_CHANNEL=nightly + fi - # Set UPLOAD_CHANNEL - if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then - export UPLOAD_CHANNEL=test - else - export UPLOAD_CHANNEL=nightly - fi + echo "::group::Create conda env" + # Mark Build Directory Safe + git config --global --add safe.directory /__w/audio/audio + conda create -c conda-forge --strict-channel-priority -y --prefix ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" cmake ninja + conda activate ./ci_env + conda info + python -m pip install --upgrade pip + echo "::endgroup::" - echo "::group::Create conda env" - # Mark Build Directory Safe - git config --global --add safe.directory /__w/audio/audio - conda create -c conda-forge --strict-channel-priority -y --prefix ci_env python="${PYTHON_VERSION}" "ffmpeg=7" cmake ninja - conda activate ./ci_env - conda info + echo "::group::Install PyTorch and TorchCodec" + PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu" + python -m pip install numpy + python -m pip install --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" + python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")")' + echo "::endgroup::" - python -m pip install --upgrade pip + echo "::group::Build and install TorchAudio" + python -m pip install . -v --no-build-isolation + echo "::endgroup::" - echo "::endgroup::" - echo "::group::Install PyTorch and TorchCodec" - PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu" - python -m pip install --progress-bar=off --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" - python -m pip install parameterized requests coverage pytest pytest-cov scipy numpy expecttest - python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")' - echo "::endgroup::" - echo "::group::Build and install TorchAudio" - python -m pip install . -v --no-build-isolation - echo "::endgroup::" - echo "::group::Run Tests" - cd test - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_APPLY_CMVN_SLIDING=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_FBANK_FEATS=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_KALDI_PITCH_FEATS=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_MFCC_FEATS=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_SPECTROGRAM_FEATS=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_KALDI=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CUDA=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_HW_ACCEL=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_ON_PYTHON_310=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_AUDIO_OUT_DEVICE=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MACOS=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_TEMPORARY_DISABLED=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_DECODER=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_ENCODER=true - export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_FFMPEG=true - pytest torchaudio_unittest -k "not torchscript and not fairseq and not demucs" - echo "::endgroup::" + echo "::group::Run TorchAudio tests" + cd test + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_APPLY_CMVN_SLIDING=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_FBANK_FEATS=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_KALDI_PITCH_FEATS=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_MFCC_FEATS=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_SPECTROGRAM_FEATS=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_KALDI=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CUDA=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_HW_ACCEL=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_ON_PYTHON_310=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_AUDIO_OUT_DEVICE=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MACOS=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_TEMPORARY_DISABLED=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_DECODER=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_ENCODER=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_FFMPEG=true + pytest torchaudio_unittest -k "not torchscript and not fairseq and not demucs" + echo "::endgroup::" From d28db3e444e45bec5d4ed4fc407f7cfcf0501f34 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 19:47:38 +0300 Subject: [PATCH 03/21] Use runner linux.12xlarge --- .github/workflows/unittest-linux-cpu.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index a01ed1fff3..6ea4844172 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -1,16 +1,16 @@ name: Unit-tests on Linux CPU on: - pull_request: - push: - branches: - - nightly - - main - - release/* - workflow_dispatch: + pull_request: + push: + branches: + - nightly + - main + - release/* + workflow_dispatch: jobs: - build: + tests: strategy: matrix: python-version: ["3.11"] @@ -21,12 +21,12 @@ jobs: id-token: write contents: read with: - runner: linux.4xlarge.nvidia.gpu + runner: linux.12xlarge repository: pytorch/audio gpu-arch-type: cpu gpu-arch-version: timeout: 120 - job-name: test + job-name: linux-cpu script: | set -ex From 8117d7abea5f0d9632288aa15087699eee724d53 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 19:53:09 +0300 Subject: [PATCH 04/21] Fix type. Add ctest. --- .github/workflows/unittest-linux-cpu.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 6ea4844172..4e1d1ac73e 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -56,15 +56,22 @@ jobs: PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu" python -m pip install numpy python -m pip install --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" - python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")")' + python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")' echo "::endgroup::" echo "::group::Build and install TorchAudio" python -m pip install . -v --no-build-isolation echo "::endgroup::" + echo "::group::Run TorchAudio C tests" + (cd build/temp*/test/cpp && ctest) + echo "::endgroup::" + echo "::group::Run TorchAudio tests" - cd test + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CTC_DECODER=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_unidecode=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_inflect=true + export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_MOD_pytorch_lightning=true export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_APPLY_CMVN_SLIDING=true export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_FBANK_FEATS=true export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_KALDI_PITCH_FEATS=true @@ -80,5 +87,5 @@ jobs: export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_DECODER=true export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_ENCODER=true export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_FFMPEG=true - pytest torchaudio_unittest -k "not torchscript and not fairseq and not demucs" + (cd test && pytest torchaudio_unittest -k "not torchscript and not fairseq and not demucs") echo "::endgroup::" From 7cd126c06d616a5fcb7f45cc15e2226ef3ccdfa1 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 20:12:03 +0300 Subject: [PATCH 05/21] export BUILD_CPP_TEST --- .github/workflows/unittest-linux-cpu.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 4e1d1ac73e..d90dc045e1 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -60,11 +60,12 @@ jobs: echo "::endgroup::" echo "::group::Build and install TorchAudio" + export BUILD_CPP_TEST=1 python -m pip install . -v --no-build-isolation echo "::endgroup::" echo "::group::Run TorchAudio C tests" - (cd build/temp*/test/cpp && ctest) + (cd build/temp*/test/cpp && wall_collision) echo "::endgroup::" echo "::group::Run TorchAudio tests" From d27ddd307978bf78b5caaf0825a99fd6841ebe4a Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 20:22:47 +0300 Subject: [PATCH 06/21] Debug c tests --- .github/workflows/unittest-linux-cpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index d90dc045e1..4fb2dff476 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -65,7 +65,7 @@ jobs: echo "::endgroup::" echo "::group::Run TorchAudio C tests" - (cd build/temp*/test/cpp && wall_collision) + (cd build/temp*/test/cpp && ls) echo "::endgroup::" echo "::group::Run TorchAudio tests" From 65c556c7bd340cc058085e116798305ce10618e4 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 20:33:50 +0300 Subject: [PATCH 07/21] Add test dependencies --- .github/workflows/unittest-linux-cpu.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 4fb2dff476..7af6144f73 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -52,9 +52,12 @@ jobs: python -m pip install --upgrade pip echo "::endgroup::" + echo "::group::Install TorchAudio test and PyTorch dependencies" + python -m pip install parameterized requests coverage pytest pytest-cov scipy numpy expecttest + echo "::endgroup::" + echo "::group::Install PyTorch and TorchCodec" PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu" - python -m pip install numpy python -m pip install --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")' echo "::endgroup::" @@ -65,7 +68,7 @@ jobs: echo "::endgroup::" echo "::group::Run TorchAudio C tests" - (cd build/temp*/test/cpp && ls) + (cd build/temp*/test/cpp && ./wall_collision) echo "::endgroup::" echo "::group::Run TorchAudio tests" From dfe683d1c76225002299185bc9adf746a988d95e Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 21:17:12 +0300 Subject: [PATCH 08/21] Use pytest -x --- .github/workflows/unittest-linux-cpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 7af6144f73..64b170dc7f 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -91,5 +91,5 @@ jobs: export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_DECODER=true export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_SOX_ENCODER=true export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_FFMPEG=true - (cd test && pytest torchaudio_unittest -k "not torchscript and not fairseq and not demucs") + pytest test/torchaudio_unittest -k "not torchscript and not fairseq and not demucs" -x echo "::endgroup::" From dfd127af2c9dda05779152cd3ac466ea6ea906ba Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 21:27:51 +0300 Subject: [PATCH 09/21] Pin to torch 2.9 --- .github/workflows/unittest-linux-cpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 64b170dc7f..1abc73b3fc 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -58,7 +58,7 @@ jobs: echo "::group::Install PyTorch and TorchCodec" PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu" - python -m pip install --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" + python -m pip install --pre torch=2.9 torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")' echo "::endgroup::" From 57d570ac12a8f833fb79a9ecd79f70435b3292fa Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 21:34:43 +0300 Subject: [PATCH 10/21] Pin to torch 2.9 --- .github/workflows/unittest-linux-cpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 1abc73b3fc..b1cc237a27 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -58,7 +58,7 @@ jobs: echo "::group::Install PyTorch and TorchCodec" PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu" - python -m pip install --pre torch=2.9 torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" + python -m pip install --pre "torch=2.9" torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")' echo "::endgroup::" From 8c76ca3b941f5f5c2596cea4f49befe8cab8267e Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 21:43:10 +0300 Subject: [PATCH 11/21] Pin to torch 2.9 --- .github/workflows/unittest-linux-cpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index b1cc237a27..052dd5ac13 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -58,7 +58,7 @@ jobs: echo "::group::Install PyTorch and TorchCodec" PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu" - python -m pip install --pre "torch=2.9" torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" + python -m pip install --pre "torch==2.9" torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")' echo "::endgroup::" From cab09e1e69cbad97cfe4d883fd6573e2f6cf40ed Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 21:49:15 +0300 Subject: [PATCH 12/21] Pin to torch 2.9 --- .github/workflows/unittest-linux-cpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 052dd5ac13..ce5fdbf919 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -58,7 +58,7 @@ jobs: echo "::group::Install PyTorch and TorchCodec" PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu" - python -m pip install --pre "torch==2.9" torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" + python -m pip install --pre "torch==2.9.*" torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")' echo "::endgroup::" From 1d170413861c4b5955f170454d952ee340992fa0 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 22:09:36 +0300 Subject: [PATCH 13/21] Check torchcodec version --- .github/workflows/unittest-linux-cpu.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index ce5fdbf919..e4a0d4807b 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -58,8 +58,9 @@ jobs: echo "::group::Install PyTorch and TorchCodec" PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu" - python -m pip install --pre "torch==2.9.*" torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" + python -m pip install --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")' + python -c 'import torchcodec; print(f"{torchcodec.__version__}"); print(f"{torchcodec.__file__}")' echo "::endgroup::" echo "::group::Build and install TorchAudio" From 41376ed23957a370f3357bfa8456f7343edd482c Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 22:22:43 +0300 Subject: [PATCH 14/21] Add pybind11 --- .github/workflows/unittest-linux-cpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index e4a0d4807b..4feeef921c 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -46,7 +46,7 @@ jobs: echo "::group::Create conda env" # Mark Build Directory Safe git config --global --add safe.directory /__w/audio/audio - conda create -c conda-forge --strict-channel-priority -y --prefix ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" cmake ninja + conda create -c conda-forge --strict-channel-priority -y --prefix ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" cmake ninja pybind11 conda activate ./ci_env conda info python -m pip install --upgrade pip From 3c9c2a14422fcd71d7df4352e736410b0e70f9d1 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 22:38:22 +0300 Subject: [PATCH 15/21] Use conda -n --- .github/workflows/unittest-linux-cpu.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 4feeef921c..530e1ce08c 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -46,9 +46,10 @@ jobs: echo "::group::Create conda env" # Mark Build Directory Safe git config --global --add safe.directory /__w/audio/audio - conda create -c conda-forge --strict-channel-priority -y --prefix ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" cmake ninja pybind11 - conda activate ./ci_env + conda create -c conda-forge --strict-channel-priority -y -n ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" cmake ninja + conda activate ci_env conda info + conda list python -m pip install --upgrade pip echo "::endgroup::" From 79d8119139fbe85d81ed2796b94ae06549f4c3bd Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 22:49:48 +0300 Subject: [PATCH 16/21] Use runner linux.g5.4xlarge.nvidia.gpu --- .github/workflows/unittest-linux-cpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 530e1ce08c..155817ab7c 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -21,7 +21,7 @@ jobs: id-token: write contents: read with: - runner: linux.12xlarge + runner: linux.g5.4xlarge.nvidia.gpu repository: pytorch/audio gpu-arch-type: cpu gpu-arch-version: From 9ebf2c21f654676eca78b0c0dd2746396661056e Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 23:35:17 +0300 Subject: [PATCH 17/21] Undo use runner linux.g5.4xlarge.nvidia.gpu --- .github/workflows/unittest-linux-cpu.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 155817ab7c..2e398e9db9 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -21,7 +21,7 @@ jobs: id-token: write contents: read with: - runner: linux.g5.4xlarge.nvidia.gpu + runner: linux.12xlarge repository: pytorch/audio gpu-arch-type: cpu gpu-arch-version: @@ -50,6 +50,7 @@ jobs: conda activate ci_env conda info conda list + ffmpeg -version python -m pip install --upgrade pip echo "::endgroup::" From 125a0ac77101540af59c5e377775ba6ccde55105 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Thu, 11 Sep 2025 00:00:05 +0300 Subject: [PATCH 18/21] debug torchcodec --- .github/workflows/unittest-linux-cpu.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 2e398e9db9..5df270ac98 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -62,6 +62,8 @@ jobs: PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu" python -m pip install --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")' + ls -la /opt/conda/envs/ci_env/lib/python3.11/site-packages/torchcodec/ + ldd /opt/conda/envs/ci_env/lib/python3.11/site-packages/torchcodec/libtorchcodec_core7.so python -c 'import torchcodec; print(f"{torchcodec.__version__}"); print(f"{torchcodec.__file__}")' echo "::endgroup::" From 1a5b0d3943a5fde0a01713f5267236f38b72e4fb Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Thu, 11 Sep 2025 00:14:28 +0300 Subject: [PATCH 19/21] Add LD_LIBRARY_PATH --- .github/workflows/unittest-linux-cpu.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 5df270ac98..71ee1eb0ea 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -52,6 +52,8 @@ jobs: conda list ffmpeg -version python -m pip install --upgrade pip + export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" echo "::endgroup::" echo "::group::Install TorchAudio test and PyTorch dependencies" From 2e29a83d5ec93cc7dd7a589f291bd6c7d9067c3b Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Thu, 11 Sep 2025 00:19:26 +0300 Subject: [PATCH 20/21] Add LD_LIBRARY_PATH --- .github/workflows/unittest-linux-cpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 71ee1eb0ea..1500038da5 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -52,7 +52,7 @@ jobs: conda list ffmpeg -version python -m pip install --upgrade pip - export LD_LIBRARY_PATH=$CONDA_LIBRARY_PATH:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH} echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" echo "::endgroup::" From 84d2a99eaa751a0e20564999533c97d1adecd419 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Thu, 11 Sep 2025 10:07:57 +0300 Subject: [PATCH 21/21] Clean up --- .github/workflows/unittest-linux-cpu.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unittest-linux-cpu.yml b/.github/workflows/unittest-linux-cpu.yml index 1500038da5..ea0ac854fa 100644 --- a/.github/workflows/unittest-linux-cpu.yml +++ b/.github/workflows/unittest-linux-cpu.yml @@ -49,11 +49,11 @@ jobs: conda create -c conda-forge --strict-channel-priority -y -n ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" cmake ninja conda activate ci_env conda info - conda list ffmpeg -version python -m pip install --upgrade pip + # We add conda library path as otherwise torchcodec is not + # able to load ffmpeg shared libraries: export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH} - echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" echo "::endgroup::" echo "::group::Install TorchAudio test and PyTorch dependencies" @@ -64,8 +64,6 @@ jobs: PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu" python -m pip install --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")' - ls -la /opt/conda/envs/ci_env/lib/python3.11/site-packages/torchcodec/ - ldd /opt/conda/envs/ci_env/lib/python3.11/site-packages/torchcodec/libtorchcodec_core7.so python -c 'import torchcodec; print(f"{torchcodec.__version__}"); print(f"{torchcodec.__file__}")' echo "::endgroup::"