From 20d04785d36a0964d77990522b8129bf5eb634a6 Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Wed, 29 Oct 2025 09:13:20 -0700 Subject: [PATCH 01/10] copy build tutorials to reusable workflow file --- .github/workflows/_build-tutorials-base.yml | 183 ++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 .github/workflows/_build-tutorials-base.yml diff --git a/.github/workflows/_build-tutorials-base.yml b/.github/workflows/_build-tutorials-base.yml new file mode 100644 index 00000000000..94cfd5843a0 --- /dev/null +++ b/.github/workflows/_build-tutorials-base.yml @@ -0,0 +1,183 @@ +name: Build tutorials + +on: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }} + cancel-in-progress: true + +jobs: + worker: + name: pytorch_tutorial_build_worker + strategy: + matrix: + include: + - { shard: 1, num_shards: 15, runner: "linux.g5.12xlarge.nvidia.gpu" } + - { shard: 2, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 3, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 4, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 5, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 6, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 7, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 8, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 9, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 10, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 11, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 12, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 13, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 14, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + - { shard: 15, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } + fail-fast: false + runs-on: ${{ matrix.runner }} + steps: + - name: Setup SSH (Click me for login details) + uses: pytorch/test-infra/.github/actions/setup-ssh@main + with: + github-secret: ${{ secrets.GITHUB_TOKEN }} + instructions: | + All testing is done inside the container, to start an interactive session run: + docker exec -it $(docker container ps --format '{{.ID}}') bash + + - name: Checkout Tutorials + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Linux + uses: pytorch/pytorch/.github/actions/setup-linux@main + + - name: Install nvidia driver, nvidia-docker runtime, set GPU_FLAG + uses: pytorch/test-infra/.github/actions/setup-nvidia@main + + - name: Calculate/build docker image + id: calculate-docker-image + uses: pytorch/test-infra/.github/actions/calculate-docker-image@main + with: + docker-image-name: tutorials + + - name: Pull docker image + uses: pytorch/test-infra/.github/actions/pull-docker-image@main + with: + docker-image: ${{ steps.calculate-docker-image.outputs.docker-image }} + + - name: Build + shell: bash + env: + DOCKER_IMAGE: ${{ steps.calculate-docker-image.outputs.docker-image }} + NUM_WORKERS: ${{ matrix.num_shards }} + WORKER_ID: ${{ matrix.shard }} + COMMIT_ID: ${{ github.sha }} + JOB_TYPE: worker + COMMIT_SOURCE: ${{ github.ref }} + run: | + set -ex + + chmod +x ".jenkins/build.sh" + + container_name=$(docker run \ + ${GPU_FLAG:-} \ + -e WORKER_ID \ + -e NUM_WORKERS \ + -e COMMIT_ID \ + -e JOB_TYPE \ + -e COMMIT_SOURCE \ + --env-file="/tmp/github_env_${GITHUB_RUN_ID}" \ + --tty \ + --detach \ + --shm-size=2gb \ + --name="${container_name}" \ + -v "${GITHUB_WORKSPACE}:/var/lib/workspace" \ + -w /var/lib/workspace \ + "${DOCKER_IMAGE}" + ) + + docker exec -u ci-user -t "${container_name}" sh -c ".jenkins/build.sh" + + - name: Teardown Linux + uses: pytorch/test-infra/.github/actions/teardown-linux@main + if: always() + + manager: + name: pytorch_tutorial_build_manager + needs: worker + runs-on: [self-hosted, linux.2xlarge] + environment: ${{ github.ref == 'refs/heads/main' && 'pytorchbot-env' || '' }} + steps: + - name: Setup SSH (Click me for login details) + uses: pytorch/test-infra/.github/actions/setup-ssh@main + with: + github-secret: ${{ secrets.GITHUB_TOKEN }} + instructions: | + All testing is done inside the container, to start an interactive session run: + docker exec -it $(docker container ps --format '{{.ID}}') bash + + - name: Checkout Tutorials + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Linux + uses: pytorch/pytorch/.github/actions/setup-linux@main + + - name: Calculate/build docker image + id: calculate-docker-image + uses: pytorch/test-infra/.github/actions/calculate-docker-image@main + with: + docker-image-name: tutorials + + - name: Pull docker image + uses: pytorch/test-infra/.github/actions/pull-docker-image@main + with: + docker-image: ${{ steps.calculate-docker-image.outputs.docker-image }} + + - name: Build + shell: bash + env: + DOCKER_IMAGE: ${{ steps.calculate-docker-image.outputs.docker-image }} + NUM_WORKERS: 15 + WORKER_ID: ${{ matrix.shard }} + COMMIT_ID: ${{ github.sha }} + JOB_TYPE: manager + COMMIT_SOURCE: ${{ github.ref }} + GITHUB_PYTORCHBOT_TOKEN: ${{ secrets.PYTORCHBOT_TOKEN }} + run: | + set -ex + + chmod +x ".jenkins/build.sh" + + container_name=$(docker run \ + ${GPU_FLAG:-} \ + -e WORKER_ID \ + -e NUM_WORKERS \ + -e COMMIT_ID \ + -e JOB_TYPE \ + -e COMMIT_SOURCE \ + -e GITHUB_PYTORCHBOT_TOKEN \ + --env-file="/tmp/github_env_${GITHUB_RUN_ID}" \ + --tty \ + --detach \ + --name="${container_name}" \ + -v "${GITHUB_WORKSPACE}:/var/lib/workspace" \ + -w /var/lib/workspace \ + "${DOCKER_IMAGE}" + ) + + docker exec -u ci-user -t "${container_name}" sh -c ".jenkins/build.sh" + + - name: Upload docs preview + uses: seemethere/upload-artifact-s3@v5 + if: ${{ github.event_name == 'pull_request' }} + with: + retention-days: 14 + s3-bucket: doc-previews + if-no-files-found: error + path: docs + s3-prefix: pytorch/tutorials/${{ github.event.pull_request.number }} + + - name: Teardown Linux + uses: pytorch/test-infra/.github/actions/teardown-linux@main + if: always() From 7ae55b7a3ce7e392aa932e36364517c43654f970 Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Wed, 29 Oct 2025 09:24:55 -0700 Subject: [PATCH 02/10] modify base to be reusable, change build.sh to install nightly, add nightly workflow, change normal workflow to use reusable --- .github/workflows/_build-tutorials-base.yml | 17 +- .github/workflows/build-tutorials-nightly.yml | 18 ++ .github/workflows/build-tutorials.yml | 175 +----------------- .jenkins/build.sh | 8 +- 4 files changed, 42 insertions(+), 176 deletions(-) create mode 100644 .github/workflows/build-tutorials-nightly.yml diff --git a/.github/workflows/_build-tutorials-base.yml b/.github/workflows/_build-tutorials-base.yml index 94cfd5843a0..f8a976d3c4c 100644 --- a/.github/workflows/_build-tutorials-base.yml +++ b/.github/workflows/_build-tutorials-base.yml @@ -1,10 +1,13 @@ name: Build tutorials on: - pull_request: - push: - branches: - - main + workflow_call: + inputs: + USE_NIGHTLY: + description: "Use nightly builds inside build.sh" + required: false + type: number + default: false concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }} @@ -73,6 +76,7 @@ jobs: COMMIT_ID: ${{ github.sha }} JOB_TYPE: worker COMMIT_SOURCE: ${{ github.ref }} + USE_NIGHTLY: ${{ inputs.USE_NIGHTLY }} run: | set -ex @@ -85,6 +89,7 @@ jobs: -e COMMIT_ID \ -e JOB_TYPE \ -e COMMIT_SOURCE \ + -e USE_NIGHTLY \ --env-file="/tmp/github_env_${GITHUB_RUN_ID}" \ --tty \ --detach \ @@ -139,11 +144,12 @@ jobs: env: DOCKER_IMAGE: ${{ steps.calculate-docker-image.outputs.docker-image }} NUM_WORKERS: 15 - WORKER_ID: ${{ matrix.shard }} + WORKER_ID: 0 COMMIT_ID: ${{ github.sha }} JOB_TYPE: manager COMMIT_SOURCE: ${{ github.ref }} GITHUB_PYTORCHBOT_TOKEN: ${{ secrets.PYTORCHBOT_TOKEN }} + USE_NIGHTLY: ${{ inputs.USE_NIGHTLY }} run: | set -ex @@ -157,6 +163,7 @@ jobs: -e JOB_TYPE \ -e COMMIT_SOURCE \ -e GITHUB_PYTORCHBOT_TOKEN \ + -e USE_NIGHTLY \ --env-file="/tmp/github_env_${GITHUB_RUN_ID}" \ --tty \ --detach \ diff --git a/.github/workflows/build-tutorials-nightly.yml b/.github/workflows/build-tutorials-nightly.yml new file mode 100644 index 00000000000..4254b75e489 --- /dev/null +++ b/.github/workflows/build-tutorials-nightly.yml @@ -0,0 +1,18 @@ +name: Build tutorials against nightly or test + +on: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }} + cancel-in-progress: true + +jobs: + build: + uses: ./.github/workflows/_build-tutorials-base.yml + secrets: inherit + with: + USE_NIGHTLY: 1 diff --git a/.github/workflows/build-tutorials.yml b/.github/workflows/build-tutorials.yml index 94cfd5843a0..1b36520a2e6 100644 --- a/.github/workflows/build-tutorials.yml +++ b/.github/workflows/build-tutorials.yml @@ -11,173 +11,8 @@ concurrency: cancel-in-progress: true jobs: - worker: - name: pytorch_tutorial_build_worker - strategy: - matrix: - include: - - { shard: 1, num_shards: 15, runner: "linux.g5.12xlarge.nvidia.gpu" } - - { shard: 2, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 3, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 4, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 5, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 6, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 7, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 8, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 9, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 10, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 11, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 12, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 13, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 14, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - - { shard: 15, num_shards: 15, runner: "linux.g5.4xlarge.nvidia.gpu" } - fail-fast: false - runs-on: ${{ matrix.runner }} - steps: - - name: Setup SSH (Click me for login details) - uses: pytorch/test-infra/.github/actions/setup-ssh@main - with: - github-secret: ${{ secrets.GITHUB_TOKEN }} - instructions: | - All testing is done inside the container, to start an interactive session run: - docker exec -it $(docker container ps --format '{{.ID}}') bash - - - name: Checkout Tutorials - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Linux - uses: pytorch/pytorch/.github/actions/setup-linux@main - - - name: Install nvidia driver, nvidia-docker runtime, set GPU_FLAG - uses: pytorch/test-infra/.github/actions/setup-nvidia@main - - - name: Calculate/build docker image - id: calculate-docker-image - uses: pytorch/test-infra/.github/actions/calculate-docker-image@main - with: - docker-image-name: tutorials - - - name: Pull docker image - uses: pytorch/test-infra/.github/actions/pull-docker-image@main - with: - docker-image: ${{ steps.calculate-docker-image.outputs.docker-image }} - - - name: Build - shell: bash - env: - DOCKER_IMAGE: ${{ steps.calculate-docker-image.outputs.docker-image }} - NUM_WORKERS: ${{ matrix.num_shards }} - WORKER_ID: ${{ matrix.shard }} - COMMIT_ID: ${{ github.sha }} - JOB_TYPE: worker - COMMIT_SOURCE: ${{ github.ref }} - run: | - set -ex - - chmod +x ".jenkins/build.sh" - - container_name=$(docker run \ - ${GPU_FLAG:-} \ - -e WORKER_ID \ - -e NUM_WORKERS \ - -e COMMIT_ID \ - -e JOB_TYPE \ - -e COMMIT_SOURCE \ - --env-file="/tmp/github_env_${GITHUB_RUN_ID}" \ - --tty \ - --detach \ - --shm-size=2gb \ - --name="${container_name}" \ - -v "${GITHUB_WORKSPACE}:/var/lib/workspace" \ - -w /var/lib/workspace \ - "${DOCKER_IMAGE}" - ) - - docker exec -u ci-user -t "${container_name}" sh -c ".jenkins/build.sh" - - - name: Teardown Linux - uses: pytorch/test-infra/.github/actions/teardown-linux@main - if: always() - - manager: - name: pytorch_tutorial_build_manager - needs: worker - runs-on: [self-hosted, linux.2xlarge] - environment: ${{ github.ref == 'refs/heads/main' && 'pytorchbot-env' || '' }} - steps: - - name: Setup SSH (Click me for login details) - uses: pytorch/test-infra/.github/actions/setup-ssh@main - with: - github-secret: ${{ secrets.GITHUB_TOKEN }} - instructions: | - All testing is done inside the container, to start an interactive session run: - docker exec -it $(docker container ps --format '{{.ID}}') bash - - - name: Checkout Tutorials - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Linux - uses: pytorch/pytorch/.github/actions/setup-linux@main - - - name: Calculate/build docker image - id: calculate-docker-image - uses: pytorch/test-infra/.github/actions/calculate-docker-image@main - with: - docker-image-name: tutorials - - - name: Pull docker image - uses: pytorch/test-infra/.github/actions/pull-docker-image@main - with: - docker-image: ${{ steps.calculate-docker-image.outputs.docker-image }} - - - name: Build - shell: bash - env: - DOCKER_IMAGE: ${{ steps.calculate-docker-image.outputs.docker-image }} - NUM_WORKERS: 15 - WORKER_ID: ${{ matrix.shard }} - COMMIT_ID: ${{ github.sha }} - JOB_TYPE: manager - COMMIT_SOURCE: ${{ github.ref }} - GITHUB_PYTORCHBOT_TOKEN: ${{ secrets.PYTORCHBOT_TOKEN }} - run: | - set -ex - - chmod +x ".jenkins/build.sh" - - container_name=$(docker run \ - ${GPU_FLAG:-} \ - -e WORKER_ID \ - -e NUM_WORKERS \ - -e COMMIT_ID \ - -e JOB_TYPE \ - -e COMMIT_SOURCE \ - -e GITHUB_PYTORCHBOT_TOKEN \ - --env-file="/tmp/github_env_${GITHUB_RUN_ID}" \ - --tty \ - --detach \ - --name="${container_name}" \ - -v "${GITHUB_WORKSPACE}:/var/lib/workspace" \ - -w /var/lib/workspace \ - "${DOCKER_IMAGE}" - ) - - docker exec -u ci-user -t "${container_name}" sh -c ".jenkins/build.sh" - - - name: Upload docs preview - uses: seemethere/upload-artifact-s3@v5 - if: ${{ github.event_name == 'pull_request' }} - with: - retention-days: 14 - s3-bucket: doc-previews - if-no-files-found: error - path: docs - s3-prefix: pytorch/tutorials/${{ github.event.pull_request.number }} - - - name: Teardown Linux - uses: pytorch/test-infra/.github/actions/teardown-linux@main - if: always() + build: + uses: ./.github/workflows/_build-tutorials-base.yml + secrets: inherit + with: + USE_NIGHTLY: 0 diff --git a/.jenkins/build.sh b/.jenkins/build.sh index 72d30655db8..5e23e37da15 100755 --- a/.jenkins/build.sh +++ b/.jenkins/build.sh @@ -19,7 +19,13 @@ sudo apt-get install -y pandoc # NS: Path to python runtime should already be part of docker container # export PATH=/opt/conda/bin:$PATH -#Install PyTorch Nightly for test. +# Install PyTorch Nightly for test. +if [ "$USE_NIGHTLY" -eq 1 ]; then + sudo pip uninstall -y torch + pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu130 + pip show torch +fi + # Nightly - pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html # Install 2.5 to merge all 2.4 PRs - uncomment to install nightly binaries (update the version as needed). # sudo pip uninstall -y fbgemm-gpu torchrec From c360f784a7212bb439252b47fae88db2cc6b4fd3 Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Wed, 29 Oct 2025 09:34:13 -0700 Subject: [PATCH 03/10] add upload var to control if docs are uploaded to s3/main --- .github/workflows/_build-tutorials-base.yml | 10 +++++++++- .github/workflows/build-tutorials-nightly.yml | 1 + .github/workflows/build-tutorials.yml | 1 + .jenkins/build.sh | 8 +++++--- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_build-tutorials-base.yml b/.github/workflows/_build-tutorials-base.yml index f8a976d3c4c..546721453d7 100644 --- a/.github/workflows/_build-tutorials-base.yml +++ b/.github/workflows/_build-tutorials-base.yml @@ -7,7 +7,12 @@ on: description: "Use nightly builds inside build.sh" required: false type: number - default: false + default: 0 + UPLOAD: + description: "Upload built docs to PR preview and main site" + required: false + type: number + default: 0 concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }} @@ -77,6 +82,7 @@ jobs: JOB_TYPE: worker COMMIT_SOURCE: ${{ github.ref }} USE_NIGHTLY: ${{ inputs.USE_NIGHTLY }} + UPLOAD: ${{ inputs.UPLOAD }} run: | set -ex @@ -90,6 +96,7 @@ jobs: -e JOB_TYPE \ -e COMMIT_SOURCE \ -e USE_NIGHTLY \ + -e UPLOAD \ --env-file="/tmp/github_env_${GITHUB_RUN_ID}" \ --tty \ --detach \ @@ -110,6 +117,7 @@ jobs: name: pytorch_tutorial_build_manager needs: worker runs-on: [self-hosted, linux.2xlarge] + if: ${{ inputs.UPLOAD == 1 }} environment: ${{ github.ref == 'refs/heads/main' && 'pytorchbot-env' || '' }} steps: - name: Setup SSH (Click me for login details) diff --git a/.github/workflows/build-tutorials-nightly.yml b/.github/workflows/build-tutorials-nightly.yml index 4254b75e489..27c7bce43cf 100644 --- a/.github/workflows/build-tutorials-nightly.yml +++ b/.github/workflows/build-tutorials-nightly.yml @@ -16,3 +16,4 @@ jobs: secrets: inherit with: USE_NIGHTLY: 1 + UPLOAD: 0 diff --git a/.github/workflows/build-tutorials.yml b/.github/workflows/build-tutorials.yml index 1b36520a2e6..58372d557e6 100644 --- a/.github/workflows/build-tutorials.yml +++ b/.github/workflows/build-tutorials.yml @@ -16,3 +16,4 @@ jobs: secrets: inherit with: USE_NIGHTLY: 0 + UPLOAD: 1 diff --git a/.jenkins/build.sh b/.jenkins/build.sh index 5e23e37da15..7f3668b1b02 100755 --- a/.jenkins/build.sh +++ b/.jenkins/build.sh @@ -20,7 +20,7 @@ sudo apt-get install -y pandoc # export PATH=/opt/conda/bin:$PATH # Install PyTorch Nightly for test. -if [ "$USE_NIGHTLY" -eq 1 ]; then +if [ "${USE_NIGHTLY:-0}" -eq 1 ]; then sudo pip uninstall -y torch pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu130 pip show torch @@ -120,8 +120,10 @@ if [[ "${JOB_TYPE}" == "worker" ]]; then python .jenkins/validate_tutorials_built.py # Step 6: Copy generated files to S3, tag with commit ID - 7z a worker_${WORKER_ID}.7z docs - awsv2 s3 cp worker_${WORKER_ID}.7z s3://${BUCKET_NAME}/${COMMIT_ID}/worker_${WORKER_ID}.7z + if [ "${UPLOAD:-0}" -eq 1 ]; then + 7z a worker_${WORKER_ID}.7z docs + awsv2 s3 cp worker_${WORKER_ID}.7z s3://${BUCKET_NAME}/${COMMIT_ID}/worker_${WORKER_ID}.7z + fi elif [[ "${JOB_TYPE}" == "manager" ]]; then # Step 1: Generate no-plot HTML pages for all tutorials pip3 install -e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme From 3ee5086140b63d9f1f003a338c8e33c53a71e211 Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Wed, 29 Oct 2025 09:35:56 -0700 Subject: [PATCH 04/10] remove concurrency group from base --- .github/workflows/_build-tutorials-base.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/_build-tutorials-base.yml b/.github/workflows/_build-tutorials-base.yml index 546721453d7..e33c8c4bd67 100644 --- a/.github/workflows/_build-tutorials-base.yml +++ b/.github/workflows/_build-tutorials-base.yml @@ -14,10 +14,6 @@ on: type: number default: 0 -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }} - cancel-in-progress: true - jobs: worker: name: pytorch_tutorial_build_worker From e152da13e861104c268b8b1cf9e62ad57e9c9b2e Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Wed, 29 Oct 2025 10:23:37 -0700 Subject: [PATCH 05/10] add vision and audio? --- .jenkins/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.jenkins/build.sh b/.jenkins/build.sh index 7f3668b1b02..32ceec660da 100755 --- a/.jenkins/build.sh +++ b/.jenkins/build.sh @@ -21,8 +21,8 @@ sudo apt-get install -y pandoc # Install PyTorch Nightly for test. if [ "${USE_NIGHTLY:-0}" -eq 1 ]; then - sudo pip uninstall -y torch - pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu130 + sudo pip uninstall -y torch torchvision torchaudio + pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu130 pip show torch fi From da4a1343dfa312de5169c8891ab646f95f62b05f Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Wed, 29 Oct 2025 10:24:02 -0700 Subject: [PATCH 06/10] turn off normal build for now --- .github/workflows/build-tutorials.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-tutorials.yml b/.github/workflows/build-tutorials.yml index 58372d557e6..b6d2a0b6287 100644 --- a/.github/workflows/build-tutorials.yml +++ b/.github/workflows/build-tutorials.yml @@ -1,7 +1,7 @@ name: Build tutorials on: - pull_request: + # pull_request: push: branches: - main From f2d6cbc5115b1c19a21411191b1c41d8b0ac099f Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Wed, 29 Oct 2025 17:51:55 -0700 Subject: [PATCH 07/10] add fbgemm, torchrec, and torchrl --- .jenkins/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.jenkins/build.sh b/.jenkins/build.sh index 32ceec660da..df34e7a6f6a 100755 --- a/.jenkins/build.sh +++ b/.jenkins/build.sh @@ -21,8 +21,8 @@ sudo apt-get install -y pandoc # Install PyTorch Nightly for test. if [ "${USE_NIGHTLY:-0}" -eq 1 ]; then - sudo pip uninstall -y torch torchvision torchaudio - pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu130 + sudo pip uninstall -y torch torchvision torchaudio fbgemm-gpu torchrec torchrl + pip install --pre torch torchvision torchaudio fbgemm-gpu torchrec torchrl --index-url https://download.pytorch.org/whl/nightly/cu130 pip show torch fi From e31a1c8f1b7bbfbd44e2dc325972e6707ee032ea Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Wed, 29 Oct 2025 20:37:18 -0700 Subject: [PATCH 08/10] remove fbgemm, torchrec, and torchrl, we can add them back as needed but fbgemm doesnt exist atm --- .jenkins/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.jenkins/build.sh b/.jenkins/build.sh index df34e7a6f6a..32ceec660da 100755 --- a/.jenkins/build.sh +++ b/.jenkins/build.sh @@ -21,8 +21,8 @@ sudo apt-get install -y pandoc # Install PyTorch Nightly for test. if [ "${USE_NIGHTLY:-0}" -eq 1 ]; then - sudo pip uninstall -y torch torchvision torchaudio fbgemm-gpu torchrec torchrl - pip install --pre torch torchvision torchaudio fbgemm-gpu torchrec torchrl --index-url https://download.pytorch.org/whl/nightly/cu130 + sudo pip uninstall -y torch torchvision torchaudio + pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu130 pip show torch fi From ecbb7e658187ff036d5653eebb34070c1392572d Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Thu, 30 Oct 2025 09:29:32 -0700 Subject: [PATCH 09/10] turn off nighlty on PR, add back normal on PR --- .github/workflows/build-tutorials-nightly.yml | 5 +++-- .github/workflows/build-tutorials.yml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-tutorials-nightly.yml b/.github/workflows/build-tutorials-nightly.yml index 27c7bce43cf..b3e961b347a 100644 --- a/.github/workflows/build-tutorials-nightly.yml +++ b/.github/workflows/build-tutorials-nightly.yml @@ -1,7 +1,8 @@ -name: Build tutorials against nightly or test +name: Build tutorials (nightly/test) on: - pull_request: + # Only main branch for now + # pull_request: push: branches: - main diff --git a/.github/workflows/build-tutorials.yml b/.github/workflows/build-tutorials.yml index b6d2a0b6287..58372d557e6 100644 --- a/.github/workflows/build-tutorials.yml +++ b/.github/workflows/build-tutorials.yml @@ -1,7 +1,7 @@ name: Build tutorials on: - # pull_request: + pull_request: push: branches: - main From 56ca358181cdd442609c92581f0af478cd228dc4 Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Mon, 3 Nov 2025 13:38:25 -0800 Subject: [PATCH 10/10] add comment --- .github/workflows/build-tutorials-nightly.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-tutorials-nightly.yml b/.github/workflows/build-tutorials-nightly.yml index b3e961b347a..60f8d3a1fdc 100644 --- a/.github/workflows/build-tutorials-nightly.yml +++ b/.github/workflows/build-tutorials-nightly.yml @@ -1,8 +1,23 @@ name: Build tutorials (nightly/test) +# This is a workflow to build tutorials using nightly or the test/release +# candidate builds for pytorch libraries. It downloads torch and other torch +# related libraries from the nightly or test channel and checks that the +# tutorials can run. This workflow will not upload the built docs anywhere in +# order to prevent polluting the official documentation. +# During releases, this workflow should be run on PRs to verify that the +# tutorials work with the test/rc builds before the official release is made. +# When there is no release candidate, this workflow should only be run on the +# main branch since nightly can be unstable and we do not want to block PRs due +# to failures in this workflow. + +# To change the channel between nightly and test/rc, change the index used to +# download the binaries in .jenkins/build.sh. on: - # Only main branch for now + # Only main branch for now. Uncomment the below line to enable it on PRs. # pull_request: + + # Comment out the below line to disable on the main branch push: branches: - main