Skip to content

Dockerfile - Add ROCm7.2 dockerfile - #855

Open
Nguyen Vuong (normanvuong) wants to merge 11 commits into
microsoft:mainfrom
normanvuong:nguyenvuong/rocm_7.2
Open

Nguyen Vuong (normanvuong) wants to merge 11 commits into
microsoft:mainfrom
normanvuong:nguyenvuong/rocm_7.2

Conversation

@normanvuong

@normanvuong Nguyen Vuong (normanvuong) commented Sep 23, 2026 •

Copy link
Copy Markdown

Description
Adds a ROCm 7.2.4 SuperBench Docker image targeting AMD MI300X (gfx942) and MI355X (gfx950).
This replaces the outdated draft #814. It is rebuilt on top of rocm6.4.x.dockerfile as merged
in #837 and does not depend on the ROCm 7.0 PR (#854), which has been dropped in favor of this one.

ROCm 7.2 is the newest ROCm userspace supported on the 6.4.x amdgpu driver used by the current
fleet (per AMD's compatibility matrix), so it can be validated on existing MI300X/MI355X SKUs
without a driver upgrade.

Supersedes #814.

Major Revision

  • Add dockerfile/rocm7.2.x.dockerfile, a new ROCm 7.2.4 image (Ubuntu 24.04, Python 3.12,
    PyTorch 2.9.1). Base image: rocm/pytorch:rocm7.2.4_ubuntu24.04_py3.12_pytorch_release_2.9.1.
    • RCCL, rocBLAS and hipBLASLt sources are pinned to the rocm-7.2.4 tag that matches the base
      image, so rebuilds are reproducible and the hipblaslt-bench headers match the installed
      libhipblaslt.so.
    • AMDGPU_TARGETS defaults to "gfx942 gfx950" and can be changed with --build-arg. The
      value is cleaned up and passed to the micro-benchmark builds, rccl-tests, hipblaslt-bench
      and TransformerEngine. If it is empty, CMAKE_HIP_ARCHITECTURES is left out of the
      hipblaslt-bench build so CMake falls back to auto-detection.
    • Only hipblaslt-bench is built, against the hipBLASLt already in the base image. The
      upstream 7.2 build pulls in AMD-internal "origami" headers and a new tensilelite-host
      library even for client-only builds, so it is replaced by a small CMake file,
      dockerfile/etc/hipblaslt-bench-standalone.cmake. LAPACK/CBLAS come from hipBLASLt's
      deps project. The hipBLASLt source and build folders are deleted afterwards.
    • TransformerEngine is pinned to v2.10_rocm. AMD tests that release on ROCm 7.2, and it
      ships AOTriton 0.11.2b for gfx942 and gfx950. CK fused attention stays off, as in 6.4.
      AOTriton is on only when every target is gfx942 or gfx950. onnxscript==0.7.2 and
      onnx==1.23.0 are installed up front, pinned to the versions validated with this
      TE/torch combination.
    • CMake 3.25.3 is built when the base image's CMake is older. rocBLAS 7.2 needs at least
      3.24.4, and the ROCm 7.2 hipblaslt-config.cmake uses block(), which needs 3.25 or later.
  • third_party/Makefile: add #include <cassert> to hipBusBandwidth.cpp when it is
    missing. The ROCm 7 clang rejects assert() without it. The step does nothing if the
    include is already there.
  • Add rocm7.2 to .github/workflows/build-image.yml with NUM_MAKE_JOBS=8. 7.2 skips the
    memory-heavy Tensile library build that required 6.4's limit of 2.

Minor Revision

  • Carried over from Dockerfile - Add ROCm6.4 dockerfile #837: DOCA-Host 3.2.3 user-space OFED, Docker 29.6.2 client only,
    flex, removal of the real OpenMPI clone directory, apt-get clean, rm -rf .git, and an
    apt-get update before the third_party ROCm build.
  • Intel MLC v3.13 with SHA-256 verification, matching the other Dockerfiles on main.
  • gfortran added to the apt list, because LAPACK in hipBLASLt's deps needs it.
  • Build parallelism (OpenMPI, RCCL, hipblaslt-bench, TransformerEngine MAX_JOBS) follows
    NUM_MAKE_JOBS instead of $(nproc). CMAKE_POLICY_VERSION_MINIMUM=3.5 is set for
    CMake 4.x, and the deps project's reserved install target is renamed.
  • Add tests/test_rocm72_dockerfile.py, a test that needs no Docker or GPU. It covers how
    AMDGPU_TARGETS is passed on (including the empty case), use of the standalone CMake file,
    the rocm-7.2.4 source pins, MLC checksum verification and the apt refresh.

Not included from #814

Verification

  • tests/test_rocm72_dockerfile.py and tests/test_rocm64_dockerfile.py pass.
  • Image builds on the self-hosted ROCm runner (passed on fa2e0c0; pending re-run after review fixes).

Refresh microsoft#814 on top of main, reusing the fixes absorbed in the ROCm 6.4 image (microsoft#837): AMDGPU_TARGETS routing (default gfx942 gfx950), DOCA-OFED user-space, client-only Docker 29.6.2, flex, CMake version check, OpenMPI clone cleanup and .git removal. hipblaslt-bench is built for the requested targets via a standalone CMake script against the system hipBLASLt, TransformerEngine is pinned to v2.10_rocm, and hipBusBandwidth gets a <cassert> include for the ROCm 7 clang.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 23, 2026 23:49
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The Dockerfile must honor the configured NUM_MAKE_JOBS limit for its OpenMPI build phases.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds a ROCm 7.2.4 SuperBench image targeting MI300X and MI355X GPUs.

Changes:

  • Adds the ROCm 7.2.4 Dockerfile and standalone hipBLASLt benchmark build.
  • Adds architecture-routing tests and CI workflow integration.
  • Adds the ROCm 7 HIP compilation compatibility fix.
File Summary
third_party/​Makefile Adds the required <cassert> workaround.
tests/​test_rocm72_dockerfile.py Tests architecture routing and standalone CMake usage.
dockerfile/​rocm7.2.x.dockerfile Defines the ROCm 7.2.4 image and dependency builds; OpenMPI phases do not honor NUM_MAKE_JOBS.
dockerfile/​etc/​hipblaslt-bench-standalone.cmake Provides the standalone hipBLASLt benchmark build.
.github/​workflows/​build-image.yml Registers the ROCm 7.2 image build.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread dockerfile/rocm7.2.x.dockerfile Resolved
Nguyen Vuong (from Dev Box) and others added 2 commits September 23, 2026 16:54
…gure

Stop clearing the global CMAKE_POLICY_VERSION_MINIMUM=3.5 for the hipblaslt-bench configure step so CMake 4.x compatibility also applies to any nested project.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the configured NUM_MAKE_JOBS limit instead of $(nproc) when building OpenMPI so the image build honors the CI job cap.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 23, 2026 23:59

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Unresolved build-parallelism issues and incomplete image/runtime verification require human review.

Review effort: Lite
Findings: None

Resolved since last review (1)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Nested RCCL build ignores configured make job limit

dockerfile/​rocm7.2.x.dockerfile:199

The workflow supplies NUM_MAKE_JOBS=8 to this build, but this top-level rocm target still reaches rocm_rccl_tests, whose recipe invokes a nested make ... -j without a job count (third_party/Makefile:148). That bypasses the configured cap and can spawn unbounded RCCL-tests compile jobs on the self-hosted runner, causing avoidable CPU/memory pressure; propagate NUM_MAKE_JOBS to that sub-build (and the other nested builds) or use the make jobserver.

Nguyen Vuong (from Dev Box) and others added 2 commits September 24, 2026 14:17
rocBLAS install.sh --dependencies runs apt-get install. When the earlier apt-get update layer is restored from the registry cache, its package index can be stale and fail with 404s on superseded Ubuntu packages (seen in the rocm6.4 PR gate once third_party changes invalidate later layers). Run apt-get update in the same layer as the third_party make.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rocBLAS release/rocm-rel-7.2 install.sh and CMakeLists.txt require CMake >= 3.24.4; the ROCm 7.2 base image has no suitable CMake, so the previously bootstrapped 3.24.1 made the rocm_rocblas build fail.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 24, 2026 21:19

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Three moderate build-configuration issues remain unresolved.

Review effort: Lite
Findings: None

Previously missed (1)

In code that hasn't changed since last review

Medium severity Nested ROCm builds bypass NUM_MAKE_JOBS with unbounded parallelism

dockerfile/​rocm7.2.x.dockerfile:202

The workflow sets NUM_MAKE_JOBS=8, but this invokes the third_party rocm aggregate, whose rocm_perftest and rocm_rccl_tests recipes run nested make -j without a value. Those sub-builds therefore use unlimited parallelism, bypass the configured cap, and can exhaust CPU or memory on the self-hosted runner. Pass the limit through those nested recipes (or replace the bare -j) before relying on this build limit.

The ROCm 7.2 hipblaslt-config.cmake uses the block() command added in CMake 3.25, and hipBLASLt 7.2 itself requires CMake 3.25.2. With 3.24.4, find_package(hipblaslt) in the rocBLAS clients build fails with 'Unknown CMake command \"block\"'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 25, 2026 14:19

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Recursive ROCm builds still use unbounded make -j, so the configured job limit may not prevent resource oversubscription.

Review effort: Lite
Findings: None

Previously missed (1)

In code that hasn't changed since last review

Medium severity Propagate NUM_MAKE_JOBS to nested ROCm builds

dockerfile/​rocm7.2.x.dockerfile:202

This top-level make rocm still invokes several ROCm recipes whose nested commands use unbounded make -j (for example rocm_perftest and rocm_rccl_tests), so the workflow's NUM_MAKE_JOBS=8 does not cap the main third-party build. On the shared self-hosted runner this can oversubscribe CPU and memory despite the explicit caps on OpenMPI, RCCL, and hipBLASLt; pass the job limit through the Makefile's recursive builds (and any relevant upstream install scripts) rather than relying only on the later Dockerfile commands.

@normanvuong

Copy link
Copy Markdown
Author

The remaining note about unbounded make -j in the nested third_party ROCm targets (rocm_perftest, rocm_rccl_tests, fio) applies to the shared third_party/Makefile used by every image, not to this Dockerfile. NUM_MAKE_JOBS is already visible to that make because Docker exposes ARG values to RUN. The targets just don't consume it. The same targets build fine in the ROCm 6.3, 6.4 and 7.0 images, so I'd rather cap them in a separate Makefile PR than widen this one.

@normanvuong
Nguyen Vuong (normanvuong) marked this pull request as ready for review September 25, 2026 22:21
@normanvuong
Nguyen Vuong (normanvuong) requested a review from a team as a code owner September 25, 2026 22:21
@normanvuong

Copy link
Copy Markdown
Author

The Docker build rocm6.3 failure is a transient Ansible Galaxy timeout during make postinstall (The read operation timed out calling galaxy.ansible.com), not related to this PR. The 6.3 image isn't touched here and built successfully on earlier pushes; rocm6.4 and rocm7.2 pass on fa2e0c0. Could someone with write access re-run the failed job?

@polarG Hongtao Zhang (polarG) 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.

Thanks for the rework. The image build and arch routing look good. Main asks: pin the hipBLASLt source to the rocm-7.2.4 tag so the bench headers match the installed library, and handle an empty AMDGPU_TARGETS in the hipBLASLt configure step. The rest are smaller hygiene suggestions.

Comment thread dockerfile/rocm7.2.x.dockerfile Resolved
Comment thread dockerfile/rocm7.2.x.dockerfile Resolved
Comment thread dockerfile/rocm7.2.x.dockerfile Resolved
Comment thread dockerfile/rocm7.2.x.dockerfile Resolved
Comment thread tests/test_rocm72_dockerfile.py Resolved
Comment thread dockerfile/rocm7.2.x.dockerfile Resolved
Comment thread dockerfile/rocm7.2.x.dockerfile Resolved
@polarG

Copy link
Copy Markdown
Contributor

Nguyen Vuong (@normanvuong) pls also add 7.2 to the build pipeline follow ROCm6.4 pattern.

Nguyen Vuong (from Dev Box) and others added 2 commits October 5, 2026 11:08
Resolve the rocm6.4.x.dockerfile conflict by taking main's version, which already refreshes the apt index before the third_party ROCm build.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Pin hipBLASLt, RCCL and rocBLAS sources to the rocm-7.2.4 tag matching the base image, so the hipblaslt-bench headers stay in lockstep with the installed libhipblaslt.so and rebuilds are reproducible.
- Only pass CMAKE_HIP_ARCHITECTURES to the hipblaslt-bench configure when AMDGPU_TARGETS is non-empty; CMake rejects a defined-but-empty value.
- Add gfortran to the apt list (needed for LAPACK in hipBLASLt deps).
- Pin onnxscript 0.7.2 and onnx 1.23.0, the versions validated with TE v2.10_rocm.
- Remove the hipBLASLt source/build trees after copying hipblaslt-bench.
- Drop the unused HIPBLASLT_INTERNAL_API define from the standalone CMake.
- Bump Intel MLC to v3.13 with checksum verification, matching main.
- Update tests: empty targets omit the architecture flag; add tag pin, MLC and apt refresh checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings October 5, 2026 18:12
@normanvuong

Copy link
Copy Markdown
Author

Nguyen Vuong (Nguyen Vuong (@normanvuong)) pls also add 7.2 to the build pipeline follow ROCm6.4 pattern.

7.2 is already in build-image.yml, in the same format as the 6.4 entry, but with NUM_MAKE_JOBS=8 because 7.2 doesn't build the Tensile library that needed 6.4's limit of 2. Did you mean a different pipeline, or should I match 6.4 with NUM_MAKE_JOBS=2?

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Parallel build steps can oversubscribe runner resources, and source provenance documentation needs reconciliation.

Review effort: Lite
Findings: 1 Low severity

Open (1)

Comment thread dockerfile/rocm7.2.x.dockerfile Resolved
Copilot AI lite review requested due to automatic review settings October 8, 2026 06:58
@polarG

Copy link
Copy Markdown
Contributor

Nguyen Vuong (@normanvuong) I meant the same image-build pipeline. I see ROCm 7.2 is already included, so please keep NUM_MAKE_JOBS=8.

I checked the ROCm 6.4 history: the gfx942-only hipBLASLt/Tensile build was still killed with exit code 137 at 8 workers, so c7ccd245 reduced it to 2 and narrowed the Tensile logic catalog as a build-memory workaround.

Since ROCm 7.2 builds only hipblaslt-bench against the preinstalled hipBLASLt library and skips Tensile library generation, it does not need to inherit that 2-job limit.

Copilot AI 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.

🟡 Changes recommended

The uncapped nested RCCL build parallelism should be fixed before approval.

1 open finding
1 resolved since last review

🧠 Review effort: Lite


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread dockerfile/rocm7.2.x.dockerfile Resolved
@polarG

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.36%. Comparing base (9142bdf) to head (0a707dd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #855   +/-   ##
=======================================
  Coverage   86.36%   86.36%           
=======================================
  Files         107      107           
  Lines        8258     8258           
=======================================
  Hits         7132     7132           
  Misses       1126     1126           
Flag Coverage Δ
cpu-python3.10-unit-test 71.95% <ø> (ø)
cpu-python3.12-unit-test 71.95% <ø> (ø)
cpu-python3.7-unit-test 71.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI lite review requested due to automatic review settings October 13, 2026 18:07

Copilot AI 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.

🔵 Needs a closer look

The extensive ROCm Docker, toolchain, and CI integration warrants final human review.

0 open findings

1 resolved since last review

🧠 Review effort: Lite

Copilot AI lite review requested due to automatic review settings November 1, 2026 05:17
@polarG

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI 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.

🔵 Needs a closer look

The image build, the standalone hipblaslt-bench CMake configure and compile, and the TransformerEngine AOTriton routing were not validated by execution, and the rocm7.2 build that passed on fa2e0c0 predates the review fixes and still needs a fresh run on the final commit.

No open issues 🎉

Review effort: Lite

This branch has not been deployed

No deployments
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.

4 participants