Skip to main content
Use Halo to scale LFM MoE training past a single GPU with expert, tensor, and expert-tensor parallelism.
Halo is an open-source distributed training framework from White Circle. It adds multi-GPU and multi-node scaling to the native Hugging Face workflow. Models remain standard transformers modules during training, and saved checkpoints load with from_pretrained. Halo adds LFM support around the native MoE and attention blocks once, then reuses that integration across SFT, LoRA, GRPO, and environmental GRPO with a consistent YAML structure. When a job grows from one GPU to a multi-node cluster, the distributed settings change but the integration does not. Different training methods require specific dataset formats. See Datasets for format requirements for SFT and GRPO.

Recipes

MoE SFT

LFM2.5-8B-A1B across two GPUs with expert parallelism.

Vision LoRA SFT

LFM2.5-VL-3B on one GPU with a rank-16 LoRA adapter.

MoE scaling and GRPO

EP4 and EP8, TP, ETP, LoRA, inference, and GRPO.
Both notebooks run inside a Halo container on Hopper (H100, H200) or Blackwell (B200, B300) GPUs and require an NVIDIA driver providing CUDA 13.0 or higher.

LFM support

Halo supports these LFM MoE models: Halo supports FSDP and these MoE parallelism modes:
  • Expert parallelism (EP): distributes routed experts across GPUs
  • Tensor parallelism (TP): shards the full-attention layers
  • Expert-tensor parallelism (ETP): shards each expert across GPUs
  • EP+TP: distributes experts and shards the full-attention layers
Halo uses DeepEP for token dispatch and grouped GEMM for expert projections. Halo does not support context parallelism (CP) for LFM2 models because short-convolution layers operate across the sequence axis.

Quickstart

  1. Clone Halo and its submodules.
  2. Pull the image that matches your GPUs.
  3. Start the training container. Export HF_TOKEN in the host shell first, and point D at a large scratch volume.
    Run the remaining steps inside this container.
  4. Configure the run. Save the following as sft.yaml, replacing the placeholder values. The chat template fields are LFM2-specific and should stay as they are.
    To start without editing anything, Halo ships a runnable EP2 configuration at examples/sft/lfm2/lfm2.5-8b-a1b-ultrachat-ep2.yaml. Each block below is a delta on the configuration above. Train LFM2-24B-A2B. Launch four processes with -n 4.
    On an eight-GPU node, raise expert_parallel_size to 8 when expert memory is the main limit and launch eight processes to match. On a single node the working EP sizes are the whole job, 2, or 1. An intermediate size such as EP4 on eight GPUs is rejected at config time. Shard attention with TP. Both dimensions use the same two ranks, so still launch with -n 2.
    Shard each expert with ETP. Use this when a single local expert is too large.
    Train a LoRA adapter. Keep EP enabled if the base model still needs expert sharding. These target modules cover text attention only. Vision models need a wider list that also reaches the vision tower and projector layers, as in the Vision LoRA SFT recipe.
    For GRPO with a vLLM or SGLang rollout server, follow the LFM2 cookbook.
  5. Launch the run. Match the process count to your parallel size.
Each rank owns 16 of the 32 routed experts. Halo gathers the fused expert weights into a standard Hugging Face checkpoint when it saves.

Tips

  • expert_parallel_size: Must divide the model’s routed expert count evenly. LFM2.5-8B-A1B has 32 routed experts, so EP2 places 16 on each GPU
  • moe_balancing: bias_update: Required for LFM2 models. They have no router auxiliary loss, so Halo updates the expert-selection bias instead
  • save_sharded_ep: false: Gathers a single Hugging Face checkpoint on save, so the result loads with from_pretrained. Set it to true only if you intend to resume at the same EP size
  • fp32_router: true: Keeps routing decisions in fp32 while experts stay in bf16, which is the cheaper half of full-precision MoE training
  • Chat template: LFM2 uses a ChatML-style template. Keep assistant_message_template aligned with it so completion masking trains only the assistant turns

Resources