Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
74d7a2c
feat(maxtext): add fp8 and nanoo_fp8 pretrain configs for MI300X/MI355X
yeandy Jul 27, 2026
b5b43b6
feat(maxtext): scope quantized configs per device (MI300X nanoo_fp8, …
yeandy Jul 27, 2026
7310eda
feat(maxtext): add MI355X fp8 config for llama3.1_405B
yeandy Jul 27, 2026
1ad7522
feat(maxtext): per-config top-level env: loader; mixtral 8x7B bs11 @ …
yeandy Jul 30, 2026
dcf9725
feat(maxdiffusion): add Primus JAX MaxDiffusion backend (WAN/FLUX)
yeandy Jul 31, 2026
427702c
feat(maxtext): consolidate env management into a declarative Primus s…
Aug 1, 2026
d61b61c
feat(maxdiffusion): add Primus JAX MaxDiffusion backend (WAN/FLUX)
yeandy Jul 31, 2026
40dfae8
feat(maxdiffusion): adopt declarative env_defaults() (align with maxt…
Aug 1, 2026
91552d6
fix(maxdiffusion): restore full ROCm/RCCL env in MI355X configs; log …
Aug 2, 2026
30f5648
feat(maxdiffusion): write per-step metrics to a file for reliable per…
Aug 2, 2026
8ba08d2
fix(maxdiffusion): import trainer inside TE mesh-guard to fix WAN OOM
Aug 2, 2026
d7264f0
Merge origin/jax-maxdiffusion-v26.6 (superseded backend) using ours
Aug 2, 2026
8b4e441
Add Gemma 4 31B (Dense) & 26B (MoE) MaxText pretrain configs
Aug 3, 2026
fc4dc19
Use validated dot_product attention for gemma4 MI355X pretrain configs
Aug 4, 2026
6038de6
Fix fp8-MoE crash on v26.6 by pinning pure_nnx_decoder: false
yeandy Aug 5, 2026
963a7f6
Vendor MaxDiffusion in Primus + bump MaxText pin to release/v26.6
yeandy Aug 5, 2026
21abb77
docs: add MaxDiffusion-from-Primus guide and v26.6 MaxText caveats
yeandy Aug 5, 2026
6313ddf
maxdiffusion: wire JAX coordinator env for multi-node runs
yeandy Aug 5, 2026
b43021b
maxdiffusion(wan2.1_14b): disable RCCL WarpSpeed to fix comm-init hang
yeandy Aug 5, 2026
096530e
make primus-cli work for maxdiffusion
amd-fuyuajin Aug 7, 2026
1dafc1a
Fix fp8-MoE crash on MI300X by pinning pure_nnx_decoder: false
amd-fuyuajin Aug 10, 2026
90e5e9b
maxdiffusion: persist XLA/MIOpen compile caches on MI300X
amd-fuyuajin Aug 10, 2026
cc8d826
fix(logging): surface fatal tracebacks and make --debug work
amd-fuyuajin Aug 10, 2026
f059e02
feat(maxdiffusion): route max_logging through the Primus logger
amd-fuyuajin Aug 10, 2026
9bcac19
Fix gemma4 bf16 pretrain on MI300X with dot_product attention
amd-fuyuajin Aug 10, 2026
ea72b1a
gemma4 fp8 on MI300X: use nanoo_fp8, record both as non-working
amd-fuyuajin Aug 10, 2026
94e1df9
change sqeuence lenght of Qwen3-30B-A3B on MI300X to 4096
amd-fuyuajin Aug 10, 2026
52fa494
MI355X: 4k seq length for gemma4_26B fp8 and qwen3_30B_A3B (bf16+fp8)
yeandy Aug 10, 2026
ceb1777
change sequence length of gemma4_31B to 8192
amd-fuyuajin Aug 11, 2026
5468531
update MI300X gemma4_31B config file
amd-fuyuajin Aug 11, 2026
6ce4fc9
maxtext: name MI300X/MI355X configs <model>-<precision>-pretrain.yaml
amd-fuyuajin Aug 11, 2026
53790aa
fix the config file for flux model on mi300x
amd-fuyuajin Aug 11, 2026
e29d78b
MI355X: use cudnn_flash_te for gemma4
yeandy Aug 11, 2026
ba052cf
third_party/maxtext: bump to 2ec83add (release/v26.6)
yeandy Aug 11, 2026
57ad153
fix(maxdiffusion): make the MI300X and MI355X configs consistent
yeandy Aug 11, 2026
eea17f8
MI300X: use cudnn_flash_te for gemma4
yeandy Aug 11, 2026
966908b
primus/_thirdparty.lock: regenerate from submodule pins
yeandy Aug 11, 2026
3cc97e2
MI355X: raise gemma4 per-device batch size to the measured ceiling
yeandy Aug 12, 2026
873f6af
maxdiffusion: skip env setup when the stack is already installed
yeandy Aug 12, 2026
cd76ff4
Merge remote-tracking branch 'origin/main' into jax-maxtext-v26.6
yeandy Aug 13, 2026
3e1ab17
style: fix pre-commit lint (trailing whitespace, isort, black)
yeandy Aug 13, 2026
b2353a4
docs: trim obsolete dot_product findings from gemma4 configs and docs
yeandy Aug 13, 2026
8c4eb0a
docs: clarify when setup_maxdiffusion_env.sh is needed
yeandy Aug 13, 2026
73027b5
docs: mark wan2.1_14b as validated (timeout fix is in config)
yeandy Aug 13, 2026
453897b
fix: bypass Fp8Einsum in MoE under scan to fix gemma4 FP8 training
yeandy Aug 14, 2026
4982d9b
docs: clarify why mixtral/qwen3 fp8 MoE works (scan_layers=false)
yeandy Aug 14, 2026
c0a64d0
revert: remove fp8 bypass patch, mark gemma4 fp8 as not working
yeandy Aug 14, 2026
9e9e031
fix: skip LD_LIBRARY_PATH injection for JAX backends on gfx950
yeandy Aug 16, 2026
258e27a
Add XLA_PYTHON_CLIENT_MEM_FRACTION=0.96 to 70B MI300X configs
yeandy Aug 18, 2026
1fa44e1
Fix 70B MI300X configs: move XLA_PYTHON_CLIENT_MEM_FRACTION to top-le…
yeandy Aug 18, 2026
ed6d3f3
Merge branch 'main' into jax-maxtext-v26.6
yeandy Aug 21, 2026
371cf9b
Merge branch 'main' into jax-maxtext-v26.6
yeandy Aug 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -463,43 +463,43 @@ jobs:
GLOO_SOCKET_IFNAME: "eth0"
run: |
./runner/primus-cli direct --log_file "${BENCHMARK_LOG_DIR}/maxtext/deepseek_v2_16B.log" \
-- train pretrain --config examples/maxtext/configs/MI300X/deepseek_v2_16B-pretrain.yaml
-- train pretrain --config examples/maxtext/configs/MI300X/deepseek_v2_16B-bf16-pretrain.yaml
- name: "[2/7][MaxText] llama2_70B"
timeout-minutes: 120
continue-on-error: true
run: |
./runner/primus-cli direct --log_file "${BENCHMARK_LOG_DIR}/maxtext/llama2_70B.log" \
-- train pretrain --config examples/maxtext/configs/MI300X/llama2_70B-pretrain.yaml
-- train pretrain --config examples/maxtext/configs/MI300X/llama2_70B-bf16-pretrain.yaml
- name: "[3/7][MaxText] llama2_7B"
timeout-minutes: 120
continue-on-error: true
run: |
./runner/primus-cli direct --log_file "${BENCHMARK_LOG_DIR}/maxtext/llama2_7B.log" \
-- train pretrain --config examples/maxtext/configs/MI300X/llama2_7B-pretrain.yaml
-- train pretrain --config examples/maxtext/configs/MI300X/llama2_7B-bf16-pretrain.yaml
- name: "[4/7][MaxText] llama3.3_70B"
timeout-minutes: 120
continue-on-error: true
run: |
./runner/primus-cli direct --log_file "${BENCHMARK_LOG_DIR}/maxtext/llama3.3_70B.log" \
-- train pretrain --config examples/maxtext/configs/MI300X/llama3.3_70B-pretrain.yaml
-- train pretrain --config examples/maxtext/configs/MI300X/llama3.3_70B-bf16-pretrain.yaml
- name: "[5/7][MaxText] llama3_70B"
timeout-minutes: 120
continue-on-error: true
run: |
./runner/primus-cli direct --log_file "${BENCHMARK_LOG_DIR}/maxtext/llama3_70B.log" \
-- train pretrain --config examples/maxtext/configs/MI300X/llama3_70B-pretrain.yaml
-- train pretrain --config examples/maxtext/configs/MI300X/llama3_70B-bf16-pretrain.yaml
- name: "[6/7][MaxText] llama3_8B"
timeout-minutes: 120
continue-on-error: true
run: |
./runner/primus-cli direct --log_file "${BENCHMARK_LOG_DIR}/maxtext/llama3_8B.log" \
-- train pretrain --config examples/maxtext/configs/MI300X/llama3_8B-pretrain.yaml
-- train pretrain --config examples/maxtext/configs/MI300X/llama3_8B-bf16-pretrain.yaml
- name: "[7/7][MaxText] mixtral_8x7B"
timeout-minutes: 120
continue-on-error: true
run: |
./runner/primus-cli direct --log_file "${BENCHMARK_LOG_DIR}/maxtext/mixtral_8x7B.log" \
-- train pretrain --config examples/maxtext/configs/MI300X/mixtral_8x7B-pretrain.yaml
-- train pretrain --config examples/maxtext/configs/MI300X/mixtral_8x7B-bf16-pretrain.yaml
- name: Generate Summary Report
run: |
echo "Generate Summary Report"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ pp_simulation_result
/nohup.*
/core.*.gpu
.triton_cache_shared/
.jax_cache/
.cursor/
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[submodule "third_party/maxtext"]
path = third_party/maxtext
url = https://github.com/ROCm/maxtext.git
branch = release/v26.5
branch = release/v26.6
[submodule "third_party/Emerging-Optimizers"]
path = third_party/Emerging-Optimizers
url = https://github.com/NVIDIA-NeMo/Emerging-Optimizers.git
Expand All @@ -23,6 +23,9 @@
[submodule "third_party/HummingbirdXT"]
path = third_party/HummingbirdXT
url = https://github.com/AMD-AGI/HummingbirdXT.git
[submodule "third_party/maxdiffusion"]
path = third_party/maxdiffusion
url = https://github.com/AI-Hypercomputer/maxdiffusion.git
[submodule "third_party/Automodel"]
path = third_party/Automodel
url = https://github.com/NVIDIA-NeMo/Automodel.git
Expand Down
96 changes: 83 additions & 13 deletions docs/02-user-guide/pretraining.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The following table describes the four backend types supported by Primus and the
| Megatron-LM | `framework: megatron` | Large-scale transformer pretraining with Megatron-style parallelism (TP/PP/EP). |
| TorchTitan | `framework: torchtitan` | PyTorch-native scaled training (FSDP / tensor / pipeline / expert parallelism per config). |
| MaxText (JAX) | `framework: maxtext` | JAX/MaxText single- and multi-node runs; parallelism via MaxText `ici_*` / `dcn_*` settings. |
| MaxDiffusion (JAX) | `framework: maxdiffusion` | JAX/MaxDiffusion diffusion pretraining (WAN 2.1, FLUX.1-dev). Source is vendored as the `third_party/maxdiffusion` submodule; deps/patches installed by `examples/maxdiffusion/setup_maxdiffusion_env.sh`. |
| Megatron Bridge | `framework: megatron_bridge` | Bridge-oriented workflows (configure like other backends; see parameter reference). |

> Several setup steps apply to **all** backends (mock vs. real data, Hugging Face tokens, scaling to multiple nodes, and HipBLASLt autotuning). After you read the backend section that applies to you, see [Common patterns](#common-patterns) below.
Expand Down Expand Up @@ -197,7 +198,7 @@ Some configurations omit an explicit `parallelism:` block; in that case the defa

```bash
./runner/primus-cli container -- train pretrain \
--config examples/maxtext/configs/MI300X/llama2_7B-pretrain.yaml
--config examples/maxtext/configs/MI300X/llama2_7B-bf16-pretrain.yaml
```

### JAX-specific requirements
Expand All @@ -212,18 +213,87 @@ pip install -r requirements-jax.txt

| File | Key parallelism (`ici_*` intra-node, `dcn_*` inter-node) |
| --- | --- |
| `deepseek_v2_16B-pretrain.yaml` | `ici_fsdp_parallelism: 1`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `grok1-pretrain.yaml` | `ici_fsdp_parallelism: 1`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `llama2_70B-pretrain.yaml` | `ici_fsdp_parallelism: 8`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `llama2_7B-pretrain.yaml` | `ici_fsdp_parallelism: 8`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `llama3.3_70B-pretrain.yaml` | `ici_fsdp_parallelism: 8`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `llama3_70B-pretrain.yaml` | `ici_fsdp_parallelism: 8`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `llama3_8B-pretrain.yaml` | `ici_fsdp_parallelism: 8`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `mixtral_8x7B-pretrain.yaml` | `ici_fsdp_parallelism: 1`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `qwen3_14B-pretrain.yaml` | `ici_fsdp_parallelism: 8`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `qwen3_30B_A3B-pretrain.yaml` | `ici_fsdp_parallelism: 1`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |

The `llama2_7B-pretrain.yaml` example also sets `dataset_type: "synthetic"` and `hf_access_token: ${HF_TOKEN:""}` for gated Hugging Face assets when you switch to real data.
| `deepseek_v2_16B-bf16-pretrain.yaml` | `ici_fsdp_parallelism: 1`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `grok1-nanoo_fp8-pretrain.yaml` | `ici_fsdp_parallelism: 1`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `llama2_70B-bf16-pretrain.yaml` | `ici_fsdp_parallelism: 8`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `llama2_7B-bf16-pretrain.yaml` | `ici_fsdp_parallelism: 8`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `llama3.3_70B-bf16-pretrain.yaml` | `ici_fsdp_parallelism: 8`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `llama3_70B-bf16-pretrain.yaml` | `ici_fsdp_parallelism: 8`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `llama3_8B-bf16-pretrain.yaml` | `ici_fsdp_parallelism: 8`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `mixtral_8x7B-bf16-pretrain.yaml` | `ici_fsdp_parallelism: 1`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `qwen3_14B-bf16-pretrain.yaml` | `ici_fsdp_parallelism: 8`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |
| `qwen3_30B_A3B-bf16-pretrain.yaml` | `ici_fsdp_parallelism: 1`, `ici_data_parallelism: 1`, `dcn_fsdp_parallelism: 1`, `dcn_data_parallelism: -1` |

The `llama2_7B-bf16-pretrain.yaml` example also sets `dataset_type: "synthetic"` and `hf_access_token: ${HF_TOKEN:""}` for gated Hugging Face assets when you switch to real data.

> **fp8 MoE (v26.6):** fp8 Mixture-of-Experts configs must set `pure_nnx_decoder: false` in their overrides; otherwise they crash at step 1 under the v26.6 pure-NNX decoder default. See [MaxText parameters → Precision and quantization](../03-configuration-reference/maxtext-parameters.md#7-precision-and-quantization). Dense fp8 and bf16 configs are unaffected.

---

## MaxDiffusion (JAX) pretraining

The MaxDiffusion backend runs JAX diffusion pretraining (WAN 2.1, FLUX.1-dev). Environment setup depends on your image:

| Image has `maxdiffusion` installed? | What happens |
| --- | --- |
| **Yes** (e.g. MAD `primus_maxdiffusion` image, unified docker) | `setup_maxdiffusion_env.sh` detects it and is a **no-op**. Set `PRIMUS_SKIP_PIP=1` to skip calling it entirely. |
| **No** (e.g. bare `rocm/jax-training:maxtext-*` image) | The script installs everything from the Primus checkout: torch (ROCm wheels), deps, editable submodule, and patches. Requires `third_party/maxdiffusion` submodule to be initialized. |

The relevant pieces:

- **Source** is vendored as the `third_party/maxdiffusion` submodule.
- **Dependencies** live in `requirements-maxdiffusion.txt` (kept separate from `requirements-jax.txt` so the MaxDiffusion pins never affect MaxText runs).
- **Install + patches** are applied by `examples/maxdiffusion/setup_maxdiffusion_env.sh` (idempotent): torch/torchvision (ROCm wheels), the requirements above, an editable install of the vendored submodule, and four source patches (Flax-T5 clip rename, TensorFlow-preload-before-TransformerEngine, Shardy-on, and the TransformerEngine empty context-parallel-axis fix).

### Prerequisites

Initialize the vendored submodule (a plain clone will not populate it):

```bash
git submodule update --init third_party/maxdiffusion
```

Run on a JAX base image (for example `rocm/jax-training`) or a bare-metal JAX environment, and export `HF_TOKEN` for gated Hugging Face assets.

### Quick start (run from a bare Primus checkout)

Use `run_pretrain.sh` with `BACKEND=MaxDiffusion`. When `PRIMUS_SKIP_PIP` is unset, the launcher runs `setup_maxdiffusion_env.sh` for you (installs the stack + applies the patches), sets `NVTE_FRAMEWORK=jax` and `MAXDIFFUSION_PATH`, then launches:

```bash
BACKEND=MaxDiffusion \
EXP=examples/maxdiffusion/configs/MI355X/wan2.1_1.3b-pretrain.yaml \
bash ./examples/run_pretrain.sh
```

To run the environment setup once by itself (e.g. to warm an image or a shared venv), invoke the script directly, then launch with `PRIMUS_SKIP_PIP=1`:

```bash
bash examples/maxdiffusion/setup_maxdiffusion_env.sh
PRIMUS_SKIP_PIP=1 BACKEND=MaxDiffusion \
EXP=examples/maxdiffusion/configs/MI355X/flux_dev-pretrain.yaml \
bash ./examples/run_pretrain.sh
```

### Quick start (container mode)

`primus-cli` bootstraps the same environment: the `train/pretrain/maxdiffusion` prepare hooks run `setup_maxdiffusion_env.sh` before training and select the plain-python launcher (JAX drives every GPU from one process, so `torchrun` is never used).

```bash
./primus-cli container -- train pretrain \
--config examples/maxdiffusion/configs/MI300X/wan2.1_1.3b-pretrain.yaml --max_train_steps 10
```

> Container launches start from a clean image each time, so the setup runs on every launch. Wheels are cached under `$DATA_PATH/pip_cache` inside the mounted checkout, so only the first run pays for downloads. Set `PRIMUS_SKIP_PIP=1` to skip the step entirely on images that already ship the stack.

> Step counts use `--max_train_steps` (the MaxDiffusion field name). `--steps` belongs to MaxText and is silently ignored here.

### Example configurations under `examples/maxdiffusion/configs/MI355X/`

| File | Model | Status on MI355X (gfx950) |
| --- | --- | --- |
| `flux_dev-pretrain.yaml` | FLUX.1-dev | ✅ validated |
| `wan2.1_1.3b-pretrain.yaml` | WAN 2.1 1.3B | ✅ validated |
| `wan2.1_14b-pretrain.yaml` | WAN 2.1 14B | ✅ validated (requires `RCCL_WARP_SPEED_AUTO=0`, set in config) |

---

Expand Down
10 changes: 6 additions & 4 deletions docs/03-configuration-reference/maxtext-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ These are Primus overlay defaults. MaxText also loads upstream `base.yml` at run
| `checkpoint_is_quantized` | `false` | Set `true` when loading an AQT-quantized checkpoint. |
| `logits_dot_in_fp32` | `false` | Compute logits matmul in `float32` for numerical stability. |

**fp8 + MoE (v26.6):** MoE fp8 configs (e.g. `mixtral_8x7B-fp8`, `qwen3_30B_A3B-fp8`) must set `pure_nnx_decoder: false`. v26.6 defaults to `true`, which invokes the legacy Linen `Fp8Einsum` without a binding scope. See [Advanced](#9-advanced). Dense fp8 configs are unaffected.

---

Expand All @@ -123,7 +124,7 @@ From `model_base.yaml` and per-model files such as `llama3_8B.yaml`.
| ----------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `model_name` | `"default"` in `model_base`; e.g. `"llama3-8b"` in `llama3_8B.yaml` | Selects MaxText’s bundled model YAML when present. |
| `override_model_config` | `true` | When `true`, CLI / kwargs override values from the loaded model config. |
| `attention` | `"cudnn_flash_te"` | Attention implementation (Primus default favors TE flash on AMD GPUs). |
| `attention` | `"autoselected"` | Attention implementation. **gemma4 requires `cudnn_flash_te`**: its local layers use sliding-window attention, and only `cudnn_flash_te` passes the window to the kernel (as `window_size`). `autoselected` resolves to a pallas kernel that builds a plain causal mask and silently drops the window. |
| `use_iota_embed` | `true` | Use iota-based embedding for performance on accelerator backends. |
| `tokenizer_path` | e.g. `"meta-llama/Meta-Llama-3-8B"` | Hugging Face tokenizer id or local path. |

Expand All @@ -133,9 +134,10 @@ From `model_base.yaml` and per-model files such as `llama3_8B.yaml`.
## 9. Advanced


| Parameter | Default | Description |
| --------- | ------- | --------------------------------------------------------------------- |
| `shardy` | `false` | Enable Shardy-related integration in MaxText when building shardings. |
| Parameter | Default | Description |
| ------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `shardy` | `false` | Enable Shardy-related integration in MaxText when building shardings. |
| `pure_nnx_decoder` | `true` | Run the decoder as pure Flax NNX. As of v26.6 the base config defaults this to `true`. **fp8 MoE configs must override this to `false`** — the legacy per-module Linen `Fp8Einsum` (used by the MoE sparse-matmul quant path) needs an active Linen binding scope, and the pure-NNX decoder invokes it unbound, crashing at the first step. See the note in [Precision and quantization](#7-precision-and-quantization). |


---
Expand Down
2 changes: 1 addition & 1 deletion docs_deprecated/cli/PRIMUS-CLI-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ If you are using AINIC in your cluster, you can use the `runner/use_ainic.yaml`

Here is an example of using the AINIC configuration file to run a training job:
```bash
./primus-cli --config runner/use_ainic.yaml slurm srun -N 2 -- train pretrain --config examples/maxtext/configs/MI355X/llama2_7B-pretrain.yaml
./primus-cli --config runner/use_ainic.yaml slurm srun -N 2 -- train pretrain --config examples/maxtext/configs/MI355X/llama2_7B-bf16-pretrain.yaml
```

### Configuration Priority
Expand Down
6 changes: 6 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ export EXP=examples/megatron/configs/MI300X/llama3.1_8B-BF16-pretrain.yaml
export EXP=examples/torchtitan/configs/MI300X/llama3.1_8B-pretrain.yaml
./primus-cli direct -- train pretrain --config "$EXP"

# MaxDiffusion (JAX) directly from Primus (on a JAX base image, e.g. rocm/jax-training).
# Requires the vendored submodule: git submodule update --init third_party/maxdiffusion
# run_pretrain.sh runs examples/maxdiffusion/setup_maxdiffusion_env.sh to install deps + patches,
# then launches. See docs/02-user-guide/pretraining.md ("MaxDiffusion (JAX) pretraining").
BACKEND=MaxDiffusion EXP=examples/maxdiffusion/configs/MI355X/wan2.1_1.3b-pretrain.yaml bash ./examples/run_pretrain.sh

```

---
Expand Down
Loading
Loading