What problem does it solve?
This Skill allows you to train Mixture of Experts (MoE) models efficiently with limited compute resources, enabling you to scale model capacity without proportional increases in computation.
Core Features & Use Cases
- Large-scale Model Training: Efficiently train models with deepspeed and transformers libraries.
- Sparse Architectures: Implement sparse architectures like Mixtral 8x7B or DeepSeek-V3.
- Routing Mechanisms: Explore MoE architectures, routing mechanisms, load balancing, and inference optimization.
- Use Case: If you are working with large-scale language models and need to achieve better performance per compute budget than dense models, this skill is for you.
Quick Start
Use the moe-training skill to train a MoE model with the following configuration:
python train_moe.py \
--num-layers 24 \
--hidden-size 1024 \
--num-attention-heads 16 \
--seq-length 2048 \
--max-position-embeddings 2048 \
--micro-batch-size 4 \
--global-batch-size 256 \
--train-iters 500000 \
--lr 0.0001 \
--min-lr 0.00001 \
--lr-decay-style cosine \
--num-experts 128 \
--moe-expert-parallel-size 4 \
--moe-loss-coeff 0.01 \
--moe-train-capacity-factor 1.25 \
--moe-eval-capacity-factor 2.0 \
--fp16