MoE_trace_analysis / README.md
core12345's picture
Update README.md
ae6ba40 verified
# Profiling Result Visualization Dataset
## πŸ“– Introduction
This repository is a part of "[MoE_expert_selection_trace Repository](https://huggingface.co/datasets/core12345/MoE_expert_selection_trace)". It provides analysis and visualization results of our profiled expert selection trace for MoE LLM on the **MMLU** dataset, including **Llama4-Maverick**, **DeepSeek-R1**, and **Qwen3-235B**. For a deeper understanding of the analysis, please refer to our paper.
### Key Components:
- **`cross_token_heatmap/`** – Expert selection heatmap across two adjacent tokens. This corresponds to token-level temporal relations in our paper. Results for prefill and decode stages are presented separately.
- **`column_by_layer/`** – Expert selection heatmap across two adjacent layers. This corresponds to layer-level temporal relations in our paper. Results for prefill and decode stages are presented separately.
- **`same_layer_heatmap/`** – Co-activation heatmap for experts. This corresponds to spatial relations for expert pairs in our paper.
- **`cross_layer_heatmap/`** – Activation frequency for different experts, presented as column figures. This corresponds to spatial relations for single experts in our paper.
---
## πŸ“‚ Dataset Structure
### Top-Level Layout
```
profiling_result_fig/
β”œβ”€β”€ meta-llama
β”‚ └── Llama-4-Maverick-17B-128E-Instruct
β”‚
β”œβ”€β”€ cognitivecomputations
β”‚ └── DeepSeek-R1-AWQ
β”‚ β”œβ”€β”€ cross_token_heatmap
β”‚ β”‚ └── mmlu
β”‚ β”‚ β”œβ”€β”€ decode
β”‚ β”‚ β”‚ β”œβ”€β”€ xxx.png
β”‚ β”‚ β”‚ β”œβ”€β”€ xxx.txt
β”‚ β”‚ β”‚ β”œβ”€β”€ ...
β”‚ β”‚ β”‚
β”‚ β”‚ β”œβ”€β”€ prefill
β”‚ β”‚ └── prefill_decode_corr.txt
β”‚ β”œβ”€β”€ same_layer_heatmap
β”‚ β”œβ”€β”€ cross_layer_heatmap
β”‚ └── column_by_layer
β”‚
└── Qwen
└── Qwen3-235B-A22B-FP8
```
---
## πŸ“‘ File Naming and Domains
The subfolders are named after **academic or professional domains** from the **MMLU benchmark** and related datasets.
Examples:
### Heatmap Files:
There are five types of files:
- **`layer_*.png`** – The original heatmap, reflecting the conditional probability of two activated experts.
- **`layer_*_avg.png`** – Normalized heatmap with each value divided by the average value of its corresponding column, eliminating vertical white lines caused by frequently selected experts.
- **`layer_*_skew.txt`** – Accumulated frequency of the most popular expert pairs, calculated by aggregating frequency.
- **`layer_*_cnt_skew.txt`** – Accumulated frequency of the most popular expert pairs, calculated by aggregating count. Similar to `layer_*_skew.txt`, but more accurate.
- **`prefill_decode_corr.txt`** – Correlation ratio between the prefill stage and decode stage.
### Column Figures:
There are three types of files:
- **`layer_*_prefill.png`** – Statistical results for the prefill stage only.
- **`layer_*_decode.png`** – Statistical results for the decode stage only.
- **`layer_*_both.png`** – Statistical results considering both prefill and decode stages.