Skip to content

Commit acdbb66

Browse files
feat: add app and docs (#6)
* feat: add app and docs * readme modified * pipeline for efficiency measurement * strategy search --------- Co-authored-by: Huang Huang(AI) <huang.huang@mthreads.com>
1 parent a2eb72f commit acdbb66

65 files changed

Lines changed: 6765 additions & 1586 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
# SimuMax: a static analytical model for LLM distributed training
2-
2+
* [Latest News](#latest-news)
33
* [Introduction](#introduction)
44
* [Getting Started](#Installation)
55
* [Unitest](#Unitest)
66
* [TODO](#todo)
77
* [Acknowledgements](#acknowledgements)
88
* [Community](#Community)
9+
## Latest News
10+
- 📣 NEW! [App](./develop/app/README.md) - Add a user application to the SimuMax.
11+
- 📣 NEW! [Strategy Search](./examples/search/llm_search.py) - Support strategy search.
12+
- 📣 NEW! [System Config Pipeline](./simu_tools/efficency_test/README.md) - Add a Pipeline to generate system file include computing and communication efficiency.
13+
914

1015
## Introduction
1116
SimuMax is a distributed training simulator designed for large-scale language model (LLM) workloads. It leverages a static analytical model to simulate and analyze both performance and memory usage, providing detailed insights into training efficiency without running the actual training process. Based on these analyses, SimuMax helps users explore potential ways to maximize computational efficiency.
@@ -35,15 +40,17 @@ It's appropriate to address various use-cases:
3540
- [x] Megatron Compatibility: Simplified model migration pipeline
3641
- [x] Finer-grained selective recompute
3742
- [x] Efficiency measurement across shapes/layouts
43+
- [x] Efficiency measurement pipeline for both computing and commucation
44+
- [x] Strategy Search
3845

3946

4047
### Benchmarks
4148
Performance of some models on a single node. Llama3-70B was trimmed to 12 layers and DeepSeek-236B was trimmed to 4 layers.
4249
Details can be found in [FULL_RESULTS](docs/FULL_RESULTS.md)
4350

4451

45-
4652
#### A100-Pcie
53+
Please refer to [./simu_tools/megatron_scripts/README.md](./simu_tools/megatron_scripts/README.md) for the benchmark script.
4754
![alt text](assets/A100-Pcie.png)
4855

4956

@@ -66,29 +73,53 @@ pip install -v -e .
6673

6774

6875
## Example
76+
We recommend using our app program to get started with SimuMax with zero cost. Please refer to the [README](./app/README.md) for more details.
77+
6978
Please refer to the [tutorial](./docs/tutorial.md) for more details.
7079

7180
```bash
7281
cd ./examples
7382
python perf_llama3_8b_tp1_pp2.py
7483
# The results are stored in the llama3_8b_a100_pcie_bf16 directory
7584
```
76-
The output is as follows:
85+
The output is as follows, the output details are saved in the ./llama3_8b_a100_pcie_bf16 directory:
7786
```
78-
-------------SIMUMAX SUMMARY TP=1,EP=1,PP=2 -------------
79-
- parallelism = seq4096.mbs1.mbc8.gbs32 tp1.ep1.pp2.dp4.etp1.edp4, world_size:8
87+
-------------SIMUMAX SUMMARY llama3_8b(8.03B) TP=1,EP=1,PP=2 -------------
88+
- parallelism = layer32.dense0.seq4096.mbs1.mbc8.gbs32 tp1.ep1.pp2.dp4.etp1.edp4, world_size:8
8089
- recompute = No Recompute
8190
- dtype = bf16, grad_reduce = fp32
8291
- system = a100_pcie_bf16
83-
- model = dense
84-
- mfu = 0.49
85-
- TFLOPS = 151.59 (tflops=843.3426 T, duration=5.5632 s)
86-
- TGS_per_gpu = 2945.052828675417
87-
- peak_alloc_mem = {'first_stage': '50.7760 GB', 'last_stage': '45.1637 GB'}
92+
- model_type = dense
93+
· mfu = 0.48
94+
· TFLOPS = 151.01T (tflops=843.3426 T, duration=5.5848 s)
95+
· TFLOPS_PER_TOKEN = 0.01T, duration=5.5848 s
96+
· peak_alloc_mem = {'first_stage': '50.8854 GB', 'last_stage': '45.1637 GB'}
97+
- peak_alloc_mem_with_reserved = {'first_stage': '54.1334 GB', 'last_stage': '48.0465 GB'}
98+
- TGS_per_gpu = 2933.6554333899194
99+
- net = pp_net=intra_node_pcie_8x, tp_net=intra_node_pcie_2x, dp_net=intra_node_pcie_4x, ep_net=intra_node_pcie_2x, etp_net=intra_node_pcie_2x
100+
------------------------------------------
88101
```
89102

90-
# Unitest
91-
after clone the repo, plz use "git config core.hooksPath git_hooks" to set commit hook, which will check the perf result in some config is still the same before commit automatically.
103+
## Strategy search example
104+
We provide a set of strategy search scripts that run on the [llm_search.py](./examples/search/llm_search.py) model, which can be used to search for the optimal strategy for your model.
105+
```
106+
cd examples/llm_search
107+
python llm_search.py
108+
```
109+
110+
The example strategy search output results are saved in the directory ./search_deepseek_v3_a100_pcie_bf16 and search_deepseek_v2_a100_pcie_bf16.
111+
112+
113+
## Generate system file
114+
115+
If you want to use SimuMax on new equipment, please refer to [./simu_tools/efficency_test/README.md](./simu_tools/efficency_test/README.md) to generate system files.
116+
117+
## Benchmark
118+
We provide a set of benchmark testing scripts that run on NVIDIA GPUs, which can be used for SimuMax simulation calibration. These scripts enable actual measurements for llama and deepseek models. The benchmark results will be stored in a designated directory. For detailed benchmark procedures and interpretation of results, please refer to [./simu_tools/megatron_scripts/README.md](./simu_tools/megatron_scripts/README.md).
119+
120+
## Notes
121+
- Currently, all Linear models are forced to perform gradient accumulation fusion.
122+
92123

93124
# TODO
94125
SimuMax is in active development, may contain bugs or incomplete features. Contributions are welcome!
@@ -97,7 +128,6 @@ There are features to be added. Several significants are:
97128
- More pipeline scheduler
98129
- Overlap between computation and communication
99130
- Offloading
100-
- Strategy search
101131
- More accurate memory-bound operator simulation
102132

103133

@@ -120,9 +150,4 @@ If you're passionate about:
120150
Large-scale models for MoE, Reinforcement Learning, Multi-Modal
121151
GPU/GPU-Cluster Training/Inference performance optimization
122152

123-
Feel free to reach out to xuerong.huang@mthreads.com.
124-
125-
## Star History
126-
## Star History
127-
128-
[![Star History Chart](https://api.star-history.com/svg?repos=MooreThreads/SimuMax&type=date&legend=top-left)](https://www.star-history.com/#MooreThreads/SimuMax&type=date&legend=top-left)
153+
Feel free to reach out to 1354789084@qq.com.

app/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Get started
2+
you can run the app with the following command:
3+
```shell
4+
cd app
5+
bash install.sh
6+
streamlit run streamlit_app.py
7+
```

app/install.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# pip install PyQt5 -i https://pypi.tuna.tsinghua.edu.cn/simple
2+
# sudo apt-get update
3+
# sudo apt-get install libxcb-xinerama0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xkb1 libxkbcommon-x11-0
4+
5+
6+
# pip install flask -i https://pypi.tuna.tsinghua.edu.cn/simple
7+
pip install streamlit -i https://pypi.tuna.tsinghua.edu.cn/simple

0 commit comments

Comments
 (0)