Beam-1.0-501B-A23B
Beam-1.0-501B-A23B is Reflection AI’s text-only sparse Mixture-of-Experts (MoE) language model: 501.3B total parameters with 23.4B activated per token. NeMo AutoModel trains it with a native implementation on the shared MoE stack, with expert parallelism, pipeline parallelism, context parallelism, packed sequences, and a Hugging Face state-dict adapter.
Fine-Tune Beam
Follow the installation instructions, then run the LoRA recipe from the repository root on one node of 8x H200 GPUs (141 GB VRAM):
The recipe trains rank-32 LoRA adapters on the attention and dense-MLP projections and on the routed experts with EP8, packed 2,048-token sequences of the Tulu-3 SFT mixture, and a global batch of 64 packs.
To train the same adapters against the frozen experts of an NVFP4 checkpoint instead of the BF16 weights, run the NVFP4 LoRA recipe, which points at Beam-1.0-501B-A23B-NVFP4, an experts-only NVFP4 export of the model quantized with NVIDIA ModelOpt (hf_quant_config.json with quant_algo: NVFP4 and group_size: 16):
With peft.expert_weight_format: nvfp4, the packed FP4 expert weights, their E4M3 block scales, and per-tensor scales load as stored. The packed format uses 0.56 bytes per expert parameter instead of 2 bytes. The grouped expert GEMMs dequantize the weights, so no FP4 tensor cores are needed, and the adapters train against the same expert weights that an NVFP4 inference engine serves. The rest of the checkpoint (dense projections, attention, router, norms, and embeddings) stays in floating point and loads as usual.
This format has the following requirements:
- Set
backend.experts: torch_mm. The torch, DeepEP, and HybridEP expert dispatchers all work; the recipe dispatches with HybridEP like the BF16 LoRA recipe. - On more than one GPU, use expert parallelism over the whole non-pipeline mesh. Set
ep_sizeequal to the number of GPUs per pipeline stage, both within a node and across nodes. - Save adapters only. Keep
checkpoint.save_consolidated: falseand merge the adapter into a floating-point checkpoint offline.
The recipe keeps FP32 master weights and FP32 Adam moments for the BF16 adapters with TE FusedAdam.
For full-parameter SFT, run the 8-node recipe on each of 8 nodes of 8x H200 GPUs, with NODE_RANK set from 0 to 7 and MASTER_ADDR set to the first node:
It trains all weights with EP64 on the same Tulu-3 data, using 4,096-token packing and a global batch of 64 packs. TE FusedAdam keeps FP32 master weights and Adam moments while the model weights and checkpoints stay BF16. Each checkpoint holds about 6 TB, so checkpoint_dir must be on a shared filesystem.
Choose a Workflow
Configuration
The NVFP4 LoRA recipe keeps this configuration and changes only the checkpoint (an experts-only NVFP4 export) and peft.expert_weight_format: nvfp4.
Model Reference
Model Architecture
Architecture
BeamStateDictAdapterconverts the per-expertgate_proj,up_proj, anddown_projweights of the Hugging Face checkpoint to the grouped expert layout and back, so exports keep the Hugging Face layout.- The router weight and
e_score_correction_biasstay FP32 through the model cast, checkpoint load, FSDP2 sharding (their own FP32 unit), and export. - Parallelism: EP, FSDP2, PP, and CP are supported; TP is not. Context parallelism requires the TE attention backend. Full-attention layers use TE’s
p2pexchange; sliding-window layers useall_gather, ora2afor packed (THD) input, which needs the CP size to divide the 48 query and 8 KV heads (CP 2, 4, or 8). - NVFP4-resident experts (
peft.expert_weight_format: nvfp4): the routed experts are kept in the ModelOpt NVFP4 checkpoint format (packed FP4 E2M1 codes, onefloat8_e4m3fnscale per 16 columns, one FP32 scale per tensor) as frozen packed parameters; the Beam state-dict adapter maps the per-expert ModelOpt tensors onto them, so the standard base-checkpoint load fills them in place, also on the expert-parallel sharded path, and the grouped GEMMs dequantize them on the fly in the forward and backward passes. The format needstorch_mmexperts, expert parallelism over the whole non-pipeline mesh on several ranks, and adapter-only saves; merged PEFT export and consolidated saves refuse packed experts. - Backends: attention
te,sdpa, orflex, lineartorchorte, expertstorchortorch_mm.flexhandles only unpadded, unpacked batches: it rejects a paddingattention_maskand packed (THD) input, so useteorsdpafor padded or packed data. FP8 uses the existing torchao and TE paths; the grouped experts stay BF16.
Validated Configuration
The full-parameter recipe reduced training loss from 0.6622 at step 0 to 0.5137 at step 99. The mean was 0.5183 over steps 10 to 99, and validation loss fell from 0.4832 after 25 steps to 0.4682 after 100. Peak logged memory was 117.0 GiB per GPU. The run completed without non-finite losses or gradient norms and saved the model and optimizer state after 50 and 100 steps, with about 6 TB per checkpoint. Resuming from the checkpoint saved after 50 steps on the same 8 nodes reproduced the next step’s loss bit-exactly. It stayed within 0.05% of the uninterrupted run over the following 10 steps and did not raise peak memory. This validates the training mechanics, not model convergence.
NVFP4-Resident Experts
On the full-parameter recipe’s Tulu-3 workload, LoRA on the NVFP4-resident experts tracked LoRA on the BF16 experts and the full-parameter run step for step (the three runs consumed the same tokens at every step):
Across the 100 matched steps, the NVFP4 training loss differed from the BF16-expert LoRA by a mean absolute difference of 0.0006 (maximum 0.0018), and the validation loss differed by at most 0.0006. The on-the-fly dequantization added about 9% to the step time at EP32 (14.8 s compared to 13.6 s). On one node of 8 H200 GPUs (EP8), the base load of the experts-only NVFP4 export (274 GB, 47 GB per rank) took 186 s from a cold network filesystem. The packed experts take 32 GiB per GPU, and a rank-128 run peaked at 94.5 GiB per GPU. The BF16 experts (114 GiB per GPU) do not fit in this configuration.
Numerical Validation
Hugging Face Logit Parity
Logits of the native implementation against the Hugging Face reference on four held-out Tulu-3 conversations of 4,096 tokens (16,384 positions, full vocabulary). Truncated models keep the first N decoder layers plus embeddings, final norm, and LM head.
The FP32 row shows numerical equivalence; the BF16 rows measure rounding noise, which grows with depth and with near-tie expert selection. Loading the full checkpoint maps all 38,366 tensors with no missing or mismatched entries, and a load, sharded save, and offline consolidation round trip reproduces all 38,366 tensors bit-exactly at EP1, EP2, and EP8.
100-Step LoRA Training
The LoRA recipe, beam_1_0_501b_a23b_tulu3_lora_ep8.yaml, trained for 100 steps on one node with 8 H200 GPUs.
The validation loss on 256 held-out conversations fell at every evaluation. The run completed without non-finite losses or gradient norms.
Packed CP1, CP4, and CP8 Training Parity
The full model trained for 100 steps with the same Tulu-3 workload, global batch size 64, EP64, TP1, and PP1, using torch AdamW with BF16 optimizer state. The CP1 reference packs documents with the same per-document alignment as the CP runs.
Across all 100 matched steps, the CP4 loss curve differed from CP1 by a mean absolute difference of 0.000413 (RMSE 0.000465, maximum 0.0012), and the CP8 curve by 0.000582 (RMSE 0.000880, maximum 0.0022).
Current Scope
- Tensor parallelism is not supported, and the LM head must stay untied from the embeddings.
- Packed context parallelism needs CP 2, 4, or 8.
- NVFP4-resident experts need an experts-only ModelOpt export with 16-column blocks and
torch_mmexperts (torch, DeepEP, or HybridEP dispatch); on several ranksep_sizemust equal the number of GPUs per pipeline stage, and the run saves adapters only (no merged export or consolidated save).