MoEWatch: The Hard Reality of Expert Collapse and How to Catch It
Mixture-of-Experts (MoE) models fail quietly. Experts die. Routing entropy collapses. One expert takes most of the tokens. You only notice after the run is already wasted.
MoEWatch
: Catch Expert Collapse and Routing Failure During MoE Training.
MoEWatch is a lightweight diagnostic library that instruments MoE routers in Hugging Face Transformers using zero-weight-modification PyTorch hooks. It tracks:
- Dead and cold experts per layer
- Routing entropy relative to maximum
- Load imbalance (max/mean ratio)
It supports Mixtral, DeepSeek-MoE, Qwen-MoE, OLMoE, Phi-MoE, Switch Transformer and others out of the box. Unknown architectures can be targeted manually.
Two modes:
- One-shot audit() for offline checks
- Live monitoring that attaches to Hugging Face Trainer or custom loops
It never stops your training. It only reports. You decide what to do.
Current state and limits
v0.1.0(Alpha)- Detection depends on finding the right router modules. Some custom architectures need manual config.
- Default sampling (
sample_every=10) keeps overhead low but does not observe every step. - It diagnoses. It does not fix collapse.
- Focused on the Hugging Face Transformers ecosystem.
PyPI: moewatch · PyPI
pip install moewatch
Install it, attach it, and keep training. The library only reports. You stay in control.
From Abineshabee —
feedback and issues welcome.
