Repository navigation
Run GLM-5.3-Flash MI300X/MI325X block-FP8 linears on aiter's CK GEMM / GLM-5.3-Flash MI300X/MI325X 的 block-FP8 线性层改用 aiter CK GEMM - #5150
Conversation
|
Thanks for the contribution!
中文感谢你的贡献!
|
There was a problem hiding this comment.
I reviewed this PR and found no bugs. A human should still look before merge: the AMD recipe owners own both recipe directories, and the flag switches the dense FP8 GEMM to a kernel path that upstream left opt-in because of an unexplained accuracy drop. MI300X was not measured.
What was reviewed:
- Both recipes get the env var in the
baseenv block. In amd-master.yaml,glm5.3flash-fp8-mi300x-sglang-agentic-mtpuses everyagentx/agg-variants.yamloverride, andglm5.3flash-fp8-mi325x-sglang-agentic-mtpusesagentic.yaml. So every row of the two listed keys picks up the flag, and the changelog's config keys match. - The changelog block is a regular entry, not
append-only, added only at the tail with the existing bytes unchanged. Itspull/XXXlink follows the placeholder form shown in CONTRIBUTING.md. - The new comment is a one-line note about a hardware or upstream quirk, as the comment rules require.
- Not done here: no sweep or eval run. The accuracy claims for MI300X and MI325X rest on the PR's own numbers and the sweep's evals.
Extended reasoning...
The change adds one env var, SGLANG_AITER_GFX942_BLOCKSCALE_USE_CK=1, to the base env of two single-node GLM-5.3-Flash SGLang recipes (MI300X agentx/agg-variants.yaml and MI325X mi325x-fp8-mtp/agentic.yaml), and appends one perf-changelog entry for the two matching config keys. It touches no security-sensitive surface. I deferred for two reasons. First, .github/CODEOWNERS assigns the mi300x-* and mi325x-* srt-slurm recipe directories to the AMD recipe owners. Second, the flag changes which GEMM kernel computes the model's dense linears, which can affect accuracy, and only the PR's own MI325X GSM8K run backs it.
|
View unofficial run (performance): https://inferencex.semianalysis.com/inference?unofficialRun=45103716929 View unofficial run (accuracy): https://inferencex.semianalysis.com/evaluation?unofficialRun=45103716929 |
|
/use 44660425195 |
|
@fengshaoyi-amd staged run 44660425195.
This run remains available across future |
…42-blockscale-ck Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
/use 45103716929 |
|
@fengshaoyi-amd staged run 45103716929.
This run remains available across future |
…42-blockscale-ck Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Replaces #5117, which was opened from my fork: same change, now from a branch in this repository so that
run-sweep.ymlcan sweep it. The trusted external sweep on #5117 (run 44072959411) passed. The SGLang cookbook documents these commands, including this variable (sgl-project/sglang#51172).On gfx942, SGLang runs dense block-FP8 linears through aiter's Triton
gemm_a8w8_blockscale. In the aiter of the SGLang v0.5.23 image (285579b62), as in v0.5.22's (e7d2453f2), four of GLM-5.3-Flash's six linear shapes at TP4 have no gfx942 Triton config. They run the 128x128 default tile, 6-14x slower than aiter's CK blockscale GEMM at decode token counts (measured withe7d2453f2on MI325X, M = 8: 205 vs 15 us for N=1024 K=4096).This PR sets
SGLANG_AITER_GFX942_BLOCKSCALE_USE_CK=1(sgl-project/sglang#41071) in the GLM-5.3-Flash MI300X and MI325X AgentX recipes, which routes those linears to CK. It is interim: aiter main now has gfx942 Triton configs for all four shapes (ROCm/aiter#6757, ROCm/aiter#8150), and once the image picks them up, the default path catches up.Risk: sgl-project/sglang#41071 kept CK opt-in because Qwen3-32B-FP8 lost about 2 GSM8K points with it, for a reason it could not find. GLM-5.3-Flash shows no such loss (below). MI300X was not in this A/B; its sweep eval passes (below).
This PR's sweep on the SGLang v0.5.23 image (run 45103716929) is green, and its evals pass on both GPUs: GSM8K strict-match 0.9735 on MI300X and 0.9727 on MI325X. The MI300X eval hung while capturing CUDA graphs on its first attempt and passed on rerun; the MI300X c40 benchmark point, which captures the same graphs, passed first time. Against main's v0.5.23 results (the #5107 and #5074 sweeps: same image and recipes, without this variable), median interactivity is 10-28% higher and output throughput per GPU 7-16% higher at all 17 points, and median TTFT is lower at every point. The earlier sweep on the v0.5.22 image (run 44660425195) was green too.
Results on MI325X, outside InferenceX CI: the MI325X recipe's c1 and c8 overrides, TP4 EP4, AgentX trace replay at InferenceX's golden acceptance length, 900 s at c1 and 1200 s at c8. The runs without the flag were one day earlier on the same node.
GSM8K, target model only (no MTP): lm-evaluation-harness
gsm8k, 5-shot as multi-turn chat, 1319 questions, greedy. 0.9719 (1282/1319) without the flag, 0.9742 (1285/1319) with it, the same under strict-match and flexible-extract. Paired by question, 3 questions are solved only without it and 6 only with it (exact McNemar p = 0.51).AI model disclosure
PR checklist and change type
Type of Change
Checklist
python -m infx.matrix.changed --base origin/mainlists affected config keys, I have appended one new entry covering them to the physical end ofinferencex-e2e/perf-changelog.yaml; if it lists none, I have added none. I have not edited historical entriesinferencex-e2e/perf-changelog.yamlentry, it carries exactly one primary sweep label (a maintainer applies it on fork PRs):full-sweep-fail-fast(recommended),full-sweep-enabled, ornon-canary-full-sweep-enabled. Optional modifiersall-evals,evals-only, andagentx-fastrequire a primary label; the last two block reuse while applied./use <run_id>(or the legacy/reuse-sweep-run) on this PR. Do this only once there is a final full sweep that is all green with evals passing, since after this comment the primary sweep label will no longer automatically kick off new sweeps. Remove and re-add the primary sweep label to force a new sweep.中文
本 PR 取代 #5117(原 PR 来自我的个人 fork):改动相同,改从本仓库的分支提交,以便
run-sweep.yml正常跑 sweep。#5117 上的可信外部 sweep(run 44072959411)已通过。SGLang cookbook 已收录这些启动命令,包括这个环境变量(sgl-project/sglang#51172)。在 gfx942 上,SGLang 默认用 aiter 的 Triton
gemm_a8w8_blockscale计算稠密 block-FP8 线性层。SGLang v0.5.23 镜像自带的 aiter(285579b62)和 v0.5.22 的(e7d2453f2)一样,GLM-5.3-Flash 在 TP4 下的 6 个线性层形状中有 4 个没有 gfx942 的 Triton 配置,只能用 128x128 的默认 tile。在 decode 规模下,它比 aiter 的 CK blockscale GEMM 慢 6–14 倍(用e7d2453f2在 MI325X 上实测,M = 8,N=1024 K=4096:205 us 对 15 us)。本 PR 在 GLM-5.3-Flash 的 MI300X 和 MI325X AgentX 配方中设置
SGLANG_AITER_GFX942_BLOCKSCALE_USE_CK=1(sgl-project/sglang#41071),让这些线性层改走 CK。这是过渡方案:aiter 主线已为这 4 个形状加上 gfx942 的 Triton 配置(ROCm/aiter#6757、ROCm/aiter#8150),等镜像更新后,默认路径就能追上。风险:sgl-project/sglang#41071 让 CK 保持可选,是因为 Qwen3-32B-FP8 开启后 GSM8K 下降约 2 分,原因未查明。GLM-5.3-Flash 没有出现这种下降:只跑目标模型时,GSM8K 从 0.9719 变为 0.9742,逐题配对检验 p = 0.51。MI300X 没有做这组对比,但它在 sweep 中的 eval 通过(见下)。
本 PR 在 SGLang v0.5.23 镜像上的 sweep(run 45103716929)全部通过,两种 GPU 的 eval 也都通过:GSM8K strict-match 在 MI300X 上为 0.9735,在 MI325X 上为 0.9727。MI300X 的 eval 第一次在 capture CUDA graph 时卡住,重跑后通过;同样要 capture 这些 graph 的 MI300X c40 benchmark 点第一次就通过了。与 main 上 v0.5.23 的结果相比(#5107 和 #5074 的 sweep:同一镜像、同一配方,只是没有这个变量),17 个点的交互性中位数都提升 10–28%,每 GPU 输出吞吐提升 7–16%,TTFT 中位数也都更低。此前在 v0.5.22 镜像上的 sweep(run 44660425195)同样全部通过。
MI325X 结果(在 InferenceX CI 之外测得,c1 / c8):P50 TPOT 从 19.9 / 25.8 ms 降到 15.8 / 20.5 ms,每卡输出吞吐从 13.4 / 41.9 升到 15.8 / 49.3 tok/s。
改动类型:配置变更。
AI 模型使用说明:Claude Opus 5.5(Cursor),负责问题排查、MI325X 实测、配方与 changelog 改动,以及本说明的撰写。