This project is a visualizer for Mixture of Experts (MoE) models. We aim to provide a visual tool to help users understand the usage of experts in MoE models.
We designed a hook that can be mounted on a specific layer of the MoE model, which records which experts are used for each sample during inference. Ultimately, this allows us to count the usage of each expert.
Therefore, this is a plug-and-play module that can be used with any MoE model, with Qwen1.5-MoE-A2.7B provided as an example.
- Visualize the usage of experts in prefill and generate phase
- Support batch processing
- Support downloading data
- Support Qwen1.5-MoE-A2.7B
pip install -r requirements.txtpython qwen1_5_moe.pyIf this project helps you, please give us a star. 🌟
