feat(maxtext): add fp8 and nanoo_fp8 pretrain configs for MI300X/MI355X - #925
Open
yeandy wants to merge 4 commits into
Open
feat(maxtext): add fp8 and nanoo_fp8 pretrain configs for MI300X/MI355X#925yeandy wants to merge 4 commits into
yeandy wants to merge 4 commits into
Conversation
Adds per-precision MaxText experiment configs (fp8, nanoo_fp8) derived from the existing bf16 configs by setting `quantization` in overrides, for 9 models across MI300X and MI355X. Upstream MaxText previously shipped only bf16 (`<model>-pretrain.yaml`); this fills the fp8/nanoo_fp8 gap so quantized runs can be launched by config path.
yeandy
requested review from
Xiaoming-AMD,
limou102 and
wenxie-amd
as code owners
July 27, 2026 21:22
…MI355X fp8) MI300X uses NANOO FP8 and MI355X uses FP8, so drop the unused plain-fp8 configs on MI300X and the unused nanoo_fp8 configs on MI355X. Each device keeps bf16 plus its supported quantization.
Adds the fp8 quantized variant for Llama 3.1 405B on MI355X (bf16 already existed); MI355X uses FP8.
…mem_fraction 0.96 Add a single, launcher-agnostic hook for per-config environment overrides: TrainRuntime._apply_config_env() reads a top-level `env:` mapping from the experiment YAML and exports it to os.environ right after config load, before runtime env / distributed init / any `import jax`. The block lives outside `modules:`, so it is never swept into module params nor forwarded to MaxText. Per-config `env:` wins over image-baked defaults. MaxTextAdapter.prepare_backend() applies arch defaults via os.environ.setdefault (gfx950 -> RCCL_WARP_SPEED_AUTO=0) so they never override a per-config `env:`. Precedence (highest wins): per-config env: > arch defaults > image bake. Use it to run mixtral_8x7B at per_device_batch_size=11 on a single MI355X: set XLA_PYTHON_CLIENT_MEM_FRACTION=0.96 (image default 0.9 is too low; bs11 peaks ~270-274 GB / 288 GB) and moe_dispatch_no_expert_sharding=true. Applied to both the bf16 (mixtral_8x7B-pretrain) and fp8 (mixtral_8x7B-fp8-pretrain) MI355X configs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds per-precision MaxText experiment configs (fp8, nanoo_fp8) derived from the existing bf16 configs by setting
quantizationin overrides, for 9 models across MI300X and MI355X. Upstream MaxText previously shipped only bf16 (<model>-pretrain.yaml); this fills the fp8/nanoo_fp8 gap so quantized runs can be launched by config path.