# MoonEP: A Perfectly Balanced Expert Parallelism Library via Dynamic Redundant Experts

- **ID:** 649
- **Kind:** code
- **URL:** https://github.com/MoonshotAI/MoonEP
- **Authors:** Yutian Chen, Cong Li, Yucheng Wang, Ming Wei
- **Venue:** Moonshot AI (GitHub)
- **Published:** 2026
- **Source:** github
- **Language:** en
- **Access:** free
- **License:** MIT
- **License family:** Permissive (auto-classified)
- **Tags:** moonep, moe, expert-parallelism, moonshot, kimi, deepep, x
- **Topics:** MoE training, expert parallelism, distributed systems
- **Added:** 2026-08-14
- **Verified:** 2026-08-14
- **Research status:** done
- **Needs deep evaluation:** no
- **Page:** https://papers.projxon.ai/entries/649

## Summary

Moonshot MIT EP communication library (Kimi K3 Open Day, with FlashKDA and AgentEnv). Hard invariant: every EP rank receives exactly S×K tokens regardless of router skew. An on-GPU planner duplicates a small set of experts from the current routing, prefetches their weights, and reduces duplicated grads back to home ranks. Zero-copy permute/unpermute writes tokens straight into expert-grouped remote buffers; static S×K shapes drop per-layer host sync and stop the fragmentation that OOMs DeepEP under imbalance. On H20 EP=8 vs DeepEP v2, comm time stays nearly flat as maxvio grows while DeepEP degrades, and e2e iteration time stays flat. Training prefetch slots B=E/R; inference can use B=3–4. NVIDIA GPU; Zhenwu PPU listed as coming. Cite moonep2026.

## Attributes

- **Purpose:** Keep expert-parallel token loads perfectly balanced across ranks via dynamic redundant experts
- **Scale:** GitHub 1,079 stars / 118 forks at check. Python. Tweet ~4048 likes / 481 retweets / ~404k views at fetch.
- **Time period:** GitHub created 2026-07-24; pushed 2026-08-13; updated 2026-08-14. Tweet 2026-07-27. Discord posted 2026-07-27.
- **Author type:** human

## From the source (fetched 2026-10-03)

- **Repository:** MoonshotAI/MoonEP (GitHub)
- **Created:** Jul 24, 2026 (GitHub)
- **Last push:** Sep 20, 2026 (GitHub)
- **Stars:** 1,158 (GitHub)
- **Forks:** 134 (GitHub)
- **Main language:** Python (GitHub)

## Research notes

- Primary: GitHub README (MIT, Python, 1079 stars / 118 forks at check). Discord/X https://x.com/Kimi_Moonshot/status/2081763086281973847 via fxtwitter. Inspired by DeepEP, Echo arXiv 2603.07685, UltraEP, AcclEP. Comm library, not a hosted corpus, so no datasets_local row.

## Related entries

- Discussed in: [Mixture-of-experts language models: where the work is (overview)](https://papers.projxon.ai/entries/1206) (note, #1206)

## Similar entries

- [Inkling: open-weight controllable-effort multimodal MoE](https://papers.projxon.ai/entries/637) (model, #637)
- [Supercharging Olmo-core for Efficient and Scalable MoE Training](https://papers.projxon.ai/entries/838) (paper, #838)
- [ID Balancing: Stable Training of Extremely Sparse MoE via PID-Based Load Control](https://papers.projxon.ai/entries/833) (paper, #833)
- [Towards Looped Models Done Right — Part I: Topology, Input Injection, Recurrent-State Design](https://papers.projxon.ai/entries/651) (other, #651)
- [Ling and Ring 2.6 Technical Report: Efficient and Instant Agentic Intelligence at Trillion-Parameter Scale](https://papers.projxon.ai/entries/622) (paper, #622)
- [Exact Quantile Balancing and Load-Error Injection for Mixture-of-Experts](https://papers.projxon.ai/entries/1076) (paper, #1076)
