Skip to content

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

Open
fengshaoyi-amd wants to merge 4 commits into
mainfrom
fengshaoyi/glm53-gfx942-blockscale-ck
Open

fengshaoyi-amd wants to merge 4 commits into
mainfrom
fengshaoyi/glm53-gfx942-blockscale-ck

Conversation

@fengshaoyi-amd

@fengshaoyi-amd fengshaoyi-amd commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Replaces #5117, which was opened from my fork: same change, now from a branch in this repository so that run-sweep.yml can 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 with e7d2453f2 on 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.

concurrency 1 concurrency 8
P50 TPOT (ms) 19.9 -> 15.8 (0.80x) 25.8 -> 20.5 (0.79x)
Output tok/s per GPU 13.4 -> 15.8 41.9 -> 49.3
P50 interactivity (tok/s/user) 38.8 -> 50.6 34.5 -> 42.0
P50 TTFT (s) 1.10 -> 0.79 0.59 -> 0.58

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
  • Model/version: Claude Opus 5.5, in Cursor
  • Role: investigation, the MI325X measurements, the recipe and changelog change, and this description.
PR checklist and change type

Type of Change

  • Bug fix
  • New feature
  • Configuration change
  • Documentation update
  • Other (please describe)

Checklist

  • I have completed the AI model disclosure and kept it current
  • I have tested my changes locally
  • I have updated documentation if necessary
  • If python -m infx.matrix.changed --base origin/main lists affected config keys, I have appended one new entry covering them to the physical end of inferencex-e2e/perf-changelog.yaml; if it lists none, I have added none. I have not edited historical entries
  • If this PR appends an inferencex-e2e/perf-changelog.yaml entry, it carries exactly one primary sweep label (a maintainer applies it on fork PRs): full-sweep-fail-fast (recommended), full-sweep-enabled, or non-canary-full-sweep-enabled. Optional modifiers all-evals, evals-only, and agentx-fast require a primary label; the last two block reuse while applied.
  • Before merging via reuse, a maintainer with write access to the repository has commented /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 改动,以及本说明的撰写。

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the contribution!

  • Review: If this PR changes files owned by someone other than a repository admin or @SemiAnalysisAI/core, ask one eligible CODEOWNER to complete the latest PR_REVIEW_CHECKLIST.md before contacting a core maintainer on Slack. Follow the template exactly, including As a PR reviewer and CODEOWNER, I have reviewed this and have, so sign-off verification triggers.
  • PR verification: Sweeps run only when the PR appends an inferencex-e2e/perf-changelog.yaml entry and carries exactly one primary label: full-sweep-fail-fast (strongly recommended; canary plus per-matrix fail-fast), full-sweep-enabled (canary; matrix jobs continue after a failure), or non-canary-full-sweep-enabled (no canary or fail-fast). The modifiers all-evals, evals-only, and agentx-fast require a primary label. On fork PRs, a maintainer applies the label. See sweep labels and reuse.
  • After merging: PR authors must ensure all GitHub Actions jobs pass. Transient failures often pass on rerun; see how to rerun failed jobs.
中文

感谢你的贡献!

  • **审阅:**如果 PR 修改的文件归属于仓库管理员及 @SemiAnalysisAI/core 之外的 CODEOWNER,请先联系一位有资格的 CODEOWNER 填写最新的 PR_REVIEW_CHECKLIST.md,再通过 Slack 联系核心维护者。必须严格遵循模板,并保留 As a PR reviewer and CODEOWNER, I have reviewed this and have,才能触发签核验证。
  • **PR 验证:**只有当 PR 在 inferencex-e2e/perf-changelog.yaml 末尾追加了条目,并且恰好带有一个主标签时,才会运行扫描:full-sweep-fail-fast(强烈推荐;canary 加逐矩阵 fail-fast)、full-sweep-enabled(有 canary;矩阵任务在失败后继续运行)或 non-canary-full-sweep-enabled(无 canary,也无 fail-fast)。修饰标签 all-evals、evals-only 和 agentx-fast 必须与主标签一起使用。fork PR 的标签由维护者添加。参见扫描标签与复用。
  • **合并后:**PR 作者必须确保所有 GitHub Actions 任务通过。临时性失败通常可以通过重新运行恢复;参见重新运行失败任务的说明。

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 base env block. In amd-master.yaml, glm5.3flash-fp8-mi300x-sglang-agentic-mtp uses every agentx/agg-variants.yaml override, and glm5.3flash-fp8-mi325x-sglang-agentic-mtp uses agentic.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. Its pull/XXX link 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.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

@fengshaoyi-amd

Copy link
Copy Markdown
Collaborator Author

/use 44660425195

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

@fengshaoyi-amd staged run 44660425195.

This run remains available across future /stage-results requests. Staging the same run ID again updates its staged data. Staging workflow

fengshaoyi-amd and others added 2 commits November 23, 2026 10:21
…42-blockscale-ck

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@fengshaoyi-amd fengshaoyi-amd added full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended) and removed full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended) labels Nov 23, 2026
@fengshaoyi-amd

Copy link
Copy Markdown
Collaborator Author

/use 45103716929

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

@fengshaoyi-amd staged run 45103716929.

This run remains available across future /stage-results requests. Staging the same run ID again updates its staged data. Staging workflow

…42-blockscale-ck

Co-authored-by: Cursor <cursoragent@cursor.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-sweep-fail-fast Full sweep with canary gate; first failure cancels the rest of that matrix (recommended)

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant