MaxText backend configuration reference#
Primus routes experiment YAML into the MaxText stack (JAX / XLA). Configuration is a flat map of keys (no nested training.* trees like TorchTitan): Primus merges module and model presets, writes a temporary YAML, and MaxText’s pyconfig.initialize loads it on top of upstream defaults.
The Primus overlay keeps base_config: "base.yml" so MaxText loads its own configs/base.yml at runtime. This page lists Primus-defined defaults and commonly overridden Primus fields. For the full upstream parameter set (hundreds of keys), see the MaxText documentation and upstream base.yml.
How parameters flow#
YAML presets under
primus/configs/modules/maxtext/andprimus/configs/models/maxtext/are merged with CLI overrides.MaxTextAdapter.convert_configpasses the merged namespace throughMaxTextConfigBuilder(currently a thin pass-through).export_params_to_yamlwrites a flat YAML file; MaxText ignores unknown Primus-private keys via pydantic filtering.Unknown keys from upstream still resolve through environment overrides inside MaxText (
pyconfig), not shown here.
1. Base module parameters#
Shared with all Primus modules via module_base.yaml and trainer extensions.
Parameter |
Default (Primus) |
Description |
|---|---|---|
|
|
When |
|
|
Structured logging sink level for the module (if the logging stack is configured to use it). |
|
|
File sink verbosity. |
|
|
Stderr sink verbosity. |
2. Training#
From pre_trainer.yaml (extends trainer_base.yaml).
Parameter |
Default |
Description |
|---|---|---|
|
|
Upstream MaxText base file loaded by |
|
|
Hardware target string consumed by MaxText. |
|
|
Global optimizer steps for the run. |
|
|
Steps between log emissions. |
3. Data#
Parameter |
Default |
Description |
|---|---|---|
|
|
Dataset backend selector (Hugging Face in the default path). |
|
|
Hugging Face dataset repo or identifier. |
|
|
Subdirectory / config slice within the HF dataset. |
|
|
Optional explicit train file list (format per MaxText HF loader). |
|
|
Sequence packing for efficiency when supported by the data pipeline. |
4. Checkpointing#
These are Primus overlay defaults. MaxText also loads upstream base.yml at runtime through base_config: "base.yml", where upstream checkpoint defaults might differ. When debugging effective behavior, distinguish the Primus YAML written by the adapter from the upstream MaxText defaults loaded afterward.
Parameter |
Default |
Description |
|---|---|---|
|
|
See Training section. |
|
|
When |
5. Profiling#
Parameter |
Default |
Description |
|---|---|---|
|
|
Profiler backend (e.g. XPlane for JAX). |
|
|
Warmup steps excluded from capture. |
|
|
Number of steps to profile once active. |
6. Memory and recomputation#
Parameter |
Default |
Description |
|---|---|---|
|
|
Activation rematerialization policy ( |
|
|
Offload optimizer state to host memory when supported. |
|
|
Use scanned layer implementation where applicable. |
|
|
Axis for parameter scanning / partitioning layout. |
7. Precision and quantization#
Parameter |
Default |
Description |
|---|---|---|
|
|
Default compute dtype for many ops. |
|
|
Quantization mode string (empty = none; set per MaxText AQT recipes). |
|
|
Quantize KV cache tensors. |
|
|
KV quantization axis naming for kernels. |
|
|
Storage dtype for KV cache when quantization is on. |
|
|
Weight storage / compute dtype for non-quantized paths. |
|
|
Set |
|
|
Compute logits matmul in |
8. Model#
From model_base.yaml and per-model files such as llama3_8B.yaml.
Parameter |
Default |
Description |
|---|---|---|
|
|
Selects MaxText’s bundled model YAML when present. |
|
|
When |
|
|
Attention implementation (Primus default favors TE flash on AMD GPUs). |
|
|
Use iota-based embedding for performance on accelerator backends. |
|
e.g. |
Hugging Face tokenizer id or local path. |
9. Advanced#
Parameter |
Default |
Description |
|---|---|---|
|
|
Enable Shardy-related integration in MaxText when building shardings. |