From 94ecb6de0bace14ec414a1dcc992b27646806049 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Mon, 8 Sep 2025 13:44:45 +0300 Subject: [PATCH 1/8] Replace build_docs workflow with docs workflow (copied from torchvision) Use v4.3.0 download-artifact --- .github/workflows/build_docs.yml | 176 ------------------------------- .github/workflows/docs.yaml | 113 ++++++++++++++++++++ 2 files changed, 113 insertions(+), 176 deletions(-) delete mode 100644 .github/workflows/build_docs.yml create mode 100644 .github/workflows/docs.yaml diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml deleted file mode 100644 index effc44ced5..0000000000 --- a/.github/workflows/build_docs.yml +++ /dev/null @@ -1,176 +0,0 @@ -name: Build documentation - -# Documentation is deployed in the following ways -# 1. Each time a commit is pushed to main branch -# 2. Nightly (so that docs are updated even when there is no commit to main branch on the day) -# 3. Manual trigger for release -# Because release requires changing the version number, which is used as a directory name, -# automating release doc deployment is tricky. -# There is no reliable way to know if there should have been a minor version bump. -# -on: - pull_request: - push: - branches: - - main - workflow_dispatch: - schedule: - - cron: '0 0 * * *' - -jobs: - build: - # Do not use matrix here to parameterize Python/CUDA versions. - # This job is required to pass for each PR. - # The name of the required job is sensitive to matrix parameter. - uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main - permissions: - id-token: write - contents: read - with: - job-name: Build doc - runner: linux.g5.4xlarge.nvidia.gpu - repository: pytorch/audio - gpu-arch-type: cuda - gpu-arch-version: "12.6" # See GPU_ARCH_ID below - timeout: 120 - upload-artifact: docs - - script: | - set -ex - # Set up Environment Variables - export PYTHON_VERSION="3.10" - export CU_VERSION="11.8" - export CUDATOOLKIT="pytorch-cuda=${CU_VERSION}" - - # Set CHANNEL - if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then - export CHANNEL=test - export BUILD_VERSION="$( cut -f 1 -d a version.txt )" - else - export CHANNEL=nightly - export BUILD_VERSION="$( cut -f 1 -d a version.txt )".dev"$(date "+%Y%m%d")" - fi - - echo "::group::Create conda env" - # Mark Build Directory Safe - git config --global --add safe.directory /__w/audio/audio - conda create --quiet -y --prefix ci_env python="${PYTHON_VERSION}" - conda activate ./ci_env - - echo "::endgroup::" - echo "::group::Install PyTorch" - - GPU_ARCH_ID=cu126 # This is hard-coded and must be consistent with gpu-arch-version. - PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${CHANNEL}/${GPU_ARCH_ID}" - pip install --progress-bar=off --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" - - echo "::endgroup::" - echo "::group::Install TorchAudio" - conda install --quiet --yes cmake>=3.18.0 ninja - pip3 install --progress-bar off -v -e . --no-use-pep517 - - # TODO: Need to rely on torchcodec instead of building ffmpeg from source. - echo "::endgroup::" - echo "::group::Build FFmpeg" - .github/scripts/ffmpeg/build_gpu.sh - - echo "::endgroup::" - echo "::group::Install other dependencies" - - pip install --progress-bar off -r docs/requirements.txt -r docs/requirements-tutorials.txt - - echo "::endgroup::" - echo "::group::Build documentation" - export BUILD_GALLERY=true - (cd docs && make html) - - echo "::endgroup::" - echo "::group::Copy artifact" - cp -rf docs/build/html/* "${RUNNER_DOCS_DIR}" - mv docs/build/html /artifacts/ - - commit-main: - if: github.ref_name == 'main' - permissions: - # Required for `git push` - # Note: - # This is not effective from fork. - # When you debug this, make sure to make a branch on pytorch and - # make PR from there. - contents: write - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v3 - with: - ref: gh-pages - fetch-depth: 5 - - uses: actions/download-artifact@v3 - with: - name: docs - - name: Update main doc - run: | - set -x - - git config user.name "pytorchbot" - git config user.email "soumith+bot@pytorch.org" - # When `git clone`, `gh-pages` branch is fetched by default. - # The size of gh-pages grows significantly, so we use ammend and force push - # We add a new commit once a week - if [ "$(date +%d)" = "1" ]; then - git commit --allow-empty -m "placeholder" - fi - - # TODO: add tag-based process (need to handle the main directory name) - # Update the main doc - rm -rf main - mv html main - git add --all main || true - - git commit --amend -m "auto-generating sphinx docs" || true - git push -f - - # Push for release - # Make sure that version.txt is updated first (alpha suffix is removed) - commit-release: - if: startsWith(github.ref_name, 'release/') && ( github.event_name == 'workflow_dispatch' ) - permissions: - # Required for `git push` - # Note: - # This is not effective from fork. - # When you debug this, make sure to make a branch on pytorch and - # make PR from there. - contents: write - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v3 - with: - ref: gh-pages - fetch-depth: 5 - - uses: actions/checkout@v4 - with: - path: _src - - uses: actions/download-artifact@v3 - with: - name: docs - - name: Update doc - run: | - set -x - - git config user.name "pytorchbot" - git config user.email "soumith+bot@pytorch.org" - # When `git clone`, `gh-pages` branch is fetched by default. - # The size of gh-pages grows significantly, so we use ammend and force push - # We add a new commit once a week - if [ "$(date +%d)" = "1" ]; then - git commit --allow-empty -m "placeholder" - fi - - dirname="$(cat _src/version.txt)" - rm -rf "${dirname}" - mv html "${dirname}" - git add --all "${dirname}" || true - - git commit --amend -m "auto-generating sphinx docs" || true - git push -f diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000000..3cfad7f09c --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,113 @@ +name: Docs + +on: + push: + branches: [ main ] + pull_request: + +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-cpu: disable + with-xpu: disable + with-rocm: disable + with-cuda: enable + build-python-only: "disable" + build: + needs: generate-matrix + strategy: + fail-fast: false + name: Build and Upload wheel + uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main + with: + repository: pytorch/audio + ref: "" + test-infra-repository: pytorch/test-infra + test-infra-ref: main + build-matrix: ${{ needs.generate-matrix.outputs.matrix }} + package-name: torchaudio + trigger-event: ${{ github.event_name }} + build-platform: "python-build-package" + build-command: "python -m build --wheel -vvv --no-isolation" + + build-docs: + runs-on: linux.4xlarge.nvidia.gpu + strategy: + fail-fast: false + matrix: + # 3.10 corresponds to the minimum python version for which we build + # the wheel unless the label cliflow/binaries/all is present in the + # PR. + python-version: ['3.10'] + cuda-version: ['12.6'] + ffmpeg-version-for-tests: ['7'] + container: + image: "pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}" + options: "--gpus all -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility" + 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 + python_version_without_periods=$(echo "${{ matrix.python-version }}" | sed 's/\.//g') + echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + name: pytorch_audio__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64 + path: pytorch/audio/dist/ + - name: Setup miniconda using test-infra + uses: pytorch/test-infra/.github/actions/setup-miniconda@main + with: + python-version: ${{ matrix.python-version }} + # We install conda packages at the start because otherwise conda may have conflicts with dependencies. + default-packages: "nvidia/label/cuda-${{ matrix.cuda-version }}.0::libnpp nvidia::cuda-nvrtc=${{ matrix.cuda-version }} nvidia::cuda-toolkit=${{ matrix.cuda-version }} nvidia::cuda-cudart=${{ matrix.cuda-version }} nvidia::cuda-driver-dev=${{ matrix.cuda-version }} conda-forge::ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" + - name: Check env + run: | + ${CONDA_RUN} env + ${CONDA_RUN} conda info + ${CONDA_RUN} nvidia-smi + ${CONDA_RUN} conda list + - name: Assert ffmpeg exists + run: | + ${CONDA_RUN} ffmpeg -buildconf + - name: Update pip + run: ${CONDA_RUN} python -m pip install --upgrade pip + - name: Install PyTorch + run: | + ${CONDA_RUN} python -m pip install --pre torch torchcodec --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} + ${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")' + - name: Install torchaudio from the wheel + run: | + wheel_path=`find pytorch/audio/dist -type f -name "*cu${{ env.cuda_version_without_periods }}-cp${{ env.python_version_without_periods }}*.whl"` + echo Installing $wheel_path + ${CONDA_RUN} python -m pip install $wheel_path -vvv + + - name: Check out repo + uses: actions/checkout@v3 + + - name: Install doc dependencies + run: | + cd docs + ${CONDA_RUN} python -m pip install -r requirements.txt -r requirements-tutorials.txt + - name: Build docs + run: | + cd docs + ${CONDA_RUN} make html + - uses: actions/upload-artifact@v4 + with: + name: Built-Docs + path: docs/build/html/ \ No newline at end of file From b6ab64abbb9f961206e9060166c4256437f90322 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Tue, 9 Sep 2025 14:01:43 +0300 Subject: [PATCH 2/8] Simplify docs workflow Temporarily switch to linux.g5.4xlarge.nvidia.gpu --- .github/workflows/docs.yaml | 68 ++++++++++--------------------------- 1 file changed, 17 insertions(+), 51 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 3cfad7f09c..c0e445e857 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -14,50 +14,17 @@ defaults: 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-cpu: disable - with-xpu: disable - with-rocm: disable - with-cuda: enable - build-python-only: "disable" - build: - needs: generate-matrix - strategy: - fail-fast: false - name: Build and Upload wheel - uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main - with: - repository: pytorch/audio - ref: "" - test-infra-repository: pytorch/test-infra - test-infra-ref: main - build-matrix: ${{ needs.generate-matrix.outputs.matrix }} - package-name: torchaudio - trigger-event: ${{ github.event_name }} - build-platform: "python-build-package" - build-command: "python -m build --wheel -vvv --no-isolation" - build-docs: - runs-on: linux.4xlarge.nvidia.gpu strategy: fail-fast: false matrix: - # 3.10 corresponds to the minimum python version for which we build - # the wheel unless the label cliflow/binaries/all is present in the - # PR. python-version: ['3.10'] cuda-version: ['12.6'] - ffmpeg-version-for-tests: ['7'] - container: - image: "pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}" - options: "--gpus all -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility" - needs: build + ffmpeg-version: ['7'] + runs-on: linux.g5.4xlarge.nvidia.gpu + env: + REPOSITORY: pytorch/audio + REF: "" steps: - name: Setup env vars run: | @@ -65,16 +32,18 @@ jobs: echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV python_version_without_periods=$(echo "${{ matrix.python-version }}" | sed 's/\.//g') echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV - - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: pytorch_audio__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64 - path: pytorch/audio/dist/ - name: Setup miniconda using test-infra uses: pytorch/test-infra/.github/actions/setup-miniconda@main with: python-version: ${{ matrix.python-version }} # We install conda packages at the start because otherwise conda may have conflicts with dependencies. - default-packages: "nvidia/label/cuda-${{ matrix.cuda-version }}.0::libnpp nvidia::cuda-nvrtc=${{ matrix.cuda-version }} nvidia::cuda-toolkit=${{ matrix.cuda-version }} nvidia::cuda-cudart=${{ matrix.cuda-version }} nvidia::cuda-driver-dev=${{ matrix.cuda-version }} conda-forge::ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" + default-packages: "nvidia/label/cuda-${{ matrix.cuda-version }}.0::libnpp nvidia::cuda-nvrtc=${{ matrix.cuda-version }} nvidia::cuda-toolkit=${{ matrix.cuda-version }} nvidia::cuda-cudart=${{ matrix.cuda-version }} nvidia::cuda-driver-dev=${{ matrix.cuda-version }} conda-forge::ffmpeg=${{ matrix.ffmpeg-version }} cmake ninja" + - uses: pytorch/test-infra/.github/actions/setup-binary-builds@main + with: + setup-miniconda: false + python-version: ${{ matrix.python-version }} + cuda-version: ${{ matrix.cuda-version }} + repository: "" - name: Check env run: | ${CONDA_RUN} env @@ -90,15 +59,12 @@ jobs: run: | ${CONDA_RUN} python -m pip install --pre torch torchcodec --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} ${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")' - - name: Install torchaudio from the wheel - run: | - wheel_path=`find pytorch/audio/dist -type f -name "*cu${{ env.cuda_version_without_periods }}-cp${{ env.python_version_without_periods }}*.whl"` - echo Installing $wheel_path - ${CONDA_RUN} python -m pip install $wheel_path -vvv - - name: Check out repo uses: actions/checkout@v3 - + - name: Install torchaudio + run: | + export USE_CUDA=1 + ${CONDA_RUN} python -m pip install . -v --no-build-isolation - name: Install doc dependencies run: | cd docs @@ -110,4 +76,4 @@ jobs: - uses: actions/upload-artifact@v4 with: name: Built-Docs - path: docs/build/html/ \ No newline at end of file + path: docs/build/html/ From 417938afdc76fb15e75be0681b3e98eb0c8cf1fe Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Tue, 9 Sep 2025 18:23:32 +0300 Subject: [PATCH 3/8] Switch to using linux_job_v2 --- .github/workflows/docs.yaml | 134 +++++++++++++++++------------------- 1 file changed, 63 insertions(+), 71 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index c0e445e857..3bb6e90204 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,79 +1,71 @@ name: Docs on: - push: - branches: [ main ] pull_request: - -permissions: - id-token: write - contents: write - -defaults: - run: - shell: bash -l -eo pipefail {0} + push: + branches: + - nightly + - main + - release/* + workflow_dispatch: jobs: - build-docs: + build: strategy: - fail-fast: false matrix: - python-version: ['3.10'] - cuda-version: ['12.6'] - ffmpeg-version: ['7'] - runs-on: linux.g5.4xlarge.nvidia.gpu - env: - REPOSITORY: pytorch/audio - REF: "" - 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 - python_version_without_periods=$(echo "${{ matrix.python-version }}" | sed 's/\.//g') - echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV - - name: Setup miniconda using test-infra - uses: pytorch/test-infra/.github/actions/setup-miniconda@main - with: - python-version: ${{ matrix.python-version }} - # We install conda packages at the start because otherwise conda may have conflicts with dependencies. - default-packages: "nvidia/label/cuda-${{ matrix.cuda-version }}.0::libnpp nvidia::cuda-nvrtc=${{ matrix.cuda-version }} nvidia::cuda-toolkit=${{ matrix.cuda-version }} nvidia::cuda-cudart=${{ matrix.cuda-version }} nvidia::cuda-driver-dev=${{ matrix.cuda-version }} conda-forge::ffmpeg=${{ matrix.ffmpeg-version }} cmake ninja" - - uses: pytorch/test-infra/.github/actions/setup-binary-builds@main - with: - setup-miniconda: false - python-version: ${{ matrix.python-version }} - cuda-version: ${{ matrix.cuda-version }} - repository: "" - - name: Check env - run: | - ${CONDA_RUN} env - ${CONDA_RUN} conda info - ${CONDA_RUN} nvidia-smi - ${CONDA_RUN} conda list - - name: Assert ffmpeg exists - run: | - ${CONDA_RUN} ffmpeg -buildconf - - name: Update pip - run: ${CONDA_RUN} python -m pip install --upgrade pip - - name: Install PyTorch - run: | - ${CONDA_RUN} python -m pip install --pre torch torchcodec --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} - ${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")' - - name: Check out repo - uses: actions/checkout@v3 - - name: Install torchaudio - run: | - export USE_CUDA=1 - ${CONDA_RUN} python -m pip install . -v --no-build-isolation - - name: Install doc dependencies - run: | - cd docs - ${CONDA_RUN} python -m pip install -r requirements.txt -r requirements-tutorials.txt - - name: Build docs - run: | - cd docs - ${CONDA_RUN} make html - - uses: actions/upload-artifact@v4 - with: - name: Built-Docs - path: docs/build/html/ + # TODO add up to 3.13 + python_version: ["3.10"] + cuda-version: ["12.6"] + fail-fast: false + uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main + permissions: + id-token: write + contents: read + with: + runner: linux.g5.4xlarge.nvidia.gpu + repository: pytorch/audio + gpu-arch-type: cuda + gpu-arch-version: ${{ matrix.cuda-version }} + timeout: 120 + job-name: docs + # run-with-docker: false + + script: | + set -ex + # Set up Environment Variables + export PYTHON_VERSION="${{ matrix.python_version }}" + export PIP_PROGRESS_BAR=off + export CONDA_QUIET=1 + export CU_VERSION="${{ matrix.cuda-version }}" + export CU_VERSION_WITHOUT_PERIODS="$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g')" + # 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=7 cmake ninja + conda activate ./ci_env + conda info + + python -m pip install --upgrade pip + + echo "::endgroup::" + echo "::group::Install PyTorch and TorchCodec" + PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cu${CU_VERSION_WITHOUT_PERIODS}" + python -m pip install --progress-bar=off --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" + 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::Build TorchAudio documentation" + cd docs + python -m pip install -r requirements.txt -r requirements-tutorials.txt + make html + echo "::endgroup::" + # TODO: upload From b40c8e835fd2df195dcdade5c126ec2e49e3c0be Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 10:29:54 +0300 Subject: [PATCH 4/8] Copy artifacts --- .github/workflows/docs.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 3bb6e90204..ca72315cf9 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -64,8 +64,12 @@ jobs: python -m pip install . -v --no-build-isolation echo "::endgroup::" echo "::group::Build TorchAudio documentation" - cd docs - python -m pip install -r requirements.txt -r requirements-tutorials.txt - make html + export BUILD_GALLERY=true + python -m pip install -r docs/requirements.txt -r docs/requirements-tutorials.txt + (cd docs && make html) + echo "::endgroup::" + + echo "::group::Copy artifact" + cp -rf docs/build/html/* "${RUNNER_DOCS_DIR}" + mv docs/build/html /artifacts/ echo "::endgroup::" - # TODO: upload From 26d54b393604024110e31d2c1700c163536c555d Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 10:54:20 +0300 Subject: [PATCH 5/8] Test docs upload --- .github/workflows/docs.yaml | 5 +++-- docs/source/index.rst | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index ca72315cf9..5758d03532 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -63,12 +63,13 @@ jobs: echo "::group::Build and install TorchAudio" python -m pip install . -v --no-build-isolation echo "::endgroup::" + echo "::group::Install TorchAudio documentation build requirements" + python -m pip install -r docs/requirements.txt -r docs/requirements-tutorials.txt + echo "::endgroup::" echo "::group::Build TorchAudio documentation" export BUILD_GALLERY=true - python -m pip install -r docs/requirements.txt -r docs/requirements-tutorials.txt (cd docs && make html) echo "::endgroup::" - echo "::group::Copy artifact" cp -rf docs/build/html/* "${RUNNER_DOCS_DIR}" mv docs/build/html /artifacts/ diff --git a/docs/source/index.rst b/docs/source/index.rst index 9581511272..a016dfb79d 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,6 +3,8 @@ Torchaudio Documentation .. image:: _static/img/logo.png +TESTING DOCS UPLOAD + Torchaudio is a library for audio and signal processing with PyTorch. It provides signal and data processing functions, datasets, model implementations and application components. From c9ad3bece3820b91600b9387b2bad36ddf3784a2 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 11:22:35 +0300 Subject: [PATCH 6/8] Clean up --- .github/workflows/docs.yaml | 24 +++++++++++++++--------- docs/source/index.rst | 2 -- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 5758d03532..9ee798dbcb 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -14,8 +14,9 @@ jobs: strategy: matrix: # TODO add up to 3.13 - python_version: ["3.10"] + python-version: ["3.11"] cuda-version: ["12.6"] + ffmpeg-version: ["7"] fail-fast: false uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main permissions: @@ -33,11 +34,12 @@ jobs: script: | set -ex # Set up Environment Variables - export PYTHON_VERSION="${{ matrix.python_version }}" + export PYTHON-VERSION="${{ matrix.python-version }}" + export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}" + export CU_VERSION_WITHOUT_PERIODS="$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g')" export PIP_PROGRESS_BAR=off export CONDA_QUIET=1 - export CU_VERSION="${{ matrix.cuda-version }}" - export CU_VERSION_WITHOUT_PERIODS="$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g')" + # Set UPLOAD_CHANNEL if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then export UPLOAD_CHANNEL=test @@ -48,29 +50,33 @@ 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=7 cmake ninja + 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::Install PyTorch and TorchCodec" PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cu${CU_VERSION_WITHOUT_PERIODS}" - python -m pip install --progress-bar=off --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}" + 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__}"); 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::Install TorchAudio documentation build requirements" python -m pip install -r docs/requirements.txt -r docs/requirements-tutorials.txt echo "::endgroup::" + echo "::group::Build TorchAudio documentation" export BUILD_GALLERY=true (cd docs && make html) echo "::endgroup::" - echo "::group::Copy artifact" + + echo "::group::Copy artifacts" cp -rf docs/build/html/* "${RUNNER_DOCS_DIR}" mv docs/build/html /artifacts/ echo "::endgroup::" diff --git a/docs/source/index.rst b/docs/source/index.rst index a016dfb79d..9581511272 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,8 +3,6 @@ Torchaudio Documentation .. image:: _static/img/logo.png -TESTING DOCS UPLOAD - Torchaudio is a library for audio and signal processing with PyTorch. It provides signal and data processing functions, datasets, model implementations and application components. From f7e686af23a56c137b3c84ce0f25ab3f418ec905 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 11:33:39 +0300 Subject: [PATCH 7/8] Restore linux.4xlarge.nvidia.gpu --- .github/workflows/docs.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 9ee798dbcb..63fc3e6271 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -13,7 +13,6 @@ jobs: build: strategy: matrix: - # TODO add up to 3.13 python-version: ["3.11"] cuda-version: ["12.6"] ffmpeg-version: ["7"] @@ -23,13 +22,12 @@ jobs: id-token: write contents: read with: - runner: linux.g5.4xlarge.nvidia.gpu + runner: linux.4xlarge.nvidia.gpu repository: pytorch/audio gpu-arch-type: cuda gpu-arch-version: ${{ matrix.cuda-version }} timeout: 120 job-name: docs - # run-with-docker: false script: | set -ex From d994c987a0388059432a7ee6238a4ba96c5962b2 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 10 Sep 2025 12:01:29 +0300 Subject: [PATCH 8/8] Fix typo --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 63fc3e6271..26bcbf8083 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -32,7 +32,7 @@ jobs: script: | set -ex # Set up Environment Variables - export PYTHON-VERSION="${{ matrix.python-version }}" + export PYTHON_VERSION="${{ matrix.python-version }}" export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}" export CU_VERSION_WITHOUT_PERIODS="$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g')" export PIP_PROGRESS_BAR=off