Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
d5609ac
ci: revert to fla 0.4.x (#836)
clairesonglee Jul 2, 2026
77eaeea
ci: bump Primus-Turbo/AITER pins for Flux diffusion (mxfp4) + skip CI…
jasainio Jul 6, 2026
73cd33d
add mixtral-8x22B config files for maxtext backend (#841)
amd-fuyuajin Jul 7, 2026
868d32e
improve the logging format for the megatron backend (#842)
amd-fuyuajin Jul 7, 2026
e2f7ee6
merge to main of feat(flux): core runtime + Megatron adapter scaffold…
luiza-amd Jul 7, 2026
6e8914f
merge to main of docs(flux): diffusion training documentation (#858)
luiza-amd Jul 7, 2026
bbbcfa8
feat(flux): FSDP2 fp32/bf16 optimizers + fp8 all-gather (#808)
jasainio Jul 8, 2026
c22ac17
feat(flux): curated diffusion example/model/data configs (#821)
jasainio Jul 8, 2026
f8bee51
feat(megatron): migrate MLPerf GPT-OSS-20B pretrain trainer & patches…
HuangWei-95 Jul 8, 2026
7a447fe
feat: add AITER_LOG_LEVEL to suppress log (#849)
RuibinCheung Jul 8, 2026
bd124bf
[Megatron-LM] fix: duplicated memory footprint when enable turbo grou…
RuibinCheung Jul 8, 2026
80e680e
opt: remove grouped mlp d2h sync (#859)
RuibinCheung Jul 8, 2026
629fb80
Add diffusion backend & Wan training support (#779)
zirui Jul 8, 2026
03eedad
fix: remove duplicated flag use_turbo_fp4_autocast (#860)
RuibinCheung Jul 8, 2026
0d168b3
refactor: remove primus/modules and migrate still-used code into core…
WangLingxun Jul 8, 2026
aafbc3f
feat(flux): common diffusion module (embeddings, normalization, DiT b…
jasainio Jul 8, 2026
6094046
feat(flux): Primus-Turbo float8 + local-spec extensions (#809)
jasainio Jul 9, 2026
aef188a
fix(diffusion): repoint module_utils import to primus.core (#867)
WangLingxun Jul 9, 2026
608a4bd
feat(flux): Flux DiT model, layers, attention, checkpoint converter (…
jasainio Jul 9, 2026
9a6ff6a
feat(flux): mxfp4 local-spec extension + fp4 utils/enums (#814)
jasainio Jul 10, 2026
214c203
feat(flux): delayed fp8 scaling + TE DPA prologue patches (#813)
jasainio Jul 13, 2026
68236e7
Auto benchmark tool refinement (#872)
kailashg26 Jul 14, 2026
a655077
feat(flux): torch.compile + DDP-overlap compile patches (#815)
jasainio Jul 14, 2026
4648a4a
feat(flux): diffusion data pipeline (energon/synthetic providers, enc…
jasainio Jul 14, 2026
01f4a4d
feat(flux): diffusion training primitives (forward step, schedulers, …
jasainio Jul 14, 2026
c8e5c09
Dev/production doc (#824)
amd-fuyuajin Jul 15, 2026
e2f2487
Add MLperf examples for llama3.1 8b and gpt oss 20B (#854)
vidushi8 Jul 15, 2026
04e9a35
feat(flux): Flux HF->Primus checkpoint conversion tools (#818)
jasainio Jul 15, 2026
82a3c5d
[Model][Hardware][AMD] Add MLPerf Training 6.0 Llama2-70B LoRA post-t…
kailashg26 Jul 15, 2026
87f5787
feat(flux): diffusion data preprocessing pipelines + data CLI (#817)
jasainio Jul 15, 2026
5c68528
feat(runner): add run_preflight_direct.sh for non-container preflight…
yeandy Jul 16, 2026
05613e3
feat(maxtext): support MaxText v26.4 with v26.3 backward compatibilit…
yeandy Jul 16, 2026
6bad695
fix(megatron): ROCm-safe attention_backend + Mamba/SFT E2E, dead-code…
WangLingxun Jul 16, 2026
253b332
feat: add moe_router_force_load_balancing_type to select force load b…
RuibinCheung Jul 16, 2026
962a91d
feat(flux): diffusion + Flux pretrain trainers (#819)
jasainio Jul 16, 2026
7141566
Add flux.1 to diffusion backend (#832)
zirui Jul 16, 2026
0aad8d2
feat: add use_turbo_autotune flag and refine moe_router_force_load_ba…
RuibinCheung Jul 17, 2026
dd98974
feat: remove extra htod when enable turbo grouped gemm (#878)
RuibinCheung Jul 17, 2026
b28ec7c
fix(mlperf): dataset prep no longer deletes sibling files in data_dir…
WangLingxun Jul 17, 2026
4999e92
Add DeepSeek-V4 training support (model, attention/MoE kernels, Muon,…
wenxie-amd Jul 17, 2026
225fb8d
Support Crusoe (Spur) cluster for DeepSeek-V4 multi-node runs (#885)
wenxie-amd Jul 17, 2026
f96b1fb
feat(torchtitan): upgrade to v0.2.2 for torch 2.12 + GPT-OSS support …
WangLingxun Jul 17, 2026
8b5e809
fix(fsdp2): skip explicit forward prefetch when activation recompute …
botaohu001 Jul 17, 2026
e2c0b9e
feat(flux): MLPerf logging/warmup/lr-schedule patches (#820)
jasainio Jul 18, 2026
6eb904a
feat: odc adapt (#864)
botaohu001 Jul 20, 2026
d270165
fix(config): coerce true/false env interpolation to bool in yaml load…
HuangWei-95 Jul 20, 2026
0e4cc72
Adapt Primus launch to the spur (amd-spur) cluster (#887)
wenxie-amd Jul 20, 2026
c3dc7c6
docs: editorial improvements from user review pass (#883)
dso-amd Jul 21, 2026
507b056
Dev/version number update (#892)
amd-fuyuajin Jul 21, 2026
cb59b3d
test(flux): diffusion integration tests (#822)
jasainio Jul 21, 2026
95adea1
docs: strip trailing whitespace (#895)
WangLingxun Jul 21, 2026
e65fcdf
docs: enable generating `llms.txt` and llms-full.txt (#903)
peterjunpark Jul 22, 2026
471adde
update git clone url in the docs (#904)
amd-fuyuajin Jul 22, 2026
30cf451
Support maxtext v26.5 release (#906)
yeandy Jul 22, 2026
e71393d
Update turbo flydsl sparse attn (#898)
wenxie-amd Jul 23, 2026
f35b461
[Docker Release] Update MI300X configs for release (#907)
clairesonglee Jul 23, 2026
27a162d
update mi325x config files for primus-v26.5 (#900)
amd-fuyuajin Jul 23, 2026
063c1ee
Update batch size for mbridge qwen3-32B on MI300X (#897)
kailashg26 Jul 23, 2026
6ff31f6
[v25.5 Docker Release] Update configs to enable DeepEP (#910)
clairesonglee Jul 23, 2026
110ac6d
fix(maxtext): handle v26.5 2-value initialize()/run() API (#912)
amd-fuyuajin Jul 23, 2026
861bdbb
update MI355 yaml for v26.5 (#893)
vidushi8 Jul 23, 2026
4e5f4af
feat(skills): add port-validation-guide and extend backend-patch-expl…
WangLingxun Jul 23, 2026
e9b574f
docs(odc): add examples/odc reproduction guide (#890)
botaohu001 Jul 23, 2026
944f916
fix(projection): correct MI355X/gfx950 peak TFLOPS and XCD count (#855)
Vivicai1005 Jul 23, 2026
9a86ba8
ci: chown root-owned E2E leftovers back to runner user in Clean step …
wenxie-amd Jul 23, 2026
655f1b0
[OOB Release] add primus and jax v26.5 dockerfiles (#915)
GeneDer Jul 23, 2026
8f32812
fix(ci): stop anchore/sbom-action from double-uploading SBOM to relea…
WangLingxun Jul 27, 2026
19c0928
ci: bump base image/runner to v26.4 and drop v26.3-only workarounds (…
WangLingxun Jul 27, 2026
97f76b9
feat(dashboard): decouple Pages sections + single deployer, add pip n…
WangLingxun Jul 27, 2026
0523e9d
[Megatron-LM] feat: add grouped gemm fp4 support, skip cache trans we…
RuibinCheung Jul 28, 2026
a9707eb
[Megatron-LM] feat(moe): FlyDSL-based fused MegaMoE layer for Megatro…
zhenhuang12 Jul 29, 2026
0fa8a18
fix(runner): pass the runner dir to the slurm entry so sbatch works o…
wenxie-amd Jul 29, 2026
338a8d6
feat(megatron): Add support for Gated Delta Net (GDN) & Kimi Delta At…
clairesonglee Jul 29, 2026
76b73f9
fix(megatron): honor MXFP4 gradient SR setting (#932)
HuangWei-95 Jul 30, 2026
02b4fa6
Add third-party attribution headers for in-tree copied/adapted code (…
WangLingxun Jul 30, 2026
fc06295
[Hybrid Models] Upgrade FLA version to 0.5.1 (#936)
clairesonglee Jul 30, 2026
a89d28b
feat(deepseek-v4): enable the fused MegaMoE expert path on DeepSeek-V…
wenxie-amd Jul 30, 2026
2dc697b
Fix maxtext mixtral sharding to resolve perf drop (#921)
yeandy Jul 31, 2026
0efabce
fix(megatron): patch upstream GatedDeltaNet gate for ROCm NaN (#937)
WangLingxun Jul 31, 2026
885d036
chore: remove internal cluster node names from the repo (#946)
Xiaoming-AMD Aug 4, 2026
2046b02
fix(megatron): restore "compute per GPU" TFLOP label and make log par…
amd-fuyuajin Aug 5, 2026
f699678
docs(installation-jax): add bare-metal JAX/MaxText install guide and …
amd-fuyuajin Aug 5, 2026
8e24522
fix(deepseek-v4): correct V4-Flash attention and MoE math, make the 4…
lhzhang333 Aug 5, 2026
993118d
docs: refresh README feature/model/news sections for 2026 work (#953)
Xiaoming-AMD Aug 6, 2026
7cff62a
fix: bump PRIMUS_TURBO_COMMIT to 69deeab7 to fix loss NaN (#933)
zhenhuang12 Aug 7, 2026
68256bd
Add ragged FP8 MoE path and pinned runtime image for GPT-OSS 20B MLPe…
HuangWei-95 Aug 7, 2026
31de2ce
fix(megatron): gate device_id process-group init (AIMA-227) (#939)
gphuang Aug 10, 2026
3bdc417
feat(backend): add NeMo AutoModel (Wan 2.2 diffusion) as a first-clas…
mvstrauss Aug 10, 2026
32218e0
test: tier the trainer E2E suites and add an example-config smoke tes…
WangLingxun Aug 10, 2026
e053088
fix(torchtitan): migrate configs to the v0.2.2 debug section, and cat…
WangLingxun Aug 10, 2026
de858a9
feat(ainic): default RCCL_AINIC_ROCE=1 to enable built-in ANP (#966)
yeandy Aug 11, 2026
286eda7
chore(installation): update bare-metal install to v26.5 (#951)
amd-fuyuajin Aug 11, 2026
b639a90
feat(mlperf): MLLOG (mllog) support for Llama2-70B LoRA SFT on MI355X…
kailashg26 Aug 11, 2026
e213db2
feat(nemo_automodel): add Primus-Turbo FP8/MXFP4 low-precision linear…
Jul 16, 2026
af46d7d
feat(nemo_automodel): add FP8 example config for Wan2.2 T2V (512x512)
Jul 16, 2026
41fcfb5
feat(nemo_automodel): add Primus-Turbo FP8 flash-attention hook
Jul 16, 2026
77dab1e
feat(nemo_automodel): add FLUX.1-dev T2I pretrain configs
Jul 16, 2026
736557b
feat(nemo_automodel): add non-deterministic bf16 attention hook
Jul 16, 2026
b9ae60f
feat(nemo_automodel): add real activation-checkpointing hook for FLUX
Jul 16, 2026
84ad2b8
added configs etc for flux schnell + experiments
Jul 21, 2026
15bc8c4
chore(nemo_automodel): bump Automodel submodule to ba4ec358 for Ideog…
Jul 21, 2026
019a445
feat(nemo_automodel): add Ideogram-4 flow-matching adapter, var-len a…
Jul 23, 2026
98a758c
feat(nemo_automodel): add Ideogram-4 synthetic, cached, and real data…
Jul 23, 2026
6415926
feat(nemo_automodel): add Ideogram-4 DDP+ZeRO-1 optimizer and torch.p…
Jul 23, 2026
d893f43
feat(nemo_automodel): register Ideogram-4 hooks in trainer and add pr…
Jul 23, 2026
36c54d7
fix(nemo_automodel): fail loudly when ASSUME_DENSE meets a ragged batch
Aug 3, 2026
9dd058f
feat(nemo_automodel): build Ideogram-4 var-len cu_seqlens on the host
Aug 3, 2026
26eef0b
feat(nemo_automodel): consume precomputed cu_seqlens in the Ideogram-…
Aug 3, 2026
bfce73c
fix(nemo_automodel): drop the short final batch in the Ideogram-4 syn…
Aug 3, 2026
1c6f7d7
fix(nemo_automodel): pad the Ideogram-4 cache loader to a constant te…
Aug 3, 2026
7a50217
feat(nemo_automodel): publish the Ideogram-4 packing through a shared…
Aug 5, 2026
a04be07
chore(nemo_automodel): bump Automodel submodule ba4ec358 -> c852b16ff
Aug 11, 2026
7cb51ef
fix(nemo_automodel): accept BaseModule context kwargs in the pretrain…
Aug 11, 2026
62f40b3
refactor(nemo_automodel): move diffusion configs to the shared optimi…
Aug 11, 2026
fbbfbd2
fix(nemo_automodel): re-point the ZeRO-1 hook at OptimizerConfig.build
Aug 11, 2026
6099dc3
chore(nemo_automodel): scrub project-specific detail from Ideogram co…
Aug 11, 2026
8c6f204
refactor(nemo_automodel): split the backend into shared and per-model…
Aug 11, 2026
c5a4c01
feat(nemo_automodel): add 'primus data automodel-cache' for offline d…
Aug 11, 2026
b3eb7c8
fix(nemo_automodel): make fsdp.reshard_after_forward reach PyTorch on…
Aug 11, 2026
e509442
fix(nemo_automodel): hook the profiler onto the optimizer list, not a…
Aug 11, 2026
dc07e45
feat(nemo_automodel): context-parallel plan for Ideogram-4
Aug 12, 2026
3f977d5
test(nemo_automodel): pin the Ideogram-4 context-parallel plan
Aug 12, 2026
1715ac2
fix(nemo_automodel): make the ZeRO-1 patch reach the optimizer the pr…
Aug 12, 2026
df1991c
feat(nemo_automodel): add with_modules to the Ideogram-4 profiler hook
Aug 12, 2026
bf483b2
feat(nemo_automodel): reuse one text-feature buffer in the synthetic …
Aug 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 10 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
version: 2
# Version updates for GitHub Actions only; CVEs are handled by Dependabot
# security updates (enabled repo-wide).
# security updates (enabled repo-wide), which are unaffected by the schedule
# and ignore rules below.
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
open-pull-requests-limit: 5
groups:
github-actions:
patterns:
- "*"
# Only open PRs for major version bumps; skip the churn of minor/patch
# version updates (security fixes still come through regardless).
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-minor"
- "version-update:semver-patch"
labels:
- "dependencies"
- "github-actions"
581 changes: 378 additions & 203 deletions .github/workflows/ci.yaml

Large diffs are not rendered by default.

39 changes: 35 additions & 4 deletions .github/workflows/deploy-backend-gap-dashboard.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
name: Deploy Backend Gap Dashboard

# Report content lives on the orphan `dashboard-data` branch; tooling + site
# shell live on `main`. This job checks out both and overlays the data branch's
# `docs/` before building, so report runs never touch `main`.
#
# Pre-merge preview: run this workflow via "Run workflow" on a dev branch; it
# builds and deploys the full site (dashboard + that branch's sections) so new
# content can be validated before merging. Note: one Pages site per repo, so a
# preview temporarily replaces production until the next normal run.
on:
workflow_dispatch:
# Companion `notify-dashboard-deploy.yml` on the dashboard-data branch fires
# this after a data push, so report updates publish without a timed schedule.
repository_dispatch:
types: [dashboard-data-updated]
# Tooling/shell/workflow changes and mounted section sources (declared in
# pages-sections.json) on main. Add a new section's source path here too.
push:
branches:
- main
paths:
- "docs/backend-gap/**"
- "docs/weekly_reports/**"
- "docs/monthly_reports/**"
- "tools/backend_gap_report/**"
- "tools/pip_index/**"
- "examples/deepseek-v4/projection/site/**"
- ".github/workflows/deploy-backend-gap-dashboard.yml"

permissions:
Expand All @@ -21,12 +34,30 @@ concurrency:
group: backend-gap-dashboard-pages
cancel-in-progress: true

env:
DASHBOARD_DATA_BRANCH: dashboard-data

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
- name: Check out repository (tooling + site shell from main)
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Check out dashboard data branch
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ env.DASHBOARD_DATA_BRANCH }}
path: _dashboard_data

- name: Overlay report data onto the checkout
run: |
if [ -d _dashboard_data/docs ]; then
cp -r _dashboard_data/docs/. docs/
else
echo "::error::dashboard-data branch has no docs/ directory"
exit 1
fi

- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
Expand Down
281 changes: 281 additions & 0 deletions .github/workflows/docker-release/Dockerfile.jax-v26.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
ARG DEFAULT_BASE=ubuntu:24.04
ARG BASE_IMAGE=${DEFAULT_BASE}
FROM ${BASE_IMAGE:-$DEFAULT_BASE} AS jax_base

WORKDIR /workspace/
ENV MAX_JOBS=128
ENV PYTORCH_ROCM_ARCH="gfx942;gfx950"
ENV ROCM_AMDGPU_TARGETS="gfx942,gfx950"

# Flag to fix profiler hang issue.
ENV ROCPROFILER_QUEUE_INTERPOSITION=0
ENV DEBUG_HIP_DYNAMIC_QUEUES=0

# Install Ubuntu dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update \
&& apt install -y \
gfortran \
git \
git-lfs \
ninja-build \
g++ \
pkg-config \
xxd \
patchelf \
automake \
libtool \
python3-venv \
python3-dev \
python3-pip \
python-is-python3 \
libegl1-mesa-dev \
wget \
sudo \
flex \
liblzma-dev \
ccache \
libdw1 \
libdrm-dev \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

# Setup python env
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install --upgrade pip \
&& pip uninstall -y wheel \
&& pip install \
cmake==3.31.6 \
ninja==1.11.1.3 \
wheel==0.45.1 \
packaging==25.0 \
setuptools==69.5.1 \
&& rm -rf /root/.cache

ENV THEROCK_TARBALL=https://repo.amd.com/rocm/tarball-multi-arch/therock-dist-linux-multiarch-7.14.0.tar.gz

RUN mkdir -p /opt/rocm \
&& cd /opt/rocm \
&& wget ${THEROCK_TARBALL} \
&& tar -xvf *.tar.gz -C /opt/rocm \
&& rm *.tar.gz

# Setup ROCm stack related envs
ENV PATH="/opt/rocm/lib:/opt/venv/bin:/opt/rocm/bin:$PATH"
ENV LD_LIBRARY_PATH="/opt/rocm/lib:/opt/rocm/lib/rocm_sysdeps/lib"
ENV ROCM_PATH=/opt/rocm
ENV HIP_PLATFORM=amd
ENV HIP_DEVICE_LIB_PATH=/opt/rocm/lib/llvm/amdgcn/bitcode

# Install LLVM 18
RUN echo 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' | sudo tee /etc/apt/sources.list.d/llvm.list
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
RUN sudo apt-get update
RUN sudo apt-get install -y clang-18 lld-18 llvm-18-dev llvm-18-tools

# amdsmi
RUN pip install amdsmi==7.0.2 \
&& rm -rf /root/.cache

WORKDIR /workspace

# Install maxtext
ARG MAXTEXT_REPO=https://github.com/ROCm/maxtext.git
ARG MAXTEXT_BRANCH=release/v26.5

RUN git clone ${MAXTEXT_REPO} \
&& cd maxtext \
&& git checkout ${MAXTEXT_BRANCH} \
&& chmod +x src/dependencies/scripts/setup.sh \
&& ./src/dependencies/scripts/setup.sh \
&& cd .. \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /root/.cache

# Fix (root cause): the prebuilt PyPI TensorFlow wheel bundles an LLVM whose symbols
# collide with ROCm 7.14's libLLVM inside Grain "spawn" workers -> SIGSEGV on
# `import tensorflow` after `import jax`. Rebuild the CPU-only TF wheel from ROCm's
# fork (correct symbol visibility) and install it in place of the stock wheel. A CPU
# build also has no bundled NCCL, so it preserves the previous XLA-RCCL fix.
# NOTE: bumps TF to 2.21.0 and adds a long (~30-60 min) bazel build to the image.
ARG TF_REPO=https://github.com/ROCm/tensorflow-upstream.git
ARG TF_BRANCH=upstream-v2.21.0
ARG BAZELISK_VERSION=v1.25.0
# Bazelisk auto-selects the bazel version pinned by TF's .bazelversion.
RUN apt-get update && apt-get install -y unzip zip \
&& wget -O /usr/local/bin/bazel \
https://github.com/bazelbuild/bazelisk/releases/download/${BAZELISK_VERSION}/bazelisk-linux-amd64 \
&& chmod +x /usr/local/bin/bazel \
&& apt clean && rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 --branch ${TF_BRANCH} ${TF_REPO} tensorflow-upstream \
&& cd tensorflow-upstream \
&& bazel build //tensorflow/tools/pip_package:wheel \
--repo_env=WHEEL_NAME=tensorflow_cpu \
--repo_env=HERMETIC_PYTHON_VERSION=3.12 \
&& pip uninstall -y tensorflow tensorflow-cpu tensorflow_cpu \
&& pip install --no-deps \
bazel-bin/tensorflow/tools/pip_package/wheel_house/tensorflow_cpu-2.21.0-cp312-cp312-linux_x86_64.whl \
&& cd .. \
&& rm -rf tensorflow-upstream /root/.cache/bazel /root/.cache

# JAX
# Note: JAX and related libraries need to be installed before TE
ARG JAX_VERSION=0.10.0
ENV JAX_VERSION=${JAX_VERSION}
# See: https://repo.amd.com/rocm/whl-multi-arch/jax-rocm7-pjrt/
ENV JAX_PJRT_VERSION=0.10.0+rocm7.14.0
# See: https://repo.amd.com/rocm/whl-multi-arch/jax-rocm7-plugin/
ENV JAX_PLUGIN_VERSION=0.10.0+rocm7.14.0

RUN pip install jax==${JAX_VERSION} jaxlib==${JAX_VERSION} scipy==1.16 \
&& pip install \
--index-url https://repo.amd.com/rocm/whl-multi-arch/ \
--pre jax_rocm7_pjrt==${JAX_PJRT_VERSION} \
--pre jax_rocm7_plugin==${JAX_PLUGIN_VERSION} \
&& rm -rf /root/.cache

# TransformerEngine
# See: https://rocm.frameworks-nightlies.amd.com/whl-staging/device-all/transformer-engine-rocm-jax/
ARG TE_VERSION=2.15.0.dev0+rocm7.15.0a20260707.72d01a0

RUN pip install \
pybind11==3.0.4 \
importlib-metadata==8.7.1 \
pydantic==2.13.4 \
flax==0.12.2 \
&& pip install \
--index-url https://rocm.frameworks-nightlies.amd.com/whl-staging/device-all/ \
--pre \
--no-build-isolation \
transformer_engine_rocm_jax==${TE_VERSION} \
&& rm -rf /root/.cache

# Configure required envs
ENV NVTE_ALLOW_NONDETERMINISTIC_ALGO=1
ENV NVTE_USE_HIPBLASLT=1
ENV GPU_MAX_HW_QUEUES=2
ENV HIP_FORCE_DEV_KERNARG=1
ENV HSA_FORCE_FINE_GRAIN_PCIE=1
ENV NVTE_FUSED_ATTN=1
ENV NCCL_DEBUG=VERSION
ENV NVTE_CK_USES_BWD_V3=1
ENV NVTE_CK_USES_FWD_V3=1
ENV NVTE_CK_IS_V3_ATOMIC_FP32=1
ENV NVTE_CK_HOW_V3_BF16_CVT=2
ENV XLA_PYTHON_CLIENT_MEM_FRACTION=.9
ENV XLA_FLAGS="--xla_gpu_memory_limit_slop_factor=95 --xla_gpu_reduce_scatter_combine_threshold_bytes=8589934592 --xla_gpu_enable_latency_hiding_scheduler=True --xla_gpu_all_gather_combine_threshold_bytes=8589934592 --xla_gpu_enable_triton_gemm=False --xla_gpu_enable_cublaslt=True --xla_gpu_autotune_level=0 --xla_gpu_enable_all_gather_combine_by_dim=FALSE --xla_gpu_enable_command_buffer=''"

WORKDIR /workspace

# Primus
ARG PRIMUS_REPO=https://github.com/AMD-AGI/Primus.git
ARG PRIMUS_BRANCH=main

RUN git clone --recurse-submodules ${PRIMUS_REPO} \
&& cd Primus \
&& git checkout ${PRIMUS_BRANCH} \
&& git submodule update --init third_party/maxtext/ \
&& cd .. \
&& pip uninstall -y dataclasses dataclasses_json \
&& rm -rf /root/.cache

####### AINIC related installations #######
RUN apt update \
&& apt install -y \
libibverbs-dev \
jq \
dpkg-dev \
kmod \
xz-utils \
ibverbs-utils \
infiniband-diags \
rdma-core \
ethtool \
libevent-dev \
libhwloc-dev \
libmunge-dev \
software-properties-common \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

# Install AMD AINIC library
ARG AINIC_BUNDLE_VERSION="1.117.5-a-77"

RUN add-apt-repository -y "deb https://repo.radeon.com/amdainic/pensando/ubuntu/${AINIC_BUNDLE_VERSION} noble main" \
&& apt update --allow-insecure-repositories \
&& apt install -y --allow-unauthenticated libionic-dev \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

# Allow insecure repositories by default
RUN echo 'Acquire::AllowInsecureRepositories "true";' >> /etc/apt/apt.conf.d/99allow-insecure-repositories

# Install UCX
ARG UCX_VERSION="1.18.0"

RUN wget https://github.com/openucx/ucx/releases/download/v${UCX_VERSION}/ucx-${UCX_VERSION}.tar.gz \
&& mkdir -p ucx-${UCX_VERSION} \
&& tar -zxf ucx-${UCX_VERSION}.tar.gz -C ucx-${UCX_VERSION} --strip-components=1 \
&& cd ucx-${UCX_VERSION} \
&& mkdir build \
&& cd build \
&& ../configure --prefix=/workspace/ucx-${UCX_VERSION}/install --with-rocm=${ROCM_PATH} \
&& make -j 16 \
&& make install \
&& cd ../.. \
&& rm ucx-${UCX_VERSION}.tar.gz

ENV UCX_INSTALL_DIR=/workspace/ucx-${UCX_VERSION}/install

# Install OpenMPI
ARG MPI_VERSION="4.1.6"

RUN wget https://download.open-mpi.org/release/open-mpi/v$(echo "${MPI_VERSION}" | cut -d. -f1-2)/openmpi-${MPI_VERSION}.tar.gz \
&& mkdir -p ompi-${MPI_VERSION} \
&& tar -zxf openmpi-${MPI_VERSION}.tar.gz -C ompi-${MPI_VERSION} --strip-components=1 \
&& cd ompi-${MPI_VERSION} \
&& mkdir build \
&& cd build \
&& ../configure --prefix=${WORKDIR}/ompi-${MPI_VERSION}/install --with-ucx=${UCX_INSTALL_DIR} --disable-oshmem --disable-mpi-fortran \
&& make -j 16 \
&& make install \
&& cd ../.. \
&& rm openmpi-${MPI_VERSION}.tar.gz \
&& rm -rf ompi-${MPI_VERSION}

# Build RCCL with https://github.com/ROCm/rocm-systems/pull/8484
# This commit `9e5e408` is on `develop` branch, commited on 2026-07-13.
RUN rm -rf rocm-systems \
&& git clone https://github.com/ROCm/rocm-systems.git \
&& cd rocm-systems \
&& git checkout 9e5e4084a4b8e1e86551b0eb054725c62354a926 \
&& cd projects/rccl \
&& ./install.sh -l \
--prefix build/ \
--amdgpu_targets="gfx942;gfx950" \
&& cp -r build/release/librccl* /opt/rocm/lib/ \
&& cd /workspace \
&& rm -rf rocm-systems

####### End of AINIC related installations #######

# Secret scan will complain those files to be secrets. Explicitly remove them.
RUN rm -f /workspace/Primus/.git/packed-refs /workspace/Primus/.git/modules/third_party/**/packed-refs

# Clean cache
RUN rm -rf /root/.cache

# Training docker manifest
ARG GIT_COMMIT_TAG=DEV
ARG DOCKERFILE_PATH=Dockerfile

# Copy patch files for training docker versioning
RUN mkdir -p /workspace/.manifest \
&& env > /workspace/.manifest/env.txt \
&& pip list > /workspace/.manifest/requirements.txt \
&& dpkg -l > /workspace/.manifest/dpkg-list.txt \
&& echo "${GIT_COMMIT_TAG}" > /workspace/.manifest/training_docker_version

COPY ${DOCKERFILE_PATH} /workspace/.manifest/Dockerfile
Loading