Skip to content

maxtext-v0.2.7

Latest

Choose a tag to compare

@SurbhiJainUSC SurbhiJainUSC released this 04 Dec 18:00

Changes

Models
  • DeepSeek-V4.1-Flash (Text) Architecture: Added the DeepSeek-V4.1-Flash text backbone (deepseek4.1-flash.yml and deepseek4.1-flash-mini.yml) featuring 4-stream hyper-connections (hc=4), dedicated attention and Engram layers, HuggingFace parameter mappings, and on-the-fly FP8/FP4 checkpoint loading.
  • Wan 2.1 I2V 14B 480P Architecture: Brought up the Wan 2.1 I2V 14B 480P image-to-video model (wan2.1-i2v-14b-480p.yml) in MaxText-M3, adding image_encoder_wan.py alongside checkpoint conversion and pipeline updates.
  • GLM-5.2 and GLM-5.1 Architecture & Native IndexShare: Onboarded the 744B (78-layer: 3 dense + 75 MoE) GLM-5.1 and GLM-5.2 model architectures (GlmMoeDsaForCausalLM, DecoderBlockType.GLM5) with cross-layer Multi-Head Latent Attention (MLA) IndexShare (use_index_share, index_share_pattern, prune_shared_indexers), multi-layer KL distillation for donor indexers, MoEBiasVar routed bias tracking, bidirectional HuggingFace SafeTensors and Orbax checkpoint conversion, parameter-only checkpoint generation, and model documentation (convert checkpoint, models, glm5).
  • Gemma 4 26B MoE Optimizations: Optimized Gemma 4 26B MoE training on TPU by sharding Gemma4MoE.pre_forward_scale_2 on the norm axis to eliminate per-layer 1D all-reduces, implementing direct split-half RoPE in embeddings, adding a custom VJP for _split_gate_up to concatenate gate and up half-gradients in a single step, and introducing moe_unsliced_prefused_wi to pass fused wi across shard_map as a single operand and eliminate an all-gather per layer.
  • Hy4 Explicit Sharding & FSDP Weight Prefetch: Enabled explicit sharding (shard_mode=explicit) and FSDP weight prefetch with deferred backward reduce-scatter for the Hy4 decoder, resolving sharding mismatches across Hy4 layers and dot-product attention with learnable attention sinks.
  • DeepSeek Engram Tokenizer Memoization: Memoized the engram tokenizer and NgramHashMapping across engram layers in DeepSeek models (src/maxtext/models/deepseek.py), eliminating repeated tokenizer decoding passes during model initialization.
  • Wan 2.2 TI2V 5B Architecture: Brought up the Wan 2.2 TI2V 5B text-to-video model in MaxText-M3, adding the Wan 2.2 residual VAE with 48 latent channels and 2x2 patchification, mapping parameters in WAN2_1_HF_TO_MAXTEXT, and registering conversion and sampling pipelines.
  • Kimi-K3 Architecture & Onboarding: Added the Kimi-K3 model architecture featuring KDA/MLA hybrid attention, latent MoE feed-forward layers, Attention Residuals (AttnRes), SiTU activations, scanned layer execution (scan_layers), and HuggingFace checkpoint parameter and shape mappings.
  • M3 Parameter Sharding & Conformance Suite: Sharded M3 model parameters directly from their logical axes, and expanded the M3 conformance suite with Checks 9a–9c (bfloat16 forward parity, packing and padding isolation, expert parallel parity) and Checks 10–12 (optimizer update and frozen weight decay, sharded checkpoint slice loading, full-scale topology ahead-of-time and remat HBM verification).
Pre-Training
  • M3 Diffusion Training Loop for Wan 2.x: Added the M3 diffusion training loop (src/maxtext/m3/train/loop_diffusers.py) with flow-matching loss, AdamW optimization, per-layer nnx.remat, synthetic and TFRecord latent inputs, and the wan2.1-t2v-1.3b.yml configuration.
  • GatedDeltaNet Chunk Rule Optimization: Optimized the GatedDeltaNet (GDN) chunk rule with block-doubling VJP and head-repeat elimination.
  • Cross-Entropy bfloat16 Logits Residual & Stochastic Rounding: Added ce_bf16_logits_residual (and residual_dtype on cross_entropy_with_logits) to save model-dtype logits for the cross-entropy backward pass, and added param_update_stochastic_rounding to preserve small optimizer updates on bfloat16 weights without an fp32 master copy.
  • Tokamax GatedDeltaNet Adapter & Optimizations: Added the Tokamax GatedDeltaNet adapter (use_tokamax_gdn) for qwen3_next and qwen3_5 to dispatch chunked GDN recurrence onto Mosaic TPU kernels across auto and explicit sharding, and unlocked configurable chunk sizes up to 128, two-pass bfloat16 computation (gdn_two_pass_bf16), multi-document sequence packing, and sequence-mode context parallelism (cp_size > 2).
  • DeepSeek-V4 Two-Pass CSA Indexer Teacher: Added an opt-in two-pass unchunked teacher (csa_teacher_two_pass) in calculate_csa_indexer_loss that computes logsumexp and recomputes softmax exponentiation from bfloat16 scores across passes with an intermediate optimization barrier, avoiding large 4-D float32 probability allocations and loop-invariant mask broadcasts during scanned layer execution.
  • Bidirectional Full Attention on TPU Ulysses Context Parallelism: Enabled non-causal bidirectional full attention (attention_type="full") on TPU Ulysses context parallelism meshes, constructed Tokamax FullMask on the Ulysses Splash attention path for bidirectional and packed-segment sequences, protected causal pre-training objectives from label leakage, and updated non-causal FLOPs accounting (sharding).
  • Shared M3 Splash Attention Kernels: Added shared AttentionKernel and SplashConfig descriptors in src/maxtext/m3/core/kernels.py supporting splash, tokamax, and xla backends with static sharding descriptors, TPU v7x SEQ_MINOR and HEAD_DIM_MINOR layouts, sliding-window LocalMask, GQA 2x query-head stacking (sa_gqa_head_stacking), and packed-sequence segment masking.
  • Context Parallelism & Ulysses Attention Optimizations: Added attention-local context-parallel load balancing with hoisted load-balancing IDs and no-self-copy ordering, and enhanced Ulysses attention with GQA/MQA KV head replication for small head counts, packed QKV all-to-all communication, layout pinning, and ulysses_qkv remat (sharding).
  • Sparse-Indexer Context-Parallel Memory Optimization: Implemented a memory-efficient backward pass for the sparse-indexer context-parallel attention path, resolving out-of-memory compilation bottlenecks at 128K context lengths on multi-chip slices.
  • GatedDeltaNet Pre-Training Optimizations: Added Pure-JAX sequence packing, segmented Conv1D, and block-doubling chunk inversion; deferred GQA jnp.repeat inside chunk and autoregressive gated delta rules to execute matmuls at key head dimensions; and added projection/norm layouts, optional embed_gdn logical axis support, and FP8 projection kernels for GDN layers.
  • DeepSeek-V4 Rotary Embedding Numerical Parity: Computed DeepSeek-V4 RoPE inv_freq on the host CPU in float64 math to prevent XLA power approximation drift on TPU and match PyTorch reference values bit-exactly.
  • Vocabulary Tiling Loss Optimization: Merged forward and backward scans in NNX vocabulary tiling loss to reduce scan overhead and optimize memory bandwidth during tiled cross-entropy computation.
  • Compressed Self-Attention Mask Construction: Added use_csa_vmap_selection_mask to support constructing the Compressed Self-Attention (CSA) top-k selection mask via a vmapped scatter of selected block IDs as an alternative to broadcast-compare operations.
  • JAX Pre-Training Upgrade: Upgraded JAX to 0.12.0.1 for pre-training environments.
Post-Training
  • Ming Thinker Audio SFT: Added speech + text to text supervised fine-tuning (SFT) for the Ming thinker (sft-audio-gigaspeech.yml), including a Grain Parquet audio preprocessing branch (train_audio_column, eval_audio_column, audio_max_mel_frames), dummy audio batch sizing, and nnx_aux/model checkpoint restoration.
  • Weight Sync & Weight Planner Enhancements: Added a sampler weight spec check before Raiden bind, JIT-cached non-identity target-free conversion groups in MaxTextToMaxTextConverter.convert_streaming, and replaced per-step gc.collect() calls during Raiden buffer purging with explicit .delete() of unaliased staged jax.Array buffers.
  • vLLM Scanned Checkpoint Layout Auto-Detection: Added automatic scanned checkpoint layout detection to scanned_checkpoint_loader along with fixes for padded MoE restoration and unsharded pre-fused wi splitting.
  • Weight Planner Infrastructure & Layout Metadata: Introduced weight layout metadata structures and leaf name flattening in maxtext.weights.layout as part of the consolidated weight conversion package, and added the use_weight_planner and weight_sync_manifest_check configuration flags with validation across training and RL configs.
  • Tunix Post-Training Dependency Update: Updated the google-tunix post-training dependency pin to commit 21fa70f92a (version 0.1.9) in post_train_github_deps.txt, relaxing JAX version bounds and enabling grpo_loss_fn to read the sampler.
  • Tunix Post-Training Sharding & CP Validation: Explicitly rejected load-balanced context parallelism in non-SFT post-training workflows (train_dpo, train_rl, train_distill, and save_top_k_teacher_logits) to prevent token misalignment, and passed 2D mesh weight sharding directly to Tunix.
  • vLLM Rollout & Hybrid Cache Integration: Added scanned_checkpoint_loader (ScannedCheckpointTarget and load_and_convert_scanned_checkpoint) for in-process vLLM rollout weights, installed dual-pool TPUHybridKVCacheCoordinator hooks during patched_get_kv_cache_spec for hybrid Qwen3-Next and Qwen3.5 rollouts, and added generic vLLM >= 0.33 hybrid Mamba configuration hooks and MambaMetadata state index mapping.
  • Gemma 4 GRPO RL Recipe: Added an end-to-end GRPO RL training recipe and tutorial for Gemma4-e2b on TPU v7x using OpenMathInstruct-2 with 8k response lengths (post training index, rl gemma4 e2b).
  • SFT Context Parallelism Load Balancing: Added batch reordering hooks to SFTDataHooks when context_parallel_load_balance=True, permuting train and evaluation batches to align token order with load-balanced causal attention masks, and reordered completion masks for block-diffusion SFT.
  • Tunix RL Integration & Diagnostics: Updated the google-tunix dependency pin to support the callback-based with_fwd_only_fn trainer API, aligned GRPO engine compilation and loss tests, and labeled MaxText RL Managed ML Diagnostics runs with rl_orchestrator=tunix.
Multimodal
  • Model-Agnostic Synthetic Multimodal Dataset: Added SyntheticMultimodalDataSource in src/maxtext/data/synthetic_multimodal.py for dataset-level synthetic multimodal benchmark and testing workloads, supporting RGB image generation with configurable resolutions and counts per example via synthetic_modalities.
  • Ming Audio Processing & Conversion: Added audio conversion utilities, processor implementations, audio decoding pipelines, and configuration support for Ming talker models (ming-3.0-audio-tiny-talker.yml).
Performance
  • Shared M3 MoE Executor & Dropless EP Overflow Buffer: Added the shared MoEExecutor (src/maxtext/m3/core/moe.py) supporting dense, ragged_dot, gmm_v2, and tokamax backends with EP/TP ragged_all_to_all dispatch/combine and zero expert-weight all-gather, adopted it for Qwen3.8, GraniteMoE, and multi-rank EP GLM-5.3, and added a capacity-bounded multi-round dropless MoE EP overflow buffer (moe_dropless_buffer_factor).
  • SparseCore MoE Gather-Reduce, Custom Remat, & Scale Folding: Added moe_sc_gather_reduce (default off) to gather tokens directly into expert order and run top-k sums (num_experts_per_tok in 1, 2, 4, or 8) on the TPU v7x SparseCore gather-reduce kernel, added the moe_routed_output custom-remat tensor in RoutedMoE for remat_policy=custom, and added moe_fold_expert_scale_into_wo (default off) for Gemma 4 sparse_matmul training to fold per_expert_scale into sharded wo once instead of per token.
  • MoE FP8 Replication & Unpermute Alignment: Wired dynamic and static FP8 replication into RoutedMoE, and enabled transposed MoE combine in RoutedMoE.unpermute whenever num_experts_per_tok % 8 != 0 to keep tokens sublane-aligned on pure-FSDP runs.
  • Sharded Muon Optimizer Enhancements: Added the opt-in muon_per_head_qkv flag for independent per-head Muon orthogonalization on attention QKV projections, selected the minimal subset of matrix mesh axes for Muon batch all-to-all (_select_minimal_matrix_axes), and grouped compatible padded 3D Muon leaves across the parameter tree before batch all-to-all (pack_compatible_tensors).
  • Rematerialization & FSDP Prefetch Intermediate Propagation: Added M3 rematerialization, hybrid loop barriers, and activation savepoints; added scan_remat_prevent_cse to set prevent_cse=True on scanned decoder layer jax.checkpoint regions; and propagated sown nnx.Intermediate state through fsdp_prefetch when propagate_intermediates=True (fsdp prefetch).
  • GPU Collective Overlap Priority Scheduling: Added priority scheduling to gpu_collective_overlap_pass.py so high-priority ops are preserved during latency-hiding scheduling, and updated instruction matching for XLA module fingerprint prefixes.
  • Single-Trace AOT Abstract State Initialization: Added get_abstract_state_nnx_with_graphdef so train_compile.get_shaped_inputs obtains abstract_state, annotations, shardings, and graphdef in a single nnx.eval_shape trace without redundant model init tracing.
  • Ring-of-Experts Chunk Pipeline Schedules & Row-Major Reduce-Scatter: Added opt-in Ring-of-Experts chunk scheduling modes (moe_ring_pipeline_mode="combine_per_chunk" and "software_pipeline") to overlap SparseCore token all-gathers and combine reduce-scatters with TensorCore expert GEMMs without backward optimization barriers, added forward-only row-major reduce-scatter layout constraints (ring_of_experts_row_major_reduce_scatter=True) to avoid layout transpose copies, preserved chunk ordering across remat policies, and guarded pipelining against runtime moe_chunk_barrier overrides.
  • MoE Compacted Fallback Capacity & Packed RoE Routing Gather: Added moe_fallback_topk_capacity to compact tokens requiring router fallback under router replay into bounded rows and skip full top_k on forced and padding tokens, added moe_roe_packed_routing_gather to route local tokens once and all-gather routing state as a single tensor across the EP group under Ring-of-Experts, and aligned token_mask partitioning in RoutedMoE.sparse_matmul.
  • M3 Sub-8-bit & Microscaling (MX) Quantization: Added int4, fp4, and OCP Microscaling (MX) quantization recipes (jax_mxfp8 and jax_mxfp4) in src/maxtext/m3/infra/quantization.py.
  • Qwix KV-Cache Quantization: Migrated KV-cache quantization from AQT to Qwix (quantize_kvcache=True), storing cached keys and values in kv_quant_dtype (int8, int4, or fp8 / float8_e4m3fn) with bfloat16 scales for decoding while keeping prefill in full precision.
  • MoE Quantization & FP8 Weight Replication: Added static-scale FP8 quantization to MoE expert-parallel ragged all-to-all communications (moe_quantize_token_all_to_all_method="static_scale" and moe_quantize_combine_bwd_method="static_scale") (quantization), and supported home-quantized FP8 weight replication in moe_replica_weights by quantizing weights on home shards before dispatch and skipping scale collectives under fixed calibration.
  • MoE 3D GMM & TGMM Upstream Tokamax Routing: Routed explicit-tile 3D-involved gmm_v2 and tgmm_v2 calls in src/maxtext/kernels/megablox/ops.py to upstream Tokamax (gmm_fuser and gmm_v2 / tgmm_v2) for aligned dividing 3D shapes without partial sum at 0.96 VMEM budget when tokamax >= 0.0.18.
  • Fused TensorCore Pallas MoE Combine & Permute Kernels: Added experimental fused TensorCore Pallas kernels for MoE token permute and combine (moe_tc_combine and moe_tc_permute) forward and backward passes during pure-FSDP MoE training (moe configuration).
  • M3 Multi-Axis Mesh, Explicit Sharding, and Sequence Parallelism: Extended src/maxtext/m3/core/sharding.py with 8-axis and custom ring mesh construction, explicit sharding (ShardMode.EXPLICIT) on Qwen3 models including ZeRO-1 support, and Megatron Sequence Parallelism via ici_tensor_sequence_parallelism and dcn_tensor_sequence_parallelism.
  • Pure-FSDP MoE Combine Transpose Gating: Gated (k, tokens) routing transpose before combine in RoutedMoE.unpermute on ep_size > 1, prefetch_fsdp_weights, or moe_use_direct_token_gather, falling back to direct (tokens, k) combine on pure-FSDP runs to avoid redundant transposes and activation gathers.
  • Online Hot-Expert Replication: Added dynamic online hot-expert replica planning, weight-move operations, configuration flags and validation, and integration into RoutedMoE to replicate frequently activated experts across devices at runtime.
  • MoE Padding Exclusion & Routing Remat: Added moe_exclude_padding_from_routing to activate padding token masks and prevent zero-segment padding tokens from consuming routing capacity in packed RL micro-batches (moe configuration), and supported preserving top-k and packed routing state across remat boundaries via moe_packed_routing_maps.
  • Ring-of-Experts & Ragged Routing Enhancements: Added count-based routing index math (moe_routing_index_math="count"), ragged sort full-buffer index clamping, and masked unsort spread for Ring-of-Experts; enabled multi-chunk token processing (num_moe_token_chunks > 1) on the ragged all-to-all expert-parallel path; and extended log_required_ragged_buffer_factor logging.
  • MoE Quantization Enhancements: Added per-leg rowwise FP8 quantization to MoE expert-parallel ragged all-to-all communications (quantization), and supported dynamic absmax weight scaling for MoE quantized weight all-gather (QWAG) (moe configuration).
  • SparseCore & GMM Kernel Optimizations: Accelerated partly filled tile computation in 128- and 256-row chunks on TPU v7x in gmm_v2, capped ragged_gather_reduce_v2 column chunk sizes on large Ring-of-Experts inputs to fit within SparseCore memory, and re-enabled layout passes in ragged_gather_reduce_v2 via bitcast conversions.
  • Qwen3-235B TPU v7x Collective & Host Prefetch Overlap: Overlapped exposed collectives and host prefetch for Qwen3-235B on TPU v7x, including fused QKV and MoE fused GMM3D kernel optimizations.
  • FSDP Prefetch Pipelining & Kernel Reuse: Pipelined DCN gradient all-reduce one layer behind ICI reduce-scatter in FSDP prefetching across both homogeneous and inhomogeneous pipelines (fsdp prefetch), and added query_proj_kernel_gather_once and gather_scanned_kernels_once optimizations to reuse gathered FSDP kernels across forward and backward passes.
  • CP-as-EP Dense Mesh Rules & Gradient Reduction: Added cp-as-ep-dense-no-cp and cp-as-ep-dense-fsdp custom mesh rules to remap dense weights off context axes onto FSDP and expert axes (custom mesh and rule), introduced dense_grad_reduce='all_reduce' to avoid backward collective-permutes, and added opt-in moe_wo_fsdp_on_mlp sharding on RoutedMoE.wo.
  • Sharded Muon Reshaping & Newton-Schulz Optimization: Optimized tensor reshaping and Newton-Schulz execution in the sharded Muon optimizer for improved training efficiency.
  • Large-Scale Startup & Host Loop Efficiency: Wrapped NNX module construction in from_pretrained with logical-to-physical sharding rules, cached synthetic batch generation inside jax.jit across iterations, optimized host-offload initialization, evaluated learning rate schedules directly on the host CPU, and batched metric scalar transfers in MetricLogger to eliminate host-loop stalls in Pathways and large multi-host runs.
  • Qwen3 TPU7x FP8 Kernel Optimizations: Added fused FP8 QKV and output projection kernels with integrated QK-RMSNorm and RoPE for Qwen3 attention, fused the Qwen3 MoE expert execution path into Lineage GMMv2 kernels with in-kernel gather and TensorCore combine, wired deferred norm-gradient reductions into Qwen3 and NNXDecoder, and introduced configuration knobs and FP8 helper utilities for the Qwen3-235B v7x training stack.
  • Dynamic MoE Token Quantization: Added per-token (channelwise) dynamic absmax calibration to moe_quantize_token_all_gather under ring-of-experts, enabling token all-gather quantization to be used with full FP8 absmax recipes (moe configuration, quantization).
  • FSDP Prefetch Overlap & Qwix Quantization: Added a dedicated post-scheduler overlap transform for FSDP prefetch (fsdp_prefetch_overlap_transform.py) (fsdp prefetch), preserved Qwix quantization state across custom_vjp FSDP prefetch backward passes by caching forward residual layouts, and upgraded qwix to 0.1.9 and 0.1.10.
Checkpointing / Goodput
  • Dynamic SafeTensors Peak HBM Reduction: Stacked composite leaves one by one and joined reshard slices in pairs during safetensors_dynamic in-memory transforms to lower peak HBM usage on large scanned MoE models.
  • Orbax MultiprocessingOptions in MaxTextTrainingEngine: Accepted Orbax MultiprocessingOptions in MaxTextTrainingEngine checkpointing to support saving and restoring checkpoints from a subset of JAX processes (such as trainer ranks sharing a distributed world with rollout ranks).
  • Colocated Python Checkpointing for Pathways: Enabled colocated_python_checkpointing in the training engine's CheckpointManager on Pathways, allowing worker host sidecars to read and write OCDBT and Zarr3 checkpoints directly with worker memory budgets (checkpoint_storage_device_host_concurrent_gb) and preserving host-offloaded optimizer leaves on restore.
  • Elastic Training Retry Policy Migration: Migrated the Pathways elastic training runner to pass retry_policy=manager.ElasticRetryLimit(config.elastic_max_retries) when invoking Manager.elastic_retry, replacing the deprecated max_retries argument while preserving existing retry behavior.
  • Dynamic SafeTensors Streaming & Checkpoint Loading: Added multi-layer streaming and grouped small-tensor host reads for safetensors_dynamic loading, supported DeepSeek-V4 checkpoint structures, added padded row reads with F8_E8M0 scale parsing and quantization configurations in SafetensorsReader, gated dynamic streaming behind an opt-in flag while defaulting to the Orbax loader, and added documentation guides (checkpointing solutions, safetensors dynamic).
  • Elastic Training Batch Modes & Resilience: Added the constant_grad_accum elastic mode, bounded per-device batch sizes in constant_padded mode to fall back to growing gradient accumulation when exceeding HBM budgets, prevented padding rows from skewing MoE routing capacity, auxiliary loss, and routed-bias updates, and added single-host and multislice convergence verification for constant_padded resizes (run maxtext elastic training).
  • Default Goodput Recording & Monitoring: Enabled Goodput recording and monitoring by default in base configurations while disabling inside test runners, and added CI regression tests to protect against step-time overhead.
  • Multi-Tier Checkpointing Backup Optimization: Removed redundant pre-save existence checks from save_checkpoint(backup=True) to rely on Orbax's native duplicate step handling (multi tier checkpointing).
  • In-Memory Snapshotting GKE Runbook: Added a comprehensive GKE runbook and operational guide for MaxText in-memory snapshotting with Pathways across Grain ArrayRecord workloads, covering Cluster Toolkit and JobSet configurations, pause/resume, and replica resizes (run maxtext, run maxtext elastic training, run maxtext snapshotting).
  • Multi-Tier Checkpointing Targeted Backups: Added backup=True support to save_checkpoint, enabling training loops to trigger persistent backups on specific epoch or phase boundaries independently of periodic backup intervals (multi tier checkpointing).
  • High-Performance Sharded Safetensors Reader: Implemented SafetensorsReader to stream HuggingFace checkpoint tensors directly into sharded jax.Arrays via parallel ranged reads and immediate host-to-device transfers.
Usability
  • Automatic XProf Pipeline Stage Profiling: Added automatic in-place XProf pipeline stage profiling and an extensible trace lens whenever SPMD pipeline parallelism (PP > 1) runs with profiler=xplane (xprof user guide, optimization, pipeline parallelism profiling).
  • M3 Performance & Memory Parity Harness: Added src/maxtext/m3/train/perf_parity.py to benchmark M3 performance and memory parity against legacy MaxText.
  • Dependency Floor Updates: Raised version floors to grain>=0.2.19 and tokamax>=0.0.18 (for TPU), and required tpu-info>=0.14.2 in TPU post-training dependencies to avoid tpu_info.cli import conflicts.
  • CPU Checkpoint Conversion Scripts & Tutorials: Moved end-to-end checkpoint conversion scripts from TPU test suites to CPU (tests/end_to_end/cpu), enabling shared execution across TPU and GPU workflows, and updated post-training tutorials (convert checkpoint, rl gemma4 26b, rl qwen3 30b).
  • Grain Memory-Mapped Dataset Mixture Resource Budgeting: Partitioned grain_num_threads and grain_prefetch_buffer_size across memory-mapped (mmap) dataset mixture components in get_mmap_dataset proportional to normalized component weights, preventing host memory exhaustion and thread oversubscription.
  • Cached Dependencies Container Image Builds: Documented building and using cached dependencies-only container images for faster local and reproducible MaxText container builds (build maxtext).
  • ml-dtypes Floor & Nightly JAX Dependency Resolution: Raised the ml-dtypes version floor to >=0.7.0 across requirements files, and updated nightly setup scripts to query the JAX nightly index with safe dependency resolution.
  • Sensitive Configuration Key Redaction: Excluded secret configuration keys from being serialized to TensorBoard logs and config.yml artifacts in Google Cloud Storage.
  • Benchmark Recipe Configuration Overrides: Exposed configuration overrides for elastic training, Goodput, checkpointing, and data inputs across benchmark recipes and the Cluster Toolkit (CTK) runner.
  • Grain Dataset Mixture Resource Budgeting: Partitioned grain_num_threads and grain_prefetch_buffer_size across ArrayRecord mixture components in IterDataset.mix proportional to normalized weights to prevent host memory exhaustion, and permitted zero thread and buffer values when prefetching is disabled.

Bug Fixes

  • Fixed packed sequence masking (NO_MASK, PADDING, CAUSAL, PADDING_CAUSAL) and pre-Hopper fallback to dot-product attention in cuDNN JAX attention (cudnn_flash_jax), and lifted the AttentionType.FULL guard.
  • Fixed NaN losses in block-masked flash attention for query rows with no key in an active tile under sparse-indexer context-parallel attention.
  • Fixed unbatched evaluation iterators when grain_use_elastic_iterator=True by scoping elastic iterator handling to training and fixing post-resize integer local batch sizing with eval_per_device_batch_size.
  • Fixed silent 2D weight gradient corruption on pinned SparseCore FSDP reduce-scatter by reshaping tensors whose per-core scattered dimension is not divisible by 8.
  • Fixed from_pretrained warm-start failures (load_parameters_path) from OCDBT or Zarr3 checkpoints when ENABLE_PATHWAYS_PERSISTENCE=1 forces Zarr v2 for training saves, by detecting the on-disk checkpoint format and using a checkpointer-scoped handler without mutating the global Pathways registry.
  • Fixed DeepSeek-V4 rematerialization initialization with Qwix FP8 using disable_quant_stats_update.
  • Stabilized DeepSeek-V4 train state routing bias dtypes to prevent step-1 recompilation and retained unused train-state inputs so overwritten Qwix FP8 statistics remain eligible for buffer donation.
  • Disabled Qwix interception inside upstream Tokamax gmm_v2/tgmm_v2 and JIT fuser routes via @quantizations.without_qwix_interception.
  • Fixed missing beginning-of-sequence (<bos>) tokens in text decode prompts for models whose tokenizer includes a chat template when use_chat_template=False.
  • Pointed the emergency checkpoint manager's replica axis index at the data mesh axis so emergency checkpointing triggers as expected when diloco is active.
  • Fixed single-controller Pathways host memory exhaustion during warm-start checkpoint loads via load_parameters_path in from_pretrained by registering checkpointer-scoped Pathways array handlers for Zarr v2 checkpoints.
  • Fixed pre-fused MoE weight updates under the Muon optimizer by splitting [wi_0 | wi_1] along the output dimension during Newton-Schulz iterations, supported moe_unsliced_prefused_wi with online expert replication, and honored force_dropless in combine stages.
  • Fixed uninitialized receive buffer tail rows during dropless expert-parallel dispatch under quantization when use_ragged_sort=False in RoutedMoE.
  • Resolved tokenizer paths at load time in the active data-loading process rather than baking controller paths during configuration parsing, ensuring correct path resolution in colocated Pathways sidecar environments.
  • Fixed sharding and post-scheduler overlap issues when FSDP weight prefetching is combined with context parallelism across all-gather and ring strategies (fsdp prefetch).
  • Flushed the background worker thread in GoodputRecorder after recording job_end_time so all Cloud Logging entries are committed before process exit.
  • Fixed vllm_decode failures for GPT-OSS on the fused MoE path of MaxTextForCausalLM by ensuring compatibility with tpu-inference's GMM_v2 kernel.
  • Fixed external KV cache allocation in MaxTextForCausalLM with scan_layers=True so each scanned GPT-OSS layer receives its own vLLM KV cache.
  • Fixed weight unrolling in direct MaxText-to-vLLM rollout synchronization with scan_layers=True by determining layer structure from the weight tree rather than the model name.
  • Fixed missing beginning-of-sequence (<bos>) token formatting in Gemma 3 multimodal prompt processing.
  • Fixed TPU v7x SparseCore 3D reduce-scatter, SC0/SC1 queue parsing, and VMEM DMA buffer handling in FSDP prefetching.
  • Fixed 64-bit modular hash integer overflow in Engram NgramHashMapping when running with jax_enable_x64=False.
  • Fixed uninitialized dispatch buffers and local permutation tail sentinel values in moe_ragged_all_to_all when token dropping is enabled via ragged_buffer_factor > 0.
  • Fixed boolean optimizer state restoration under Pathways persistence with skip_step_on_spikes enabled by requiring orbax-checkpoint>=0.12.11.
  • Fixed group_offset handling in ring-of-experts MoE when routing expert tokens across device mesh ranks.
  • Cast RoutedMoE combine einsum output back to the module dtype when capacity_factor > 0 and float32 gate logits are used, preventing scanned decoder layer carry dtype check failures under bfloat16.
  • Raised an explicit ValueError when JAX device discovery fails during configuration validation instead of silently falling back to a single device and causing downstream indivisibility errors during pjit execution.
  • Fixed NNX checkpoint restoration in generate_param_only_checkpoint and standalone_checkpointer by setting the PRNG implementation to unsafe_rbg to align key shapes with training checkpoints.
  • Fixed multi-host HuggingFace checkpoint conversion in Qwen3.5 parameter hooks by operating on jax.numpy arrays when sharded inputs are present instead of falling back to host NumPy.
  • Added validation for ramp-up batch size settings in the Pydantic configuration schema to reject non-positive increments and invalid step ranges early.

Deprecations

  • Deprecated the forked gmm_v2 and tgmm_v2 Pallas Mosaic TPU kernels (pallas_mosaic_tpu_v2_gmm_kernel.py and pallas_mosaic_tpu_v2_tgmm_kernel.py) in favor of upstream Tokamax.
  • Removed complex floating-point dtype support from the sharded Muon optimizer in favor of standard real dtypes.
  • Migrated all uses of pltpu.emit_pipeline* to explicit indices in Pallas Mosaic TPU kernels ahead of deprecating implicit program grid indexing.