π Fine-tune Kimi K3 with NeMo AutoModel β native 2.8T MoE support at scale #3309
akoumpa
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Fine-tune Moonshot AI's 2.8T-parameter multimodal MoE with native PyTorch distributed training
π€ Model Β· π₯ Recipe Β· π Model coverage Β· π οΈ Implementation
NeMo AutoModel now supports fine-tuning
moonshotai/Kimi-K3, Moonshot AI's open-weight, native multimodal Mixture-of-Experts model.The integration loads the released Hugging Face checkpoint through native model, configuration, tokenizer, and state-dict implementations. Scaling is configured with FSDP2, Expert Parallelism, Pipeline Parallelism, and Context Parallelism.
Why Kimi K3 is interesting
For the complete architecture and evaluation results, see Moonshot AI's Kimi K3 repository and technical report.
What's ready in NeMo AutoModel
β Native
KimiK3ForCausalLMandKimiK3ForConditionalGenerationimplementationsβ Native tokenizer, encoding, and MXFP4 checkpoint loading
β FSDP2, Expert Parallelism, Pipeline Parallelism, and Context Parallelism
β K3-aware pipeline stages that preserve complete Attention Residual blocks
β Residual-accumulator handoff between pipeline stages
β A full-parameter HellaSwag SFT recipe
Kimi K3 currently supports DP, PP, CP, and EP. Tensor Parallelism is not yet supported.
Native loadingβwithout remote model code
The text recipe makes two choices explicit:
For multimodal Kimi K3, use
NeMoAutoModelForImageTextToTextand leave the checkpoint'sKimiK3ForConditionalGenerationarchitecture unchanged.Scale-out recipe and validation
The provided recipe uses FSDP2 with EP32 Γ PP8:
Note
Kimi K3 is a genuinely large model. The included full-parameter, 93-layer recipe was validated at 256-GPU scale. This is a scale-out recipe, not a single-node quick start.
Full-parameter Kimi K3 fine-tuning on HellaSwag.
Use Kimi K3 from another Python library
Third-party training systems can construct the distributed model directly with
DistributedSetup. WithPP_SIZE=1, the result is an already-sharded PyTorch module with the normalforwardinterface. The host library can also usesetup.mesh_contextto access the resolved device and MoE meshes.Multi-node Python example
Launch it with any system that provides the standard
torchrunenvironment:Data parallelism is inferred as:
Example topologies on 256 GPUs:
AutoPipelineAutoPipelineEPmust divideDP Γ CP.Important
With
PP_SIZE>1, AutoModel returns anAutoPipeline. The host library must drivemodel.step(...)or integrate the stage modules exposed throughmodel.parts; a generic Hugging Face-style trainer cannot treat it as a normal single-process model.Start here
This first recipe focuses on text SFT. We would especially love feedback on the next workloads you want to see: multimodal fine-tuning, long-context training, additional datasets, or further kernel optimization.
Huge thanks to @HuiyingLi for bringing Kimi K3 support to NeMo AutoModel!
All reactions