MoEWatch v0.1 — Open Source Diagnostics for MoE Routing Failure

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 :ghost: : 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:

  1. One-shot audit() for offline checks
  2. Live monitoring that attaches to Hugging Face Trainer or custom loops

It never stops your training. It only reports. You decide what to do:thinking:.

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.

Repo: GitHub - Abineshabee/MoEWatch: 👻 MoEWatch: A lightweight diagnostic and audit library for Mixture-of-Experts (MoE) models in HuggingFace Transformers — the pytest for MoE models. · GitHub

PyPI: moewatch · PyPI

pip install moewatch

Install it, attach it, and keep training. The library only reports. You stay in control.

From Abineshabee — :slightly_smiling_face: feedback and issues welcome.

If you have any thoughts? please drop it.