Skip to content

ci: run 8xGPU ROCm integration tests on linux_job_v2 (fix ECR auth) - #3562

Merged
huydhn merged 15 commits into
mainfrom
rocm-h100-linux-job-v2
Jun 6, 2026
Merged

huydhn merged 15 commits into
mainfrom
rocm-h100-linux-job-v2

Conversation

@huydhn

@huydhn huydhn commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3552
Fixes pytorch/test-infra#8152

Why

The H100 integration test ran the ROCm entry on linux_job_v3, which fails at docker pull with no basic auth credentials (run) — v3 gets the full ECR path but doesn't authenticate the ROCm runner. linux_job_v2 takes the bare image name and authenticates.

What

In integration_test_8gpu_h100.yaml, run CUDA and ROCm as separate jobs instead of one job on v3:

  • set-matrix (gpu-arch: cuda) → build-test on linux_job_v3 (full ECR path) — the existing CUDA path, unchanged.
  • set-matrix-rocm (gpu-arch: rocm) → build-test-rocm on linux_job_v2 (bare image name).

Supporting changes:

  • set-matrix.yaml gains a gpu-arch input (all default / cuda / rocm) and filters the returned matrix to that arch.
  • Each build-test* is gated by an inline non-empty-matrix check (fromJSON(...).include[0] != null), so it skips cleanly when the matrix is empty for that arch on a single-arch trigger (CUDA on labeled, ROCm on synchronize) instead of erroring at matrix evaluation.
  • The shared install + run logic lives in .github/scripts/run_8xgpu_integration_tests.sh, called by both jobs. ROCm-specific handling is gated there: artifacts dir created via sudo (the v2 container can't write host-owned RUNNER_TEMP), and DeepEP/NVSHMEM is skipped (CUDA-only).
  • Drop --force-reinstall (uninstall torch first instead) on the linux_job_v3 workflows (integration_test_8gpu_h100, integration_test_8gpu_graph_trainer_h100): with PIP_EXTRA_INDEX_URL cleared, --force-reinstall re-pulls torch's deps from the public PyPI CDN and intermittently fails with connection resets. The linux_job_v2 workflows are unchanged.

Test

Toggle the ciflow/h100.8 label (remove + re-add) to fire a labeled event → runs build-test-rocm on linux_job_v2; build-test (CUDA) skips. An ordinary push runs CUDA and skips ROCm; pushes to main / the schedule run both. ROCm test bodies (none marked skip_rocm_test yet) are a follow-up.

The 8 GPU H100 integration test ran every matrix entry on linux_job_v3.
The ROCm entry failed at the docker pull step with "no basic auth
credentials": v3 is handed the full private-ECR image path but does not
log the ROCm runner into ECR. The working ROCm workflows (models,
features, ...) instead pass the bare image name and let linux_job_v2
resolve and authenticate against ECR.

Centralize the reusable-workflow choice in set-matrix.yaml. It now takes
a cuda-linux-job-v3 input (default false -> v2) and returns ready-to-use
matrix-v2 / matrix-v3 outputs plus has-v2 / has-v3 guards. GitHub Actions
forbids expressions in a job's uses: keyword, so the caller still needs
two statically-declared jobs, but the policy (ROCm always v2, CUDA on v3
only when opted in) lives in one place. The existing matrix output is
unchanged, so the other seven set-matrix callers are unaffected.

integration_test_8gpu_h100.yaml now runs CUDA on linux_job_v3 (full ECR
path) and ROCm on linux_job_v2 (bare image name), each gated on its
has-* output.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 6, 2026
@pytorch-bot

pytorch-bot Bot commented Jun 6, 2026

Copy link
Copy Markdown

Warning: Unknown label ciflow/rocm.
Currently recognized labels are

  • ciflow/8gpu
  • ciflow/h100.8
  • ciflow/rl

Please add the new label to .github/pytorch-probot.yml

@huydhn huydhn added ciflow/h100.8 Trigger H100.8 CI and removed ciflow/rocm labels Jun 6, 2026
Split the ROCm entry out of integration_test_8gpu_h100.yaml into a new
standalone integration_test_8gpu_rocm.yaml that runs on linux_job_v2,
matching every other integration_test_*.yaml layout.

set-matrix now splits by GPU arch (matrix-cuda / matrix-rocm plus
has-cuda / has-rocm) instead of by reusable-workflow version, since each
workflow now picks its own linux_job version statically. The combined
matrix output is unchanged, so the other set-matrix callers are
unaffected. The H100 workflow is now CUDA-only on linux_job_v3.
@pytorch-bot

pytorch-bot Bot commented Jun 6, 2026

Copy link
Copy Markdown

Warning: Unknown label ciflow/rocm.
Currently recognized labels are

  • ciflow/8gpu
  • ciflow/h100.8
  • ciflow/rl

Please add the new label to .github/pytorch-probot.yml

Instead of emitting matrix / matrix-cuda / matrix-rocm (plus has-cuda /
has-rocm), set-matrix now takes a single gpu-arch input ('all' default,
'cuda', or 'rocm') and returns one narrowed matrix plus a has-entries
guard. The H100 workflow passes gpu-arch: cuda and the ROCm workflow
passes gpu-arch: rocm; the other callers omit it and get the combined
matrix as before.
@huydhn huydhn added ciflow/h100.8 Trigger H100.8 CI and removed ciflow/h100.8 Trigger H100.8 CI labels Jun 6, 2026
huydhn added 5 commits June 5, 2026 18:30
With PIP_EXTRA_INDEX_URL cleared, --force-reinstall re-downloads torch's
deps (filelock, sympy, ...) from the public PyPI CDN instead of the
in-cluster cache, which intermittently fails with connection resets on
the H100 runner. torch itself still comes from the nightly --index-url;
its deps stay already-satisfied.
Ensures the nightly torch actually installs without --force-reinstall:
a torch baked into the image (e.g. pulled transitively) would otherwise
be skipped as already-satisfied. pip uninstall -y is a no-op (exit 0)
when torch is absent.
Removes the has-entries output from set-matrix and the if-guard from the
H100/ROCm build-test jobs, so an empty {"include":[]} matrix is passed
through directly.
The H100 (CUDA, linux_job_v3) and ROCm (linux_job_v2) workflows ran a
near-identical inline script. Move it to
scripts/ci/run_8xgpu_integration_tests.sh, which both call with the
matrix values passed as env vars (INDEX_URL, GPU_ARCH_TYPE,
TORCH_VERSION). The ROCm-only HIPBLASLT step is guarded and a no-op on
CUDA. Conda is initialized via the shell hook since the script now runs
in its own bash.
Decide CUDA/ROCm eligibility (trigger + gpu-arch input + is-experimental)
as booleans and assemble the include list from only the eligible entries,
instead of string-splicing a full matrix and filtering it afterward with
jq. This also drops the ROCM_MATRIX="" experimental hack, which used to
produce invalid JSON ([<cuda>,]) on the main/schedule branch.
@pytorch-bot

pytorch-bot Bot commented Jun 6, 2026

Copy link
Copy Markdown

Warning: Unknown label ciflow/rocm.
Currently recognized labels are

  • ciflow/8gpu
  • ciflow/h100.8
  • ciflow/rl

Please add the new label to .github/pytorch-probot.yml

huydhn added 2 commits June 5, 2026 18:52
This linux_job_v3 workflow clears PIP_EXTRA_INDEX_URL and force-reinstalls
torch, which re-downloads torch's deps from the public PyPI CDN and
intermittently fails with connection resets on the H100 runner (same as
integration_test_8gpu_h100). Uninstall torch first, then install the
nightly without --force-reinstall so the already-present deps are reused.
The linux_job_v2 workflows keep --force-reinstall (they don't clear the
in-cluster cache, so they don't hit the public CDN).
Keep the original trigger-based include logic untouched and just narrow
the matrix to the requested gpu-arch with a jq filter, instead of the
boolean-rewrite construction. Smaller, lower-risk change to set-matrix.
@huydhn huydhn changed the title ci: run ROCm H100-suite jobs on linux_job_v2 (fix ECR auth) ci: move ROCm 8xGPU integration tests to a standalone linux_job_v2 workflow (fix ECR auth) Jun 6, 2026
@huydhn huydhn removed the ciflow/h100.8 Trigger H100.8 CI label Jun 6, 2026
@huydhn huydhn added the ciflow/h100.8 Trigger H100.8 CI label Jun 6, 2026
@huydhn

huydhn commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor Author

huydhn added 2 commits June 5, 2026 23:23
The shared script used the H100/v3 path verbatim, which broke the ROCm
v2 run two ways:
- `mkdir -p $RUNNER_TEMP/...` fails with "Permission denied" because the
  v2 ROCm container user can't write the host-owned RUNNER_TEMP. Use
  `sudo mkdir` + `sudo chown` on ROCm (as the other ROCm workflows do);
  keep plain mkdir for the v3 CUDA runner.
- `/install_deepep.sh` (NVSHMEM, set -eux) is CUDA-only; skip it on ROCm.
Per review feedback, relocate run_8xgpu_integration_tests.sh from
scripts/ci/ to .github/scripts/ and update both workflow references.
@huydhn huydhn added ciflow/h100.8 Trigger H100.8 CI and removed ciflow/h100.8 Trigger H100.8 CI labels Jun 6, 2026
huydhn added 2 commits June 6, 2026 00:11
Drop the standalone integration_test_8gpu_rocm.yaml and instead add a
second set-matrix (gpu-arch: rocm) + build-test-rocm (linux_job_v2) pair
to integration_test_8gpu_h100.yaml, alongside the existing CUDA
set-matrix + build-test (linux_job_v3). Both call the shared
.github/scripts/run_8xgpu_integration_tests.sh. Avoids a new workflow
file while keeping CUDA on v3 and ROCm on v2.
set-matrix returns an empty matrix for the "off" arch of a single-arch
trigger (CUDA on a label event, ROCm on a synchronize push), and an empty
matrix errors at strategy evaluation rather than skipping. Gate each
build-test on a non-empty matrix via an inline fromJSON check (the job-level
if is evaluated before matrix expansion), so the job skips cleanly. The
matrix != '' guard short-circuits the fromJSON when set-matrix is skipped.
@huydhn
huydhn requested a review from tianyu-l June 6, 2026 07:37

@tianyu-l tianyu-l left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

unblock

@huydhn huydhn changed the title ci: move ROCm 8xGPU integration tests to a standalone linux_job_v2 workflow (fix ECR auth) ci: run 8xGPU ROCm integration tests on linux_job_v2 (fix ECR auth) Jun 6, 2026
ROCm now runs as a job in integration_test_8gpu_h100.yaml, not the
deleted integration_test_8gpu_rocm.yaml.
@huydhn huydhn added ciflow/h100.8 Trigger H100.8 CI and removed ciflow/h100.8 Trigger H100.8 CI labels Jun 6, 2026
@huydhn
huydhn merged commit 5f08ee1 into main Jun 6, 2026
32 of 35 checks passed
@wconstab

wconstab commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

thanks for this fix @huydhn!

@huydhn

huydhn commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

thanks for this fix @huydhn!

Np, the job is running correctly now, but the test is failing https://github.com/pytorch/torchtitan/actions/runs/27062299168/job/79877062290. I don't have the context on how to fix it, so please help take look there and let me know if additional infra / CI changes are needed

wconstab added a commit that referenced this pull request Jun 8, 2026
)

fix CI errors on rocm when running `deepseek_v3_fsdp+hybridep+compile`
example:
https://github.com/pytorch/torchtitan/actions/runs/27108561047/job/80002013308
```
ImportError: HybridEP requires deep_ep library. Install from: https://github.com/deepseek-ai/DeepEP, branch: hybrid-ep
```

Claude summary:
What happened:
- #3360 added the deepseek_v3_fsdp+hybridep+compile test to the h100
suite
(tests/integration_tests/h100.py:82-95) and installed deep_ep in CUDA
CI. That worked fine — at
the time only the CUDA H100 job ran the h100 suite.
- #3562 made the ROCm runner also execute the same h100 suite via the
new shared
run_8xgpu_integration_tests.sh. But deep_ep/NVSHMEM is CUDA-only, so the
script deliberately skips
installing it on ROCm (run_8xgpu_integration_tests.sh:71). The hybridep
test still runs on ROCm →
  ModuleNotFoundError: No module named 'deep_ep'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/h100.8 Trigger H100.8 CI ciflow/rocm ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot. module: rocm

Projects

None yet

3 participants