Skip to content

Commit 0c41cfc

Browse files
authored
Merge branch 'main' into add-python-stub
2 parents b838475 + 1c43832 commit 0c41cfc

454 files changed

Lines changed: 60831 additions & 4582 deletions

File tree

Some content is hidden

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

.github/new-prs-labeler.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ CORE:
3030
- 'cmake/**'
3131
- 'include/**'
3232
- 'lib/**'
33-
- 'python/**'
3433
- 'scripts/**'
3534
- 'test/**'
3635
- 'unittest/**'
@@ -45,6 +44,19 @@ CORE:
4544
- 'setup.py'
4645
- '.github/actions/**'
4746
- '.github/workflows/code-format-check.yml'
47+
- all-globs-to-any-file:
48+
- 'python/**'
49+
- '!python/setup_tools/utils/cambricon.py'
50+
- '!python/setup_tools/utils/enflame.py'
51+
- '!python/setup_tools/utils/hcu.py'
52+
- '!python/setup_tools/utils/iluvatar.py'
53+
- '!python/setup_tools/utils/metax.py'
54+
- '!python/setup_tools/utils/mthreads.py'
55+
- '!python/setup_tools/utils/ppu.py'
56+
- '!python/setup_tools/utils/rpu.py'
57+
- '!python/setup_tools/utils/sunrise.py'
58+
- '!python/setup_tools/utils/thrive.py'
59+
- '!python/setup_tools/utils/xpu.py'
4860

4961
# ==========================================
5062
# 2. CI/CD Labels
@@ -128,6 +140,7 @@ cambricon:
128140
- 'third_party/cambricon/**'
129141
- '.github/workflows/cambricon*'
130142
- '.github/workflows/benchmark/cambricon/**'
143+
- 'python/setup_tools/utils/cambricon.py'
131144

132145
cpu:
133146
- changed-files:
@@ -142,40 +155,45 @@ enflame:
142155
- 'third_party/enflame/**'
143156
- '.github/workflows/enflame*'
144157
- '.github/workflows/benchmark/enflame/**'
158+
- 'python/setup_tools/utils/enflame.py'
145159

146160
hcu:
147161
- changed-files:
148162
- any-glob-to-any-file:
149163
- 'third_party/hcu/**'
150164
- '.github/workflows/hcu*'
151165
- '.github/workflows/benchmark/hcu/**'
166+
- 'python/setup_tools/utils/hcu.py'
152167

153168
iluvatar:
154169
- changed-files:
155170
- any-glob-to-any-file:
156171
- 'third_party/iluvatar/**'
157172
- '.github/workflows/iluvatar*'
158173
- '.github/workflows/benchmark/iluvatar/**'
174+
- 'python/setup_tools/utils/iluvatar.py'
159175

160176
metax:
161177
- changed-files:
162178
- any-glob-to-any-file:
163179
- 'third_party/metax/**'
164180
- '.github/workflows/metax*'
165181
- '.github/workflows/benchmark/metax/**'
182+
- 'python/setup_tools/utils/metax.py'
166183

167184
mthreads:
168185
- changed-files:
169186
- any-glob-to-any-file:
170187
- 'third_party/mthreads/**'
171188
- '.github/workflows/mthreads*'
172189
- '.github/workflows/benchmark/mthreads/**'
190+
- 'python/setup_tools/utils/mthreads.py'
173191

174192
nvidia:
175193
- changed-files:
176194
- any-glob-to-any-file:
177195
- 'third_party/nvidia/**'
178-
- '.github/workflows/nv*'
196+
- '.github/workflows/nvidia*'
179197
- '.github/workflows/benchmark/nvidia/**'
180198

181199
ppu:
@@ -184,27 +202,38 @@ ppu:
184202
- 'third_party/ppu/**'
185203
- '.github/workflows/ppu*'
186204
- '.github/workflows/benchmark/ppu/**'
205+
- 'python/setup_tools/utils/ppu.py'
187206

188207
rpu:
189208
- changed-files:
190209
- any-glob-to-any-file:
191210
- 'third_party/rpu/**'
192211
- '.github/workflows/rpu*'
193212
- '.github/workflows/benchmark/rpu/**'
213+
- 'python/setup_tools/utils/rpu.py'
214+
215+
spacemit:
216+
- changed-files:
217+
- any-glob-to-any-file:
218+
- 'third_party/spacemit/**'
219+
- '.github/workflows/spacemit*'
220+
- '.github/workflows/benchmark/spacemit/**'
194221

195222
sunrise:
196223
- changed-files:
197224
- any-glob-to-any-file:
198225
- 'third_party/sunrise/**'
199226
- '.github/workflows/sunrise*'
200227
- '.github/workflows/benchmark/sunrise/**'
228+
- 'python/setup_tools/utils/sunrise.py'
201229

202230
thrive:
203231
- changed-files:
204232
- any-glob-to-any-file:
205233
- 'third_party/thrive/**'
206234
- '.github/workflows/thrive*'
207235
- '.github/workflows/benchmark/thrive/**'
236+
- 'python/setup_tools/utils/thrive.py'
208237

209238
tileir:
210239
- changed-files:
@@ -233,6 +262,7 @@ xpu:
233262
- 'third_party/xpu/**'
234263
- '.github/workflows/xpu*'
235264
- '.github/workflows/benchmark/xpu/**'
265+
- 'python/setup_tools/utils/xpu.py'
236266

237267
# ====================================================================================
238268
# 6. TLE Labels
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
3+
# Copyright 2025- FlagOS Contributors
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in all
13+
# copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
23+
set -euo pipefail
24+
25+
if [[ -z "${MUSA_VISIBLE_DEVICES:-}" ]]; then
26+
echo "[WARNING] MUSA_VISIBLE_DEVICES is unset; skipping GPU cleanup."
27+
exit 0
28+
fi
29+
30+
IFS=',' read -ra GPU_IDS <<< "$MUSA_VISIBLE_DEVICES"
31+
DEVICES=()
32+
for gpu_id in "${GPU_IDS[@]}"; do
33+
# Allow whitespace; require non-negative integer IDs.
34+
gpu_id="${gpu_id//[[:space:]]/}"
35+
if [[ ! "$gpu_id" =~ ^[0-9]+$ ]]; then
36+
echo "[FATAL] Invalid MUSA_VISIBLE_DEVICES: $MUSA_VISIBLE_DEVICES" >&2
37+
exit 1
38+
fi
39+
DEVICES+=("/dev/mtgpu.${gpu_id}")
40+
done
41+
42+
# Find PIDs using the devices.
43+
mapfile -t PIDS < <(
44+
fuser "${DEVICES[@]}" 2>/dev/null \
45+
| grep -oE '[0-9]+' \
46+
| sort -u
47+
)
48+
49+
if ((${#PIDS[@]} == 0)); then
50+
echo "[INFO] No processes found on ${DEVICES[*]}."
51+
exit 0
52+
fi
53+
54+
echo "[INFO] Terminating processes: ${PIDS[*]}."
55+
ps -fp "${PIDS[@]}" || true
56+
kill "${PIDS[@]}" 2>/dev/null || true
57+
sleep 5
58+
59+
# Force-kill remaining processes.
60+
mapfile -t REMAINING < <(
61+
fuser "${DEVICES[@]}" 2>/dev/null \
62+
| grep -oE '[0-9]+' \
63+
| sort -u
64+
)
65+
66+
if ((${#REMAINING[@]} > 0)); then
67+
echo "[WARNING] Force-killing processes: ${REMAINING[*]}"
68+
kill -9 "${REMAINING[@]}" 2>/dev/null || true
69+
fi
70+
71+
echo "[INFO] Current usage:"
72+
fuser -v "${DEVICES[@]}" || true

.github/workflows/benchmark/mthreads/mthreads3.6-qwen3.6/start.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ if [[ -f "$PID_FILE" ]]; then
4242
fi
4343
fi
4444
fi
45+
bash "${SCRIPT_DIR}/clear_fuser_process.sh"
4546

4647
start=$(date +%s)
4748

.github/workflows/benchmark/nvidia/nv3.6-qwen3.6/all_perf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
SERVER_HOST = "127.0.0.1"
4242
SERVER_PORT = 8000
4343
MODEL_NAME = "qwen36"
44-
TOKENIZER_PATH = "/root/flagrelease/qwen3.6/Qwen3.6-35B-A3B-nomtp"
44+
TOKENIZER_PATH = "/root/flagrelease/qwen3.6/Qwen3.6-27B"
4545

4646
# =============================================================================
4747
# 默认测试参数

.github/workflows/benchmark/nvidia/nv3.6-qwen3.6/perf.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ start=$(date +%s)
4545
nvidia-smi -i "$GPU_DEVICE_LIST" -lgc 1830,1830
4646
nvidia-smi --query-gpu=index,name,clocks.gr,clocks.mem,utilization.gpu --format=csv
4747

48-
#numactl --cpunodebind=1 --membind=1 \
49-
#python3 ${SCRIPT_DIR}/all_perf.py --input-len=32768 --output-len=1024 --concurrency=64
48+
# numactl --cpunodebind=1 --membind=1 \
49+
# python3 ${SCRIPT_DIR}/all_perf.py --input-len=32768 --output-len=1024 --concurrency=16
5050

5151
numactl --cpunodebind=1 --membind=1 \
52-
python3 ${SCRIPT_DIR}/all_perf.py --input-len=16384 --output-len=1024 --concurrency=64
52+
python3 ${SCRIPT_DIR}/all_perf.py --input-len=16384 --output-len=1024 --concurrency=16
5353

5454
numactl --cpunodebind=1 --membind=1 \
55-
python3 ${SCRIPT_DIR}/all_perf.py --input-len=4096 --output-len=1024 --concurrency=64
55+
python3 ${SCRIPT_DIR}/all_perf.py --input-len=4096 --output-len=1024 --concurrency=16
5656

5757
nvidia-smi -i "$GPU_DEVICE_LIST" -rgc
5858
nvidia-smi --query-gpu=index,name,clocks.gr,clocks.mem,utilization.gpu --format=csv
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
H100 * 4
2+
vllm==0.16.0rc2.dev221+ga5ccc85c8
3+
torch==2.10.0+cu128
4+
cuda==13.1
5+
6+
[BaseLine] triton==3.6.0
7+
# 服务冷启动时间: 1分43秒
8+
# 输入长度: 32K, 输出长度: 1K, 并发数: 64
9+
Output token throughput (tok/s): 1218.17
10+
Total token throughput (tok/s): 40199.48
11+
Median TTFT (ms): 17179.61
12+
Median TPOT (ms): 33.82
13+
Median ITL (ms): 34.69
14+
# 输入长度: 16K, 输出长度: 1K, 并发数: 64
15+
Output token throughput (tok/s): 1846.06
16+
Total token throughput (tok/s): 31383.00
17+
Median TTFT (ms): 8332.61
18+
Median TPOT (ms): 25.63
19+
Median ITL (ms): 31.13
20+
# 输入长度: 4K, 输出长度: 1K, 并发数: 64
21+
Output token throughput (tok/s): 3129.82
22+
Total token throughput (tok/s): 15649.09
23+
Median TTFT (ms): 2077.27
24+
Median TPOT (ms): 18.29
25+
Median ITL (ms): 19.39
26+
27+
[2026/07/11] flag_gems==5.3.0rc2 (2026/05), flagtree===0.6.0 (2026/06/26)
28+
# 服务冷启动时间: 7分13秒, 服务热启动时间: 2分3秒
29+
# 输入长度: 32K, 输出长度: 1K, 并发数: 64
30+
Output token throughput (tok/s): 827.43
31+
Total token throughput (tok/s): 27305.25
32+
Median TTFT (ms): 29391.30
33+
Median TPOT (ms): 46.98
34+
Median ITL (ms): 32.13
35+
# 输入长度: 16K, 输出长度: 1K, 并发数: 64
36+
Output token throughput (tok/s): 1355.01
37+
Total token throughput (tok/s): 23035.15
38+
Median TTFT (ms): 14824.90
39+
Median TPOT (ms): 32.08
40+
Median ITL (ms): 23.82
41+
# 输入长度: 4K, 输出长度: 1K, 并发数: 64
42+
Output token throughput (tok/s): 2345.05
43+
Total token throughput (tok/s): 11725.28
44+
Median TTFT (ms): 4025.38
45+
Median TPOT (ms): 23.45
46+
Median ITL (ms): 23.40

0 commit comments

Comments
 (0)