moe-training

Train mixture-of-experts models with sparse routing and expert parallelism.

Updated Feb 15, 2026
One-click install
npx skills add https://github.com/ricable/mcai --skill moe-training-ricable
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moe-training
Source: https://github.com/ricable/mcai/tree/main/.agents/skills/moe-training
Command: npx skills add https://github.com/ricable/mcai --skill moe-training-ricable

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

MoE Training helps you build and optimize sparse expert-based models when dense training is too expensive, enabling far more model capacity without proportional compute growth.

Core Features & Use Cases

  • Routing and Expert Design: Configure top-1, top-2, or expert-choice routing patterns for architectures like Switch, Mixtral, and DeepSeek.
  • Load Balancing and Stability: Tune auxiliary loss, router z-loss, capacity factors, and expert parallelism to keep training efficient and stable.
  • Production Training and Inference: Use the included guidance to plan large-scale training runs, prune or distribute experts, and deploy sparse inference efficiently.
  • Use Case: A team building a 47B-style Mixtral variant can use this Skill to pick expert counts, set routing rules, and choose the right DeepSpeed configuration for the available GPUs.

Quick Start

Use the moe-training skill to design a sparse MoE training plan for your model, including expert count, routing strategy, capacity settings, and distributed training configuration.

Frequently Asked Questions about moe-training

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I train mixture of experts models with expert parallelism using DeepSpeed?

Train mixture of experts models with expert parallelism by configuring DeepSpeed to handle sparse routing and distributed expert execution across available GPUs. This enables capacity scaling without proportional compute growth.

How do I configure load balancing and auxiliary loss for sparse routing in Mixtral?

Configure load balancing for sparse routing in Mixtral by tuning auxiliary loss, router z-loss, and capacity factors. These settings keep expert utilization efficient and stabilize training dynamics.

What is the best way to scale model capacity without increasing dense training compute costs?

Scaling model capacity without proportional compute growth requires sparse MoE training. By routing tokens to selected experts, you achieve far greater capacity than dense models at lower compute costs.

Can I use top-1 or expert-choice routing patterns for Switch Transformers with PyTorch?

Yes, you can configure top-1, top-2, or expert-choice routing patterns for Switch Transformers using PyTorch. This Skill guides selecting the right routing strategy for your architecture.

Does DeepSpeed support distributed expert execution for large-scale Mixtral variants?

Yes, DeepSpeed supports distributed expert execution for large-scale Mixtral variants. You can use this Skill to plan training runs, prune experts, and choose the right distributed configuration for your GPUs.

Why does my MoE training run fail when using Accelerate for sparse inference?

MoE training runs may fail during sparse inference if capacity factors, routing mechanisms, or auxiliary losses are not properly configured. Ensure Accelerate and Transformers support your specific expert parallelism setup.