Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,27 @@
astra-sim-alibabacloud/build/simai_analytical/build/
astra-sim-alibabacloud/build/astra_ns3/build/
astra-sim-alibabacloud/extern/
build-optimized/
bin/
results/
test/log/
*.log
*.bak
ncclFlowModel_*.csv
send.txt
.cur*
.DS_Store

# SimCCL standalone build artifacts
SimCCL/standalone/build/
SimCCL/standalone/build_*/
SimCCL/tools/pat_simulator

# Generated topology files (kept local, excluded from PR)
astra-sim-alibabacloud/inputs/topo/Rail_Opti_SingleToR_*
/Rail_Opti_SingleToR_*

# Editor temp files
*.swp
*.swo
*~
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Changelog

All notable changes to SimAI are documented in this file.

## [1.7] - 2026-07-07

- [SimCCL](https://github.com/aliyun/SimCCL) v2.30 mock: NCCL-style collective flow decomposition with Ring, PAT, and NVLS algorithm support.
- Protocol-aware selection (LL/LL128/Simple based on message size).
- SimCCL standalone binary for independent collective operation analysis (no GPU required).
- Per-(algorithm, protocol, link_type) send latency table for higher simulation fidelity.

## [1.6] - 2026-04-23

- GPU memory modeling for inference simulation (parameter counting & KV cache).
- Linear interpolation for decode time estimation (replacing nearest-neighbor).
- Prefill-Decode Disaggregation memory planning (independent budgets for Prefill/Decode).

## [1.5] - 2025-12-30

- End-to-end simulation for multi-request **inference** workloads.
- Advanced Inference Simulation: Model complex scenarios with Prefill/Decode separation.
- Modern Model Support: DeepSeek, Qwen3Moe and Qwen3Next.
- Request Scheduling: Adapted from Microsoft's [Vidur](https://github.com/microsoft/vidur).
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
WORKDIR /workspace/SimAI

# [Optional] Configure pip and uv to use Aliyun mirror for faster package downloads.
RUN pip config set global.index-url http://mirrors.aliyun.com/pypi/simple
RUN pip config set install.trusted-host mirrors.aliyun.com
# Use HTTPS to avoid MITM during dependency download (no trusted-host needed with TLS).
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
ENV UV_DEFAULT_INDEX="https://mirrors.aliyun.com/pypi/simple"

RUN pip install --no-cache-dir uv
Expand All @@ -26,7 +26,11 @@ RUN UV_TORCH_BACKEND=auto uv pip install -v --system --no-cache-dir --no-build-i
# Copy the rest of the application source code into the image.
COPY . .

RUN mv ./workload_generator /usr/local/lib/python3.12/dist-packages &&\
mv ./utils /usr/local/lib/python3.12/dist-packages &&\
mv ./log_analyzer /usr/local/lib/python3.12/dist-packages
# Move helper packages onto the Python site-packages path. Compute the path
# dynamically so this does not break if the base image's Python minor version
# or site-packages location changes.
RUN SITE_PACKAGES="$(python3 -c 'import site; print(site.getsitepackages()[0])')" &&\
mv ./workload_generator "$SITE_PACKAGES" &&\
mv ./utils "$SITE_PACKAGES" &&\
mv ./log_analyzer "$SITE_PACKAGES"
ENV PYTHONPATH=/workspace/SimAI:/workspace/SimAI/aicb:/workspace/SimAI/vidur:$PYTHONPATH
42 changes: 37 additions & 5 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@

### 最近のアップデート

- [2026/07] **SimAI 1.7 リリース!** 主な更新:
- [SimCCL](https://github.com/aliyun/SimCCL) v2.30 mock:Ring、PAT、NVLS アルゴリズムをサポートする NCCL スタイルの集合通信フロー分解。
- プロトコル認識選択(メッセージサイズに基づく LL/LL128/Simple の自動選択)。
- SimCCL スタンドアロンバイナリ(GPU不要で集合操作分析が可能)。
- (アルゴリズム, プロトコル, リンクタイプ) 別の送信レイテンシテーブルによるシミュレーション精度向上。

- [2026/04] **SimAI 1.6 リリース!** 主な更新:
- 推論シミュレーション向け GPU メモリモデリング(パラメータカウント&KV Cache)。
- Decode 時間推定の線形補間(最近傍探索の代替)。
Expand Down Expand Up @@ -44,6 +50,7 @@

| 日付 | イベント | 場所 | 内容 | 形式 |
|:----------------:|:------------------------------------------------------------------------ |:----------------------- |:-------------------------------------------------------- |:-------------:|
| 2026年7月7日 | SimAI 1.7 | 🌐 オンライン | SimAI 1.7 のリリース | 💻 バーチャル |
| 2026年4月23日 | SimAI 1.6 | 🌐 オンライン | SimAI 1.6 のリリース | 💻 バーチャル |
| 2025年12月30日 | SimAI 1.5 | 🌐 オンライン | SimAI 1.5 のリリース | 💻 バーチャル |
| 2025年6月4日 | SimAIコミュニティ第1回ワークショップ | 📍 北京大学 | コミュニティ貢献者による3つの講演 | 🎓 現地 |
Expand Down Expand Up @@ -77,6 +84,7 @@
- [セットアップ](#セットアップ)
- [SimAI-Analyticalの使い方](#simai-analyticalの使い方)
- [SimAI-Simulationの使い方](#simai-simulationの使い方)
- [SimCCL の使い方](#simccl-の使い方)
- [マルチリクエスト推論シミュレーションの使い方](#マルチリクエスト推論シミュレーションの使い方)

# SimAI 概要
Expand Down Expand Up @@ -118,7 +126,7 @@ astra-sim-alibabacloudは[astra-sim](https://github.com/astra-sim/astra-sim/tree

SimAIは、さまざまなシミュレーション要件を満たすために、3つの主要な動作モードをサポートしています:

**SimAI-Analytical**は、バス帯域幅(busbw)を使用して集合通信時間を見積もることにより、ネットワーク通信の詳細を抽象化し、高速なシミュレーションを提供します。現在、ユーザー定義のbusbwをサポートしていますが、自動busbw計算機能はまもなく登場予定です
**SimAI-Analytical**は、バス帯域幅(busbw)を使用して集合通信時間を見積もることにより、ネットワーク通信の詳細を抽象化し、高速なシミュレーションを提供します。現在のオープンソース版バイナリは `-nv`/`-nic`/`-n_p_s` から busbw を自動計算します(デフォルト、下記参照)。注意:ユーザー定義の `busbw.yaml`(`-busbw`)は現在のオープンソース版 analytical バイナリでは未接続です。この方法は以前の SimAI バージョンを参照してください

**SimAI-Simulation**は、きめ細かいネットワーク通信モデリングを備えたフルスタックシミュレーションを提供します。NS3や他のネットワークシミュレータ(現在はNS3がオープンソース化されています)を活用して、すべての通信動作を詳細にシミュレーションし、実際のトレーニング環境を高忠実に再現することを目指しています。

Expand Down Expand Up @@ -146,7 +154,7 @@ SimAIを基盤とした革新的な研究や拡張を奨励します。ディス

# クイックスタート

以下に簡単な例を示します。SimAIの完全なチュートリアルはこちらにあります:[**SimAI@Tutorial**](./docs/Tutorial.md)、[**aicb@Tutorial**](https://github.com/aliyun/aicb/blob/master/training/tutorial.md)、[SimCCL@Tutorial]、[ns-3-alibabacloud@Tutorial]
以下に簡単な例を示します。SimAIの完全なチュートリアルはこちらにあります:[**SimAI@Tutorial**](./docs/Tutorial.md)、[**aicb@Tutorial**](https://github.com/aliyun/aicb/blob/master/training/tutorial.md)、[**SimCCL@Tutorial**](./SimCCL/README.md)、[**ns-3-alibabacloud@Tutorial**](https://github.com/aliyun/ns-3-alibabacloud)

## セットアップ

Expand Down Expand Up @@ -179,14 +187,16 @@ $ ./scripts/build.sh -c ns3

## SimAI-Analyticalの使い方

デフォルトでは、SimAI-Analytical はバス帯域幅を自動的に計算します:

```bash
$ ./bin/SimAI_analytical -w example/workload_analytical.txt -g 9216 -g_p_s 8 -r test- -busbw example/busbw.yaml
$ ./bin/SimAI_analytical -w ./example/workload_analytical.txt -g 9216 -nv 360 -nic 48.5 -n_p_s 8 -g_p_s 8 -r example-
```

バス帯域幅を自動で計算するには、次のコマンドを試してください:
> 注意:以下の `-busbw example/busbw.yaml`(ユーザー定義 busbw)コマンドは、現在のオープンソース版 analytical バイナリでは**サポートされていません**。`-busbw` は解析されず、コマンドは使用法を表示して終了します。参考のために残しています。手動の `busbw.yaml` の使い方は以前の SimAI バージョンを参照してください。

```bash
$ ./bin/SimAI_analytical -w ./example/workload_analytical.txt -g 9216 -nv 360 -nic 48.5 -n_p_s 8 -g_p_s 8 -r example-
$ ./bin/SimAI_analytical -w example/workload_analytical.txt -g 9216 -g_p_s 8 -r test- -busbw example/busbw.yaml
```

## SimAI-Simulationの使い方
Expand All @@ -199,6 +209,28 @@ $ python3 ./astra-sim-alibabacloud/inputs/topo/gen_Topo_Template.py -topo Spectr
$ AS_SEND_LAT=3 AS_NVLS_ENABLE=1 ./bin/SimAI_simulator -t 16 -w ./example/microAllReduce.txt -n ./Spectrum-X_128g_8gps_100Gbps_A100 -c astra-sim-alibabacloud/inputs/config/SimAI.conf
```

## SimCCL の使い方

SimCCL は、フルネットワークシミュレーションを実行せずに、集合通信フロー分解を独立して分析できます:

```bash
# SimCCL スタンドアロンバイナリのビルド
$ cd SimCCL/standalone
$ bash build.sh v2.30

# 単一集合操作の分析
$ ./build/simccl-standalone --op AllReduce --size 4194304 \
--nRanks 8 --nNodes 1 --gpus_per_node 8 --gpu_type H20

# ワークロードファイルモード
$ ./build/simccl-standalone -w ../../example/microAllReduce.txt \
--nRanks 16 --nNodes 2 --gpus_per_node 8 --gpu_type H20
```

出力:`ncclFlowModel_detailed_flows.csv` — 集合操作のポイントツーポイントフロー分解。

詳細なドキュメントについては [SimCCL README](./SimCCL/README.md) を参照してください。

## マルチリクエスト推論シミュレーションの使い方

詳細については、`vidur-alibabacloud` ディレクトリ内の [README](./vidur-alibabacloud/README.md) ファイルを参照してください。このモジュールは AICB を活用して**推論**ワークロードの計算時間をプロファイリングします。DeepGEMM や FlashMLA などの特定のハードウェアアクセラレーションライブラリに依存するため、**Hopper (SM90)** および **Blackwell (SM100)** アーキテクチャベースの NVIDIA GPU のみに対応しています。
Expand Down
42 changes: 37 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@

### Recent Updates

- [2026/07] **SimAI 1.7 Released!** Key updates:
- [SimCCL](https://github.com/aliyun/SimCCL) v2.30 mock: NCCL-style collective flow decomposition with Ring, PAT, and NVLS algorithm support.
- Protocol-aware selection (LL/LL128/Simple based on message size).
- SimCCL standalone binary for independent collective operation analysis (no GPU required).
- Per-(algorithm, protocol, link_type) send latency table for higher simulation fidelity.

- [2026/04] **SimAI 1.6 Released!** Key updates:
- GPU memory modeling for inference simulation (parameter counting & KV cache).
- Linear interpolation for decode time estimation (replacing nearest-neighbor).
Expand Down Expand Up @@ -44,6 +50,7 @@

| Date | Event | Location | Content | Type |
|:----------------:|:------------------------------------------------------------------------ |:----------------------- |:-------------------------------------------------------- |:-------------:|
| Jul 7, 2026 | SimAI 1.7 | 🌐 Online | The release of SimAI 1.7 | 💻 Virtual |
| Apr 23, 2026 | SimAI 1.6 | 🌐 Online | The release of SimAI 1.6 | 💻 Virtual |
| Dec 30, 2025 | SimAI 1.5 | 🌐 Online | The release of SimAI 1.5 | 💻 Virtual |
| Jun 4, 2025 | The first workshop of the SimAI community | 📍 Peking University | Three talks from community contributors | 🎓 On-site |
Expand Down Expand Up @@ -77,6 +84,7 @@ See [Tutorial](./docs/Tutorial.md) for full documentation.
- [Setup](#setup)
- [Use SimAI-Analytical](#use-simai-analytical)
- [Use SimAI-Simulation](#use-simai-simulation)
- [Use SimCCL](#use-simccl)
- [Use Multi-requests Inference Simulation](#use-multi-requests-inference-simulation)

# SimAI Overview
Expand Down Expand Up @@ -118,7 +126,7 @@ astra-sim-alibabacloud is extended from [astra-sim](https://github.com/astra-sim

SimAI supports three major operation modes to meet different simulation requirements:

**SimAI-Analytical** offers fast simulation by abstracting network communication details using bus bandwidth (busbw) to estimate collective communication time. While it currently supports user-defined busbw, automatic busbw calculation feature is coming soon.
**SimAI-Analytical** offers fast simulation by abstracting network communication details using bus bandwidth (busbw) to estimate collective communication time. The current open-source binary computes busbw automatically from `-nv`/`-nic`/`-n_p_s` (the default, shown below). Note: the user-defined `busbw.yaml` path (`-busbw`) is not wired in the current open-source analytical binary; refer to earlier SimAI versions for that workflow.

**SimAI-Simulation** provides full-stack simulation with fine-grained network communication modeling. It leverages NS3 or other network simulators (NS3 currently open-sourced) to achieve detailed simulation of all communication behaviors, aiming for high-fidelity reproduction of actual training environments.

Expand Down Expand Up @@ -146,7 +154,7 @@ We encourage innovative research and extensions based on SimAI. Welcome to join

# Quick Start

Here are some simple examples. SimAI full tutorials can be found here: [**SimAI@Tutorial**](./docs/Tutorial.md), [**aicb@Tutorial**](https://github.com/aliyun/aicb/blob/master/training/tutorial.md), [SimCCL@Tutorial], [ns-3-alibabacloud@Tutorial]
Here are some simple examples. SimAI full tutorials can be found here: [**SimAI@Tutorial**](./docs/Tutorial.md), [**aicb@Tutorial**](https://github.com/aliyun/aicb/blob/master/training/tutorial.md), [**SimCCL@Tutorial**](./SimCCL/README.md), [**ns-3-alibabacloud@Tutorial**](https://github.com/aliyun/ns-3-alibabacloud)

## Setup

Expand Down Expand Up @@ -179,14 +187,16 @@ $ ./scripts/build.sh -c ns3

## Use SimAI-Analytical

By default, SimAI-Analytical calculates bus bandwidth automatically:

```bash
$ ./bin/SimAI_analytical -w example/workload_analytical.txt -g 9216 -g_p_s 8 -r test- -busbw example/busbw.yaml
$ ./bin/SimAI_analytical -w ./example/workload_analytical.txt -g 9216 -nv 360 -nic 48.5 -n_p_s 8 -g_p_s 8 -r example-
```

For calculating bus bandwidth automatically, please try the following command:
> Note: The `-busbw example/busbw.yaml` (user-defined busbw) command below is **not supported** by the current open-source analytical binary — the `-busbw` flag is not parsed, so the command prints usage and exits. It is kept here for reference; see earlier SimAI versions for the manual `busbw.yaml` workflow.

```bash
$ ./bin/SimAI_analytical -w ./example/workload_analytical.txt -g 9216 -nv 360 -nic 48.5 -n_p_s 8 -g_p_s 8 -r example-
$ ./bin/SimAI_analytical -w example/workload_analytical.txt -g 9216 -g_p_s 8 -r test- -busbw example/busbw.yaml
```

## Use SimAI-Simulation
Expand All @@ -199,6 +209,28 @@ $ python3 ./astra-sim-alibabacloud/inputs/topo/gen_Topo_Template.py -topo Spectr
$ AS_SEND_LAT=3 AS_NVLS_ENABLE=1 ./bin/SimAI_simulator -t 16 -w ./example/microAllReduce.txt -n ./Spectrum-X_128g_8gps_100Gbps_A100 -c astra-sim-alibabacloud/inputs/config/SimAI.conf
```

## Use SimCCL

SimCCL can be used independently to analyze collective communication flow decomposition without running full network simulation:

```bash
# Build SimCCL standalone binary
$ cd SimCCL/standalone
$ bash build.sh v2.30

# Single collective operation analysis
$ ./build/simccl-standalone --op AllReduce --size 4194304 \
--nRanks 8 --nNodes 1 --gpus_per_node 8 --gpu_type H20

# Workload file mode
$ ./build/simccl-standalone -w ../../example/microAllReduce.txt \
--nRanks 16 --nNodes 2 --gpus_per_node 8 --gpu_type H20
```

Output: `ncclFlowModel_detailed_flows.csv` — point-to-point flow decomposition of collective operations.

For detailed documentation, see [SimCCL README](./SimCCL/README.md).

## Use Multi-requests Inference Simulation

For detailed information, please refer to the [README](./vidur-alibabacloud/README.md) file in the `vidur-alibabacloud` directory. This module leverages AICB to profile the computation time of **inference** workloads. Due to its reliance on specific hardware-accelerated libraries like DeepGEMM and FlashMLA, it is exclusively compatible with NVIDIA GPUs based on the **Hopper (SM90)** and **Blackwell (SM100)** architectures.
Expand Down
Loading