mlc-ai/pith-train

Compact and Agent-Native MoE Training System

What it solves

Production MoE (Mixture-of-Experts) training frameworks are often overly complex, relying on heavy compiled extensions and indirect design patterns that make them difficult for both humans and AI coding agents to modify or optimize. PithTrain provides a high-performance training system that is compact enough to be read end-to-end by an agent or human while maintaining production-grade capabilities.

How it works

It is an agent-native framework structured into three layers: an Application layer for training loops, an Engine layer for model protocols and distributed training, and an Operator layer for low-level kernels. It implements a 4D parallelism strategy (Pipeline, Data, Context, and Expert parallelism) and utilizes a DualPipeV scheduler for overlapped forward-backward execution and P2P communication. The system supports FP8 training and integrates with libraries like DeepGEMM and FlashAttention.

Who it’s for

Researchers and developers who need to train MoE models (such as Qwen or DeepSeek architectures) and want a codebase that is easy to navigate, modify, and extend, especially when using AI coding assistants.

Highlights

  • Agent-Native Design: A compact codebase of approximately 11K lines of Python with minimal implicit indirection.
  • Production Performance: Supports 4D parallelism and compute-communication overlap.
  • FP8 Training: Built-in support for FP8 linear and quantization for efficiency.
  • Flexible Checkpointing: Supports reshardable checkpoints and conversion to Hugging Face format.

Related

  • Dispatch
  • Project
  • Project
  • Project
  • Dispatch