Skip to content

[CI] Nightly: publish pytorch-nightly multi-arch image (torch + source) - #3353

Merged
jithunnair-amd merged 15 commits into
developfrom
ethanwee/pytorch-private-nightly-ci-image
Sep 17, 2026
Merged

jithunnair-amd merged 15 commits into
developfrom
ethanwee/pytorch-private-nightly-ci-image

Conversation

@ethanwee1

@ethanwee1 ethanwee1 commented Jun 22, 2026

Copy link
Copy Markdown

What

Adds a nightly/manual workflow that publishes docker.io/rocm/pytorch-nightly from the actual head of pytorch/pytorch:nightly.

The workflow resolves the nightly branch ref directly and records that exact source SHA in Docker image labels and the workflow summary.

How

The workflow builds a Docker image from ubuntu:24.04. It uses one rocm_version input (default 10.0) and two derived package indexes:

TORCH_PACKAGE_INDEX_URL = https://download.pytorch.org/whl/nightly/rocm${ROCM_VERSION}/
ROCM_PACKAGE_INDEX_URL = https://stable.repo.amd.com/rocm/whl-next/

All ROCm packages now come from repo.amd.com, including libraries, devel files, and all device packages:

python -m pip install --no-cache-dir   --index-url "${ROCM_PACKAGE_INDEX_URL}"   "rocm[libraries,devel,device-all]==${ROCM_VERSION}.*"

PyTorch packages come from download.pytorch.org:

python -m pip install --no-cache-dir   --index-url "${TORCH_PACKAGE_INDEX_URL}"   torch torchvision torchaudio

After rocm[devel] is installed, /etc/rocm_env.sh is generated from the devel package using rocm-sdk path --root and rocm-sdk path --bin, so ROCM_HOME/ROCM_BIN point at the devel package location.

The workflow also clones the source into the image at expanded ~/pytorch (/root/pytorch via PYTORCH_SRC_DIR):

git clone --filter=blob:none --branch nightly https://github.com/pytorch/pytorch.git "$PYTORCH_SRC_DIR"
git -C "$PYTORCH_SRC_DIR" checkout --detach <resolved-nightly-branch-head>

So the published image contains installed nightly PyTorch wheels, ROCm runtime/devel/device wheels from repo.amd.com, and source code from the actual pytorch/pytorch:nightly branch head at build time.

Tags & secrets

  • Docker Hub target: docker.io/rocm/pytorch-nightly.
  • Primary tag defaults to latest.
  • Dated tag format is <YYYYMMDD>-<shortsha>.
  • Docker Hub login uses secrets.DOCKER_USERNAME and secrets.DOCKER_TOKEN.
  • Manual workflow_dispatch runs build and validate only; they do not log in or push to rocm/pytorch-nightly.
  • Scheduled runs are the only runs that push latest and <YYYYMMDD>-<shortsha>.

Triggers & config

  • schedule: daily at 07:00 UTC.
  • workflow_dispatch inputs (manual runs do not publish):
    • pytorch_branch (default nightly)
    • rocm_version (default 10.0; derives both torch and ROCm package indexes)
    • push_tag (default latest)

Validation

Local validation for the new devel install:

python3 -m pip install --dry-run --no-cache-dir --ignore-installed   --index-url https://stable.repo.amd.com/rocm/whl-next/   'rocm[devel]==10.0.*'

The dry-run resolves rocm-10.0.0, rocm-sdk-core-10.0.0, and rocm-sdk-devel-10.0.0.

Previous image validation on the Docker Hub latest tag confirmed the pulled image has /root/pytorch, imports torch, and includes ROCm device packages. A new workflow run should be used to validate the 10.0/devel update end-to-end, including rocm-sdk path after devel installation.

Validation now prints torch.version.hip and torch.version.rocm.

Latest validation run

Manual fork validation for current PR workflow (1f7db8b96d) passed: https://github.com/ethanwee1/pytorch/actions/runs/35229609533

This run used rocm_version=10.0 and manual workflow_dispatch, so it built and validated only; Docker Hub login/push were skipped as expected.

Validated output:

  • Source: pytorch/pytorch:nightly -> f3c0cf56a7577d677c37718c4edc41b8fc7fb51a
  • ROCm package index: https://stable.repo.amd.com/rocm/whl-next/
  • ROCm packages: rocm[libraries,devel,device-all]==10.0.* resolved to 10.0.0 packages, including rocm-sdk-devel, libraries, and device packages (gfx908, gfx942, gfx950, etc.)
  • Torch package index: https://download.pytorch.org/whl/nightly/rocm10.0/
  • Import validation: torch 2.15.0.dev20260916+rocm10.0, torch.version.hip 7.15.26333, torch.version.rocm 10.0.0
  • ROCM_HOME/ROCM_BIN were generated from rocm-sdk path after devel installation.

@rocm-repo-management-api

rocm-repo-management-api Bot commented Jun 22, 2026

Copy link
Copy Markdown

Jenkins build for 57c0e74ea7e20ea8d131e540248e589ab15ac756 commit finished as NOT_BUILT
Links: Pipeline Overview / Build artifacts / Test Results

@rocm-repo-management-api

rocm-repo-management-api Bot commented Jun 22, 2026

Copy link
Copy Markdown

Jenkins build for 52480d283ece84ca1ce2499cd67b5a9b631512c5 commit finished as NOT_BUILT
Links: Pipeline Overview / Build artifacts / Test Results

@rocm-repo-management-api

rocm-repo-management-api Bot commented Jun 22, 2026

Copy link
Copy Markdown

Jenkins build for 52480d283ece84ca1ce2499cd67b5a9b631512c5 commit finished as FAILURE
Links: Pipeline Overview / Build artifacts / Test Results

@ethanwee1
ethanwee1 marked this pull request as ready for review June 22, 2026 19:49
@rocm-repo-management-api

rocm-repo-management-api Bot commented Jun 23, 2026

Copy link
Copy Markdown

Jenkins build for d6d638c8a1e652faaebeaae82eb7bcacfe1170fa commit finished as FAILURE
Links: Pipeline Overview / Build artifacts / Test Results

@jithunnair-amd jithunnair-amd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ethanwee1 I was hoping to port @amdfaa 's scripts to ROCm/pytorch and then use them in this workflow, instead of rehashing a lot of the same logic. From your PR description, it seems that should be feasible?

Also left some comments for specific aspects.

Comment thread .github/workflows/publish-pytorch-private-nightly.yml Outdated
Comment thread .github/workflows/publish-pytorch-private-nightly.yml Outdated
Comment thread .github/workflows/publish-pytorch-private-nightly.yml Outdated
@rocm-repo-management-api

rocm-repo-management-api Bot commented Jun 24, 2026

Copy link
Copy Markdown

Jenkins build for 3a30693b2fa228b05f5e01cde56e28c110042af8 commit finished as FAILURE
Links: Pipeline Overview / Build artifacts / Test Results

@rocm-repo-management-api

rocm-repo-management-api Bot commented Jul 14, 2026

Copy link
Copy Markdown

Jenkins build for 09cea7192cde2d0b5a1024f7b10330bee9ae4def commit finished as FAILURE
Links: Pipeline Overview / Build artifacts / Test Results

@ethanwee1
ethanwee1 requested a review from jithunnair-amd July 16, 2026 15:27
Build rocm/pytorch-nightly from the pytorch/pytorch nightly branch head and install torch plus ROCm multi-arch wheels from the whl-multi-arch index.
@ethanwee1
ethanwee1 force-pushed the ethanwee/pytorch-private-nightly-ci-image branch from 6b283c2 to 9d04265 Compare August 13, 2026 20:15
The Ubuntu base image's pip is installed by apt and cannot be uninstalled by pip itself. Use it directly with --break-system-packages for the multi-arch wheel install.
The ROCm multi-arch wheel set is large. Avoid retaining pip's download cache during the Docker build and use plain Docker progress for better hosted-runner behavior.
Docker RUN defaults to dash, which rejects printf %q and failed every
fork publish since the multi-arch rewrite.
@ethanwee1 ethanwee1 changed the title [CI] Nightly: publish upstream pytorch CI image (built torch + source) to rocm/pytorch-private [CI] Nightly: publish pytorch-nightly multi-arch image (torch + source) Aug 17, 2026
@ethanwee1

Copy link
Copy Markdown
Author

@jithunnair-amd addressing the remaining review notes so we can re-review this:

  • Image target is rocm/pytorch-nightly, not rocm/pytorch-private.
  • Disk cleanup and the Docker /mnt data-root move are gone.
  • --no-rocm-devices / debug-env helper changes are gone. This no longer wraps the CI debug container; it builds from ubuntu:24.04 and installs rocm[libraries,devel,device-all] plus torch from https://rocm.nightlies.amd.com/whl-multi-arch/.
  • Source is the live pytorch/pytorch:nightly branch head, not a trunk artifact SHA.

Fork builds of that rewrite were failing on printf %q under Docker's default /bin/sh (dash). Latest commit uses bash for those RUNs to match install_rocm.sh. Re-run: https://github.com/ethanwee1/pytorch/actions/runs/32058136447 (push_tag=nightly-forktest).

ubuntu:24.04 does not ship OpenMP. torch._C failed validation with
missing libgomp.so.1 after the image itself built successfully.
@ethanwee1

Copy link
Copy Markdown
Author

Fork validation is green: https://github.com/ethanwee1/pytorch/actions/runs/32059342057

  • import torch -> 2.13.0+rocm10.1.0a20260817, hip 7.16.26323
  • source is nightly HEAD fa4d602
  • pushed rocm/pytorch-nightly:nightly-forktest and nightly-20260817-fa4d602 (sha256:866775c2)

@jithunnair-amd this is ready for another look. The --no-rocm-devices helper path is gone; remaining review notes on image name / disk cleanup are resolved.

Comment thread .github/workflows/publish-pytorch-private-nightly.yml Outdated
Comment thread .github/workflows/publish-pytorch-private-nightly.yml Outdated
Comment thread .github/workflows/publish-pytorch-private-nightly.yml Outdated
Comment thread .github/workflows/publish-pytorch-private-nightly.yml Outdated
Use a venv instead of --break-system-packages, publish latest plus date/sha tags, switch to DOCKER_USERNAME/DOCKER_TOKEN, and clone source under /root/pytorch.
ethanwee1 and others added 6 commits August 27, 2026 19:43
Switch the pytorch-nightly image workflow to download.pytorch.org's ROCm 7.14 nightly index. Use the supported ROCm extras available there: libraries and device-all.
download.pytorch.org's ROCm nightly index does not publish rocm-sdk-devel. Locate the installed _rocm_sdk_* root from site-packages instead of calling rocm-sdk path, which requires the devel extra.
Use a Python one-liner to locate the ROCm wheel root so Docker does not parse heredoc body lines as Dockerfile instructions.
The download.pytorch.org ROCm nightly torch wheel requires libatomic.so.1 at import time, so install Ubuntu's libatomic1 runtime package.
Keep workflow_dispatch runs as build-and-validate only. Only scheduled runs log in to Docker Hub and push rocm/pytorch-nightly tags.
package_index_url:
description: "Python wheel index for torch + ROCm multi-arch packages"
type: string
default: "https://download.pytorch.org/whl/nightly/rocm10.0/"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch this workflow input to be the ROCm version e.g. 10.0

IMAGE_NAME: rocm/pytorch-nightly
PYTORCH_REPO: pytorch/pytorch
PYTORCH_BRANCH: ${{ inputs.pytorch_branch || 'nightly' }}
PACKAGE_INDEX_URL: ${{ inputs.package_index_url || 'https://download.pytorch.org/whl/nightly/rocm10.0/' }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PACKAGE_INDEX_URL: ${{ inputs.package_index_url || 'https://download.pytorch.org/whl/nightly/rocm10.0/' }}
TORCH_PACKAGE_INDEX_URL: ${{ inputs.package_index_url || 'https://download.pytorch.org/whl/nightly/rocm10.0/' }}

Comment thread .github/workflows/publish-pytorch-private-nightly.yml Outdated
Use a single ROCm version input to derive the PyTorch nightly wheel index and install ROCm devel packages from stable.repo.amd.com/rocm/whl-next with a patch-version wildcard.
After installing rocm[devel], use rocm-sdk path to set ROCM_HOME and ROCM_BIN so the environment points at the devel package location.
Comment thread .github/workflows/publish-pytorch-private-nightly.yml Outdated
Comment thread .github/workflows/publish-pytorch-private-nightly.yml Outdated
Comment thread .github/workflows/publish-pytorch-private-nightly.yml
Split package indexes so PyTorch wheels come from download.pytorch.org while all rocm packages, including devel, come from stable.repo.amd.com/rocm/whl-next using the configured ROCm version wildcard.
@jithunnair-amd

Copy link
Copy Markdown
Collaborator

@ethanwee1 Thank you for addressing the review comments. Can you please trigger another workflow run on your fork with the latest changes, so we can validate the changes as mentioned in the PR description:

A new workflow run should be used to validate the 10.0/devel update end-to-end, including rocm-sdk path after devel installation.

@jithunnair-amd
jithunnair-amd merged commit b7c1a94 into develop Sep 17, 2026
3 checks passed
@jithunnair-amd
jithunnair-amd deleted the ethanwee/pytorch-private-nightly-ci-image branch September 17, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants