01Result结果
This record reviews the glm53 monokernel work for GLM-5.3 on MI355X. Five PRs built the monokernel. For each PR, we measured what it added on InferenceX AgentX.
这份记录复盘 GLM-5.3 在 MI355X 上的 glm53 monokernel 工作。 monokernel 由五个 PR 构成。 对每个 PR, 我们都测量了它在 InferenceX AgentX 上带来的收益。
The table gives the ITL change on the same requests against the base, at concurrency 1, 2, and 4. Each row includes the PRs above it. The BF16 ladder is the PR campaign (3600 s, BF16 KV in both groups). The FP8 ladder uses the real recipe (900 s, FP8 KV).
下表是同一批请求相对 base 的 ITL 变化, 并发为 1、2、4。 每一行都包含它上面的所有 PR。 BF16 阶梯是 PR 开发时的测试(3600 秒, 两组都用 BF16 KV)。 FP8 阶梯使用正式配方(900 秒, FP8 KV)。
| PRPR | Change改动 | ITL, BF16 ladderITL, BF16 阶梯 | ITL, FP8 ladderITL, FP8 阶梯 | Verdict结论 |
|---|---|---|---|---|
| sgl-amd-mono#7 | decode monokernel: one launch per MoE layerdecode monokernel: 每个 MoE 层一次 launch | - | - | Base of all later PRs. It cannot serve the MTP recipe alone.后续所有 PR 的基础。 它本身不能用于 MTP 配方。 |
| sgl-amd-mono#15 | MTP verify steps on the monokernelmonokernel 运行 MTP 的 verify 步 | 0.0% / −6.7% / +4.5% | −17.2% / −11.7% / −13.1% | Needed for the recipe. Faster below 192k tokens, slower above (section 09).配方需要它。 192k token 以下更快, 以上更慢(第 09 节)。 |
| sgl-amd-mono#24 | top-k of a long row on up to 16 CTAs长行的 top-k 分给最多 16 个 CTA | −14.3% / −19.6% / −15.8% | −23.6% / −21.3% / −15.9% | Removes most of the loss above 192k.去掉了 192k 以上的大部分损失。 |
| sgl-amd-mono#42 | score 16 keys per wave, reads in flight每个 wave 给 16 个 key 打分, 读取提前发出 | −30.5% / −31.2% / −28.5% | −28.3% / −27.4% / −24.1% | Largest gain, almost equal at all context lengths.收益最大, 各个上下文长度下几乎相同。 |
| sgl-amd-mono#60 | use the FP8 E4M3 KV cache of the recipe使用配方的 FP8 E4M3 KV cache | - | - | Removes the TTFT cost of BF16 KV. The ITL gain becomes a score gain.去掉 BF16 KV 的 TTFT 代价, ITL 收益才变成分数收益。 |
We measured the final result in the 3600-s window of InferenceX. With all five PRs, the recipe beats the recipe without the monokernel on all three headline metrics. Each gain is larger than the A/A noise at concurrency 2: 2.7% for throughput, 1.3% for interactivity, 2.7% for P90 E2EL.
最终结果是在 InferenceX 的 3600 秒窗口下测得的。 加上全部五个 PR 后, 三个头条指标都好于不开 monokernel 的配方。 每个增益都大于 c2 的 A/A 噪声: 吞吐 2.7%, 交互性 1.3%, P90 E2EL 2.7%。
| Concurrency并发 | Throughput (tok/s/GPU)吞吐(tok/s/GPU) | Interactivity交互性 | P90 E2ELP90 E2EL | P90 TTFTP90 TTFT |
|---|---|---|---|---|
| c1 | 1991 → 2377 +19.4% | 103.3 → 119.0 +15.2% | 23.3 → 19.1 s +21.8% | 1.71 → 1.26 s +35.6% |
| c2 | 2173 → 2500 +15.1% | 94.8 → 104.1 +9.8% | 22.0 → 18.4 s +19.4% | 0.99 → 0.99 s +0.4% |
| c4 | 3215 → 3683 +14.6% | 93.5 → 106.0 +13.4% | 22.1 → 17.7 s +24.4% | 0.92 → 0.95 s −2.7% |
| c10 | 6959 → 7165 +3.0% | 66.6 → 73.0 +9.7% | 23.3 → 21.5 s +8.3% | 0.97 → 0.96 s +0.8% |
Each cell shows base → monokernel and the gain. For a latency, the gain is base / monokernel − 1. A positive gain is always better.
每格显示 base → monokernel 和增益。 延迟的增益等于 base / monokernel − 1。 增益为正, 总是表示更好。
02What the monokernel doesmonokernel 做了什么
On the normal path, SGLang runs a GLM-5.3 decode step layer by layer. For one request at TP8, a step launches 1,821 GPU kernels and takes 11.70 ms of GPU time.
在 normal path 上, SGLang 逐层运行 GLM-5.3 的一个 decode 步。 TP8、单请求时, 一步要发起 1,821 个 GPU kernel, GPU 时间是 11.70 ms。
The monokernel replaces each of the 75 MoE decoder layers (layers 3 to 77) with one persistent launch. Then the same step has 212 kernels and takes 5.59 ms (sgl-amd-mono#7, no MTP).
monokernel 把 75 个 MoE decoder 层(第 3 到 77 层)各换成一次常驻 launch。 这样同一步只有 212 个 kernel, 用时 5.59 ms(sgl-amd-mono#7, 不开 MTP)。
- Coverage: at TP8 the monokernel runs steps of 8 rows or fewer. A step with fewer rows runs at the next width (2, 4, or 8) with pad rows. Larger steps use the normal path.
- 覆盖范围: TP8 时, monokernel 运行 8 行以内的步。 行数不够时, 按下一档宽度(2、4 或 8)运行, 多出的是填充行。 更大的步走 normal path。
- With MTP (3 draft steps), each request has 4 verify rows. Thus the monokernel serves verify steps of one or two requests.
- 开 MTP(3 个 draft 步)时, 每个请求有 4 个 verify 行。 所以 monokernel 负责 1 到 2 个请求的 verify 步。
- GLM-5.3 uses DeepSeek Sparse Attention. On an indexer layer, each row scores all keys of its context and keeps the top 2048. The other layers reuse that selection.
- GLM-5.3 使用 DeepSeek 稀疏注意力。 在 indexer 层, 每一行给上下文中的所有 key 打分, 保留前 2048 个。 其他层复用这个选择结果。
- The indexer stage grows with the context. AgentX contexts are long: the median input of a request is 89k to 285k tokens.
- indexer 阶段随上下文变长而变慢。 AgentX 的上下文很长: 请求输入的中位数是 89k 到 285k token。
03How InferenceX scores AgentXInferenceX 怎样给 AgentX 打分
AgentX replays recorded multi-turn agent sessions. Each turn adds text to the prompt and reuses the cached prefix. Concurrency is the number of live sessions.
AgentX 回放录制的多轮 agent 会话。 每一轮都在 prompt 后面追加内容, 并复用已缓存的前缀。 并发数是同时在跑的会话数。
- Throughput: total tokens per second per GPU.
- 吞吐: 每张 GPU 每秒处理的总 token 数。
- Interactivity: 1 / P90 of (E2EL / OSL), in tokens per second per user. This page uses "interactivity" for this metric.
- 交互性: 1 / (E2EL / OSL) 的 P90, 单位是每用户每秒 token。 本页用“交互性”指这个指标。
- P90 E2EL: the 90th percentile of the end-to-end latency.
- P90 E2EL: 端到端延迟的 90 分位。
Interactivity is sensitive to TTFT. E2EL = TTFT + (OSL − 1) × ITL. For a short reply, most of E2EL is TTFT, and the P90 of E2EL / OSL comes from the short replies. Thus a faster decode helps interactivity only a little, and a longer TTFT makes it worse.
交互性对 TTFT 很敏感。 E2EL = TTFT + (OSL − 1) × ITL。 短回复的 E2EL 主要是 TTFT, 而 E2EL / OSL 的 P90 由短回复决定。 所以 decode 变快, 交互性只改善一点;TTFT 变长, 交互性就变差。
04The PR seriesPR 系列
Five PRs changed the GLM-5.3 path. Each PR measured its own change in its description. Those tests used short prompts or kernel timelines, not the AgentX workload.
五个 PR 改动了 GLM-5.3 的路径。 每个 PR 都在正文里测量了自己的改动。 那些测试用的是短 prompt 或 kernel timeline, 不是 AgentX 负载。
| PRPR | Merged合并 | Change改动 | Measured in the PRPR 自己的测量 |
|---|---|---|---|
| sgl-amd-mono#7 | 10-18 | adds the decode monokernel加入 decode monokernel | TPOT 11.24 → 5.60 ms, TP8, 1 request, 8192 in / 256 out, no MTPTPOT 11.24 → 5.60 ms, TP8, 单请求, 8192 输入 / 256 输出, 不开 MTP |
| sgl-amd-mono#15 | 10-22 | serves MTP verify steps; fixes 3 defects运行 MTP verify 步;修复 3 个缺陷 | verify step 13.56 → 8.35 ms, 1 request, 4096-token promptsverify 步 13.56 → 8.35 ms, 单请求, 4096 token 的 prompt |
| sgl-amd-mono#24 | 10-25 | selects a long row's top-k on up to 16 CTAs长行的 top-k 分给最多 16 个 CTA 选 | selection at 256k keys, 1 row: 207 → 60 µs256k key、1 行时, 选择阶段 207 → 60 µs |
| sgl-amd-mono#42 | 10-25 | scores 16 keys per wave over 32 heads每个 wave 为 32 个 head 给 16 个 key 打分 | score stage at 256k keys, 1 row: 44 → 12 µs256k key、1 行时, 打分阶段 44 → 12 µs |
| sgl-amd-mono#60 | 10-26 | reads and writes SGLang's FP8 E4M3 MLA cache读写 SGLang 的 FP8 E4M3 MLA cache | TTFT stays at the recipe's value (section 07)TTFT 保持在配方的水平(第 07 节) |
| sgl-amd-mono#11 sgl-amd-mono#12 sgl-amd-mono#25 | 10-18 – 10-22 | common code and the SGLang interface公共代码和 SGLang 接口 | no GLM-5.3 speed change measured没有测到 GLM-5.3 的速度变化 |
| sgl-amd-mono#55 | 10-25 | test settings only只改测试设置 | - |
05Why long contexts were slow长上下文为什么慢
The PRs measured each stage with a debug build. At 256k keys and one row, the exact top-2048 selection took 207 µs on one CTA. The other CTAs of the launch waited for it. A launch without the indexer took about 54 µs at all contexts.
这些 PR 用 debug 版本测量了每个阶段。 256k key、1 行时, 精确的 top-2048 选择在一个 CTA 上要 207 µs。 这次 launch 的其他 CTA 都在等它。 不带 indexer 的 launch 在任何上下文下都约 54 µs。
- #24 splits the selection of a row longer than 32768 keys over up to 16 CTAs. Each CTA builds a histogram of its chunks. One CTA finds the threshold. Each CTA then gathers its candidates. The result is still the exact top-2048.
- #24 把超过 32768 个 key 的行分给最多 16 个 CTA 来选。 每个 CTA 给自己的分块建直方图。 一个 CTA 找出阈值。 然后每个 CTA 收集自己的候选。 结果仍然是精确的 top-2048。
- #42 changes the score stage. Before, two waves read each key and added their results through LDS with two barriers. Each tile also waited for two memory round trips. Now one wave scores a group of 16 keys over all 32 heads, and the reads of the next groups are in flight.
- #42 改了打分阶段。 原来每个 key 被两个 wave 读取, 两者再经过 LDS 和两次 barrier 相加。 每个 tile 还要等两次内存往返。 现在一个 wave 为全部 32 个 head 给一组 16 个 key 打分, 后面几组的读取提前发出。
At 256k keys and one row, the estimated step falls from 8.84 ms (#15) to 6.20 ms (#24) and 5.73 ms (#42). At four rows, it falls from 13.45 ms to 10.37 ms and 8.33 ms.
256k key、1 行时, 预估单步时间从 8.84 ms(#15)降到 6.20 ms(#24), 再降到 5.73 ms(#42)。 4 行时, 从 13.45 ms 降到 10.37 ms, 再降到 8.33 ms。
06Ablation 1: the PR ladder with BF16 KVAblation 1: BF16 KV 下的 PR 阶梯
The PR campaign ran each PR on AgentX for 3600 s. Both groups used a BF16 KV cache, because the monokernel accepted only BF16 KV before #60. Setup: image 20261019, SGLang e45cbce599, simulated accept length 2.99.
PR 开发期间, 每个 PR 都在 AgentX 上跑了 3600 秒。 两组都用 BF16 KV cache, 因为 #60 之前 monokernel 只接受 BF16 KV。 环境: 镜像 20261019, SGLang e45cbce599, 模拟接受长度 2.99。
| Up to累积到 | Concurrency并发 | TTFTTTFT | ITLITL | E2ELE2EL | Throughput吞吐 | Interactivity交互性 |
|---|---|---|---|---|---|---|
| #15 | c1 | +0.3% | 0.0% | +2.0% | −2.4% | −3.5% |
| #15 | c2 | −0.2% | −6.7% | −5.2% | −1.3% | +2.7% |
| #15 | c4 | +0.4% | +4.5% | +2.9% | −2.7% | −6.5% |
| #24 | c1 | −0.3% | −14.3% | −13.2% | +11.2% | +4.3% |
| #24 | c2 | −0.4% | −19.6% | −15.8% | +14.9% | +10.1% |
| #24 | c4 | −0.2% | −15.8% | −11.5% | +5.8% | −4.3% |
| #42 | c1 | −0.4% | −30.5% | −27.1% | +24.2% | +16.3% |
| #42 | c2 | −1.8% | −31.2% | −25.7% | +18.3% | +20.2% |
| #42 | c4 | −0.4% | −28.5% | −21.1% | +23.5% | +8.2% |
- #15 alone does not reduce ITL at concurrency 1 (0.0%). At concurrency 4, ITL is worse (+4.5%). Throughput is 1% to 3% lower.
- 只有 #15 时, c1 的 ITL 没有降低(0.0%)。 c4 的 ITL 反而变差(+4.5%)。 吞吐低 1% 到 3%。
- With #24, ITL decreases by 14% to 20%.
- 加上 #24 后, ITL 降低 14% 到 20%。
- With #42, ITL decreases by 29% to 31%, about twice the effect of #24 alone.
- 再加上 #42 后, ITL 降低 29% 到 31%, 大约是只有 #24 时的两倍。
- TTFT does not change in this ladder, because both groups use BF16 KV.
- 这个阶梯里 TTFT 不变, 因为两组都用 BF16 KV。
07The baseline gap and #60对照组的差距与 #60
The InferenceX recipe uses an FP8 E4M3 KV cache. The PR campaign compared against a BF16 baseline. Thus its gains did not show what the monokernel adds to the real recipe.
InferenceX 的配方使用 FP8 E4M3 KV cache。 PR 开发期间的对照组用的是 BF16。 所以那些收益不能说明 monokernel 给正式配方带来了多少。
Test 1 compared the monokernel with all PRs up to #42 (BF16 KV) against the recipe (FP8 KV), at 900 s. On the same requests, ITL changed by −28% to −30%, but TTFT changed by +10% to +22%. Interactivity did not improve. The decision rule gave no-go.
测试 1 用包含 #42 及以前所有 PR 的 monokernel(BF16 KV), 和配方(FP8 KV)比较, 窗口 900 秒。 在同一批请求上, ITL 变化 −28% 到 −30%, 但 TTFT 变化 +10% 到 +22%。 交互性没有改善, 判定规则给出 no-go。
BF16 KV alone causes the TTFT cost. Without the monokernel, BF16 KV changed TTFT by +11.6% at concurrency 1 and by +23.0% at concurrency 2.
TTFT 的代价来自 BF16 KV 本身。 不开 monokernel 时, BF16 KV 让 c1 的 TTFT 变化 +11.6%, c2 变化 +23.0%。
A prefill profile found the cause. With BF16 KV, one TileLang kernel of the DSA prefill takes ×1.98 its FP8 time, and TTFT increases by 22%. By its grid, this kernel is the sparse attention, which reads 1152 bytes per KV row in BF16 and 576 in FP8. We did not confirm the kernel identity in the source.
一次 prefill profile 找到了原因。 使用 BF16 KV 时, DSA prefill 里的一个 TileLang kernel 耗时是 FP8 下的 ×1.98, TTFT 增加 22%。 按 grid 判断, 这个 kernel 是稀疏 attention: BF16 下每行 KV 读 1152 字节, FP8 下读 576 字节。 我们没有在源码中确认这个 kernel 的身份。
sgl-amd-mono#60 let the monokernel use the FP8 cache of the recipe. The monokernel already had an FP8 path in the same format as SGLang: 576-byte E4M3 rows without block scales. #60 changed only the integration: the spec, the build, and the binding of the KV rows.
sgl-amd-mono#60 让 monokernel 使用配方的 FP8 cache。 monokernel 本来就有 FP8 路径, 格式和 SGLang 相同: 每行 576 字节的 E4M3, 没有分块 scale。 #60 只改了集成部分: spec、构建, 以及 KV 行的绑定。
The e2e checks run SGLang and the monokernel on the same steps and compare each layer by cosine similarity. The negative control shows that the checks can fail. F1 and F2 are the ablation builds of section 08.
e2e check 让 SGLang 和 monokernel 跑同样的步, 逐层比较 cosine 相似度。 负对照证明这些检查能够失败。 F1 和 F2 是第 08 节的 ablation 版本。
| Check检查 | Result结果 | Checks次数 | Min KV cosineKV cosine 最小值 | Min stream cosinestream cosine 最小值 | Violations违例 |
|---|---|---|---|---|---|
| F3 (main): FP8 verify checkF3(main): FP8 verify check | passes通过 | 1200 | 0.99926 | 0.99140 | 0 |
| F1: FP8 verify checkF1: FP8 verify check | passes通过 | 1350 | 0.99913 | 0.99306 | 0 |
| F2: FP8 verify checkF2: FP8 verify check | passes通过 | 1125 | 0.99922 | 0.99578 | 0 |
| F3: BF16 verify check (regression)F3: BF16 verify check(回归) | passes通过 | 1350 | 0.99962 | 0.99686 | 0 |
| Negative control: latent bytes swapped负对照: 交换 latent 的字节 | fails, as expected按预期失败 | 1275 | 0.09501 | 0.99425 | 1189 |
Test 2 repeated the 900-s tests with #60. ITL changed by −21% to −28%, and TTFT by −0.2% to −2.0%. But the A/A noise of interactivity in 900 s was 20%. Test 3 used the 3600-s window, where the A/A noise was 1.3% (section 10).
测试 2 用 #60 重做 900 秒测试。 ITL 变化 −21% 到 −28%, TTFT 变化 −0.2% 到 −2.0%。 但 900 秒内交互性的 A/A 噪声有 20%。 测试 3 改用 3600 秒窗口, A/A 噪声降到 1.3%(第 10 节)。
08Ablation 2: the PR ladder with FP8 KVAblation 2: FP8 KV 下的 PR 阶梯
To measure each PR on the real recipe, we cherry-picked #60 onto two older commits. F1 is 05e0bb02 (#7, #15) plus #60. F2 is 240d587 (#7, #15, #24) plus #60. F3 is main (all five PRs). Each build passed the FP8 layer check with 0 violations (section 07).
为了在正式配方上测量每个 PR, 我们把 #60 cherry-pick 到两个更早的提交上。 F1 是 05e0bb02(#7、#15)加 #60。 F2 是 240d587(#7、#15、#24)加 #60。 F3 是 main(全部五个 PR)。 每个版本都通过了 FP8 逐层检查, 违例为 0(第 07 节)。
Each point ran for 900 s on a new server, at concurrency 1, 2, and 4. We compare the same requests against the two base runs of Test 2. For F3 we use the two monokernel runs of Test 2.
每个点用新的服务器跑 900 秒, 并发为 1、2、4。 我们把同一批请求和测试 2 的两次 base 运行比较。 F3 使用测试 2 里 monokernel 组的两次运行。
| Build版本 | Concurrency并发 | TTFTTTFT | ITLITL | E2ELE2EL | Coverage覆盖率 |
|---|---|---|---|---|---|
| F1 | c1 | +0.4% | −17.2% | −9.6% | 100% |
| F1 | c2 | −1.3% | −11.7% | −9.5% | 94% |
| F1 | c4 | +0.1% | −13.1% | −5.1% | 98% |
| F2 | c1 | +0.5% | −23.6% | −14.9% | 100% |
| F2 | c2 | −0.1% | −21.3% | −14.2% | 97% |
| F2 | c4 | −0.6% | −15.9% | −12.9% | 90% |
| F3 | c1 | −1.7% | −28.3% | −24.9% | 100% |
| F3 | c2 | −0.6% | −27.4% | −20.6% | 96% |
| F3 | c4 | −1.1% | −24.1% | −19.1% | 95% |
- F1 (#7, #15) changes ITL by −17.2% / −11.7% / −13.1% at concurrency 1, 2, and 4.
- F1(#7、#15)让 c1、c2、c4 的 ITL 分别变化 −17.2% / −11.7% / −13.1%。
- F2 (+ #24) changes ITL by −23.6% / −21.3% / −15.9%.
- F2(+ #24)让 ITL 分别变化 −23.6% / −21.3% / −15.9%。
- F3 (+ #42) changes ITL by −28.3% / −27.4% / −24.1%.
- F3(+ #42)让 ITL 分别变化 −28.3% / −27.4% / −24.1%。
- TTFT stays within 3% in every build, because all builds use the FP8 cache of the recipe.
- 每个版本的 TTFT 变化都在 3% 以内, 因为所有版本都使用配方的 FP8 cache。
- At concurrency 1, F1 and #15 of the BF16 ladder differ: −17.2% against 0.0%. Section 09 explains this difference.
- 在 c1, F1 和 BF16 阶梯的 #15 结果不同: −17.2% 对 0.0%。 第 09 节解释了这个差别。
- Drift check: a new base run at concurrency 2 differs from the old base runs by −0.1% in ITL and −0.7% in TTFT.
- 漂移检查: c2 新跑的 base 和以前的 base 相比, ITL 差 −0.1%, TTFT 差 −0.7%。
We use the paired metrics here. In 900-s windows, the A/A noise of the headline interactivity is 20%, too high for this comparison.
这里用的是配对指标。 900 秒窗口下, 头条交互性的 A/A 噪声有 20%, 太大, 不适合这种比较。
09Gain by context length按上下文长度看收益
The first steps of the two ladders disagree. At concurrency 1, #15 changed ITL by 0.0%, but F1 changed it by −17.2%.
两个阶梯的第一步结果不一致。 在 c1, #15 让 ITL 变化 0.0%, F1 却让它变化 −17.2%。
To find the cause, we put each pair of requests into a bin by its input length. We pooled concurrency 1 and 2, where the coverage is 93% or more. Then we compared the two ladders in the same bin.
为了找出原因, 我们按输入长度把每一对请求分段。 我们合并了 c1 和 c2, 这两个并发下覆盖率都在 93% 以上。 然后在同一段内比较两个阶梯。
| Build版本 | below 64k64k 以下 | 64k to 128k64k 到 128k | 128k to 192k128k 到 192k | 192k or more192k 及以上 |
|---|---|---|---|---|
| #15, BF16#15, BF16 | −12.8% | −23.0% | −16.2% | +10.9% |
| F1, FP8F1, FP8 | −7.9% | −20.0% | −12.9% | +16.5% |
| + #24, BF16+ #24, BF16 | −28.3% | −28.5% | −26.1% | −12.3% |
| F2, FP8F2, FP8 | −16.3% | −25.7% | −22.4% | −9.4% |
| + #42, BF16+ #42, BF16 | −33.1% | −32.6% | −31.9% | −30.2% |
| F3, FP8F3, FP8 | −26.2% | −28.8% | −28.0% | −26.0% |
| Requests, BF16请求数, BF16 | 137 | 162 | 76 | 229 |
| Requests, FP8请求数, FP8 | 19 | 93 | 42 | 56 |
F3 pools its two runs at each concurrency. The other steps of a ladder have up to 3 more or fewer pairs than the first step.
F3 合并了每个并发下的两次运行。 同一阶梯的其他步, 配对数和第一步最多相差 3 个。
- In each bin with 30 or more requests, the two ladders agree in direction. The FP8 results are 3 to 6 percentage points worse.
- 在请求数不少于 30 的各段中, 两个阶梯的方向一致。 FP8 阶梯的结果差 3 到 6 个百分点。
- #15 alone makes ITL 13% to 23% lower below 192k, but changes it by +10.9% at 192k or more. F1 shows the same pattern: 8% to 20% lower, and +16.5% at 192k or more.
- 只有 #15 时, 192k 以下 ITL 降低 13% 到 23%, 192k 及以上却变化 +10.9%。 F1 的规律相同: 192k 以下降低 8% 到 20%, 192k 及以上变化 +16.5%。
- This agrees with section 05. Before #24, one CTA selected the top-2048 of a long row, and the other CTAs waited for it.
- 这和第 05 节一致: #24 之前, 长行的 top-2048 由一个 CTA 选出, 其他 CTA 都在等它。
- #24 removes most of this loss. At 192k or more, ITL changes by −12.3% (BF16) and −9.4% (FP8).
- #24 去掉了大部分损失。 192k 及以上, ITL 变化 −12.3%(BF16)和 −9.4%(FP8)。
- #42 makes the gain almost equal at all lengths. ITL is 30% to 33% lower (BF16) and 26% to 29% lower (FP8).
- #42 让各段的收益几乎相同。 ITL 降低 30% 到 33%(BF16)和 26% 到 29%(FP8)。
The aggregate values differ because the two windows contain different requests. The aggregate is the median change over all requests of a run.
汇总值不同, 是因为两个窗口包含的请求不同。 汇总值是一次运行中所有请求变化的中位数。
| Window and build, c1窗口和版本, c1 | below 64k64k 以下 | 64k to 128k64k 到 128k | 128k to 192k128k 到 192k | 192k or more192k 及以上 | All requests全部请求 |
|---|---|---|---|---|---|
| 3600 s, #15 (BF16): share of requests3600 秒, #15(BF16): 请求占比 | 6% | 27% | 15% | 52% | - |
| 3600 s, #15 (BF16): ITL change3600 秒, #15(BF16): ITL 变化 | −12.6% | −24.0% | −16.4% | +11.7% | 0.0% |
| 900 s, F1 (FP8): share of requests900 秒, F1(FP8): 请求占比 | 6% | 48% | 9% | 37% | - |
| 900 s, F1 (FP8): ITL change900 秒, F1(FP8): ITL 变化 | −27.1% | −21.7% | −14.2% | +16.6% | −17.2% |
At concurrency 1, 52% of the 3600-s requests are 192k or more, against 37% of the 900-s requests. These long requests are slower with #15 alone. Thus the median in the 3600-s window is near zero.
在 c1, 3600 秒窗口里有 52% 的请求在 192k 及以上, 900 秒窗口里只有 37%。 只有 #15 时, 这些长请求变慢。 所以 3600 秒窗口的中位数接近 0。
The two ladders also differ in image, SGLang commit, KV type, and window. Thus we cannot assign the remaining difference in each bin to one cause.
两个阶梯的镜像、SGLang 提交、KV 类型和窗口都不同。 所以每一段里剩下的差别, 无法归于某一个原因。
10Result at 3600 s3600 秒的结果
Test 3 used the 3600-s window of InferenceX at concurrency 1, 2, 4, and 10. Each point used a new server. All nine runs were valid, and the measured accept length was 2.990 (target 2.99).
测试 3 使用 InferenceX 的 3600 秒窗口, 并发为 1、2、4、10。 每个点都用新的服务器。 九次运行全部有效, 实测接受长度是 2.990(目标值 2.99)。
| Concurrency并发 | Pairs配对数 | TTFTTTFT | ITLITL | E2ELE2EL | Coverage覆盖率 |
|---|---|---|---|---|---|
| c1 | 238 | −1.4% | −26.6% | −24.4% | 100% |
| c2 | 359 | −0.7% | −27.2% | −20.8% | 99% |
| c4 | 544 | −0.2% | −17.0% | −13.7% | 96% |
| c10 | 1410 | −1.1% | −2.8% | −2.4% | 46% |
Coverage is the share of decode steps with one or two running requests. At concurrency 10 it is 46%, so the gain is smaller there.
覆盖率是同时运行 1 到 2 个请求的 decode 步所占的比例。 c10 的覆盖率是 46%, 所以那里的收益更小。
11What did not help没有帮助的尝试
These changes or methods gave a small gain, no gain, or a loss. Some of them were needed anyway.
这些改动或方法的收益很小、没有收益, 或者带来了损失。 其中有一些仍然是必需的。
| Item项目 | Measurement测量结果 | Verdict结论 |
|---|---|---|
| sgl-amd-mono#15 alone on AgentX只有 sgl-amd-mono#15 时的 AgentX | ITL 0.0% / −6.7% / +4.5% (BF16 ladder); +10.9% and +16.5% at 192k or moreITL 0.0% / −6.7% / +4.5%(BF16 阶梯);192k 及以上 +10.9% 和 +16.5% | needed, but slower at long contexts until #24必需, 但在 #24 之前长上下文更慢 |
| sgl-amd-mono#19: cheaper guarded waits (open)sgl-amd-mono#19: 更便宜的 guarded wait(未合并) | TPOT c1 −2.5%, c4 −0.6%, c8 +2.3% (no MTP, fixed length)TPOT c1 −2.5%、c4 −0.6%、c8 +2.3%(不开 MTP, 固定长度) | small, and slower at c8收益小, c8 还变慢 |
| histogram in the score stage (local attempt)在打分阶段建直方图(本地尝试) | correct, but global atomics slowed scoring: 0.87× to 1.17×结果正确, 但全局 atomic 拖慢了打分: 0.87× 到 1.17× | dropped已放弃 |
| route to the normal path by context length按上下文长度切回 normal path | not possible: the route is fixed for each captured decode graph做不到: 每个 decode graph 捕获时路由就固定了 | dropped已放弃 |
| f32 against bf16 expert routing (SGLang normal path)专家路由用 f32 还是 bf16(SGLang normal path) | accept length unchanged; c1 TPOT 5.36 → 5.52 ms with f32 (+3.0%); GSM8K 97.73% vs 97.57% (p = 0.77)接受长度不变;c1 TPOT 用 f32 时 5.36 → 5.52 ms(+3.0%);GSM8K 97.73% 对 97.57%(p = 0.77) | no accuracy gain, small speed cost没有精度收益, 速度略有损失 |
| monokernel with BF16 KV (Test 1)monokernel 配 BF16 KV(测试 1) | ITL −28% to −30%, TTFT +10% to +22%ITL −28% 到 −30%, TTFT +10% 到 +22% | no-go against the FP8 recipe和 FP8 配方相比 no-go |
| 900-s windows for P90 decisions用 900 秒窗口判定 P90 | A/A noise of interactivity 20%交互性的 A/A 噪声 20% | too noisy; use 3600 s噪声太大;改用 3600 秒 |
| sgl-amd-mono#18: A4W4, TP4 16-token scheduling, indexer CP (closed)sgl-amd-mono#18: A4W4、TP4 16 token 调度、indexer CP(已关闭) | not measured here这里没有测 | - |
12Accuracy精度
Each PR tested accuracy in its own way. No PR showed a measurable loss. The last row compares base and monokernel answers on the real recipe at 3600-s settings.
每个 PR 用自己的方法测试了精度。 没有一个 PR 显示出可测量的损失。 最后一行是在正式配方上, 比较 base 和 monokernel 的答案。
| PRPR | Test测试 | Result结果 | Note说明 |
|---|---|---|---|
| sgl-amd-mono#7 | GSM8K 1319, thinkingGSM8K 1319, thinking | 97.35% → 97.27% | McNemar p = 1.00McNemar p = 1.00 |
| sgl-amd-mono#7 | AIME26, 30 × 8AIME26, 30 × 8 | 82.92% → 86.67% | inside noise在噪声内 |
| sgl-amd-mono#15 | GSM8K 1319, 5-shot, MTPGSM8K 1319, 5-shot, MTP | 92.65% → 92.34% | p = 0.70; accept length 3.253 → 3.288p = 0.70;接受长度 3.253 → 3.288 |
| sgl-amd-mono#24 | exact top-k against an oracle精确 top-k 对照 oracle | 312 rows, 0 differ312 行, 0 行不同 | 8k to 256k keys8k 到 256k key |
| sgl-amd-mono#42 | scores against #24 in one launch同一次 launch 里和 #24 的打分比较 | 59.6M keys, all bitwise equal5960 万个 key, 全部逐位相等 | decode and MTP verifydecode 和 MTP verify |
| sgl-amd-mono#60 | GSM8K 1319, three pairs, strict-matchGSM8K 1319, 三组, strict-match | 24 / 16 | McNemar p = 0.27McNemar p = 0.27 |
For #60, two runs of the monokernel group differ by 3 to 12 questions, more than the base-vs-monokernel pairs. Thus the differences are run-to-run variation.
对 #60, monokernel 组自己跑两次就差 3 对 12 题, 比 base 对 monokernel 的差别还大。 所以这些差别是两次运行之间的波动。
13Comparison with published results和已发布结果比较
The InferenceX API has no vLLM AgentX result for GLM-5.x. For GLM-5.3 on MI355X, it has one TileRT point at concurrency 1 on 16 GPUs. Against it, the monokernel group has +55% throughput per GPU and +21% interactivity.
InferenceX 的 API 里没有 GLM-5.x 的 vLLM AgentX 结果。 MI355X 上的 GLM-5.3 只有一个 TileRT 的点: c1, 16 张 GPU。 和它相比, monokernel 组的每卡吞吐是 +55%, 交互性是 +21%。
GLM-5.3 on B300 with NVFP4 is better. At concurrency 10, our throughput is 24% lower and our interactivity is 37% lower. Our P90 output length is 2.1 to 2.8 times the B300 value, so do not compare E2EL directly.
B300 上的 GLM-5.3 NVFP4 更好。 在 c10, 我们的吞吐低 24%, 交互性低 37%。 我们的 P90 输出长度是 B300 的 2.1 到 2.8 倍, 所以不要直接比较 E2EL。
| Concurrency并发 | Published configuration已发布配置 | Throughput吞吐 | Interactivity交互性 | P90 E2EL (s)P90 E2EL(秒) | Source来源 |
|---|---|---|---|---|---|
| c1 | GLM-5.3 MI355X TileRT FP8 (disagg, 16 GPUs) | 1534 | 98.4 | 12.7 | InferenceX 2026-10-07 id 444205 |
| c1 | GLM-5.2 MI355X SGLang FP8 TP8 | 2799 | 61.9 | 13.3 | InferenceX 2026-09-19 id 442726 |
| c1 | GLM-5.2 MI355X SGLang FP4 TP8 | 3087 | 69.6 | 12.4 | InferenceX 2026-10-06 id 444159 |
| c1 | GLM-5.2 MI355X ATOM FP4 TP8 | 2143 | 93.3 | 22.0 | InferenceX 2026-09-22 id 442942 |
| c1 | GLM-5.3 B300 SGLang FP4 TP8 | 3651 | 114.1 | 7.2 | InferenceX 2026-10-22 id 446063 |
| c2 | GLM-5.2 MI355X SGLang FP8 TP8 | 2785 | 66.6 | 11.1 | InferenceX 2026-09-19 id 442728 |
| c2 | GLM-5.2 MI355X SGLang FP4 TP8 | 3118 | 77.4 | 12.3 | InferenceX 2026-10-06 id 444153 |
| c2 | GLM-5.2 MI355X ATOM FP4 TP8 | 2369 | 98.2 | 18.3 | InferenceX 2026-09-22 id 442948 |
| c4 | GLM-5.2 MI355X SGLang FP8 TP8 | 4012 | 64.2 | 10.8 | InferenceX 2026-09-19 id 442722 |
| c4 | GLM-5.2 MI355X SGLang FP4 TP8 | 4345 | 77.3 | 10.5 | InferenceX 2026-10-06 id 444154 |
| c4 | GLM-5.2 MI355X ATOM FP4 TP8 | 3563 | 104.5 | 16.6 | InferenceX 2026-09-22 id 442951 |
| c4 | GLM-5.3 B300 SGLang FP4 TP8 | 4793 | 114.5 | 5.2 | InferenceX 2026-10-22 id 446068 |
| c10 | GLM-5.2 MI355X SGLang FP8 TP8 | 8172 | 51.7 | 13.5 | InferenceX 2026-09-19 id 442731 |
| c10 | GLM-5.3 B300 SGLang FP4 TP8 | 9399 | 115.9 | 5.8 | InferenceX 2026-10-22 id 446060 |
14Steps to an InferenceX submission提交 InferenceX 还需要的步骤
The kernel work is complete. These steps remain, in this order:
kernel 的工作已经完成。 还剩这些步骤, 按顺序进行:
- SGLang pin update. SGLang main pins sgl-amd-mono at
05e0bb02, which accepts only BF16 KV. The open PR sglang#45045 pinse952b221, which is also older than #60. - SGLang 更新 pin。 SGLang main 把 sgl-amd-mono pin 在
05e0bb02, 它只接受 BF16 KV。 现有的 PR sglang#45045 pin 的是e952b221, 也比 #60 早。 - Image. Use the first MI35x nightly image that includes the new pin.
- 镜像。 使用第一个包含新 pin 的 MI35x nightly 镜像。
- Cookbook. sglang#46662 (draft) adds the recipe to the GLM-5.3 page.
- cookbook。 sglang#46662(draft)把配方加到 GLM-5.3 页面。
- Confirmation run on that image without the overlay, with five or more frontier points.
- 在那个镜像上不加 overlay 做确认运行, 至少要有 5 个前沿点。
- InferenceX PR, sweep, evals, CODEOWNER sign-off, and an authorized
/use. - InferenceX PR、sweep、eval、CODEOWNER 签核, 以及有权限的人发出
/use。
15Method and limits方法和限制
- We used one local node, not the InferenceX cluster. The monokernel commits were installed over the published image.
- 我们用的是一台本地节点, 不是 InferenceX 的集群。 monokernel 的提交装在已发布的镜像上。
- The BF16 ladder comes from an older image and SGLang (20261019, e45cbce599). Compare the two ladders only in the same context bin (section 09).
- BF16 阶梯来自更早的镜像和 SGLang(20261019, e45cbce599)。 两个阶梯只能在同一个上下文长度段内比较(第 09 节)。
- The context bins pool concurrency 1 and 2. The FP8 bin below 64k has only 19 requests.
- 上下文长度分段合并了 c1 和 c2。 FP8 阶梯 64k 以下的分段只有 19 个请求。
- The BF16 ladder ran one run per point, in PR order, from 2026-10-20 to 10-22. Thus day-to-day drift is not separated from the PR effects.
- BF16 阶梯每个点只跑一次, 按 PR 的先后顺序, 在 2026-10-20 到 10-22 跑完。 所以不同日子之间的漂移没有和 PR 的效果分开。
- The FP8 ladder ran F1 and F2 one time each at 900 s. F3 and the base have two runs each. The paired A/A noise of ITL is below 0.5%.
- FP8 阶梯里, F1 和 F2 各跑一次 900 秒。 F3 和 base 各有两次运行。 配对 ITL 的 A/A 噪声低于 0.5%。
- The kernel timelines come from the PR descriptions (debug builds, decode steps, random prompts).
- kernel timeline 来自 PR 正文(debug 版本, decode 步, 随机 prompt)。
- The AgentX runs use the synthetic acceptance of InferenceX (accept length 2.99). The GSM8K runs use real acceptance.
- AgentX 运行使用 InferenceX 的模拟接受(接受长度 2.99)。 GSM8K 运行使用真实接受。
- Before each run, we checked that all 8 GPUs were idle and locked them. Each point used a new server.
- 每次运行前, 我们检查 8 张 GPU 都空闲, 然后锁定。 每个点都用新的服务器。
16Data and files数据和文件
The raw data, the decision rules, and the analysis results are in data/glm53-agentx-hillclimb-mi355x/. We replaced host names and local paths.
原始数据、判定规则和分析结果都在 data/glm53-agentx-hillclimb-mi355x/。 我们替换了主机名和本机路径。
ablation/ablation.json: both ladders: paired effects, accept length, coverage, effects by input lengthablation/ablation.json: 两个阶梯: 配对效果、接受长度、覆盖率、按输入长度分段的效果prs/timelines.json: the kernel timeline tables of #24 and #42prs/timelines.json: #24 和 #42 的 kernel timeline 表ladder-bf16-3600s: the BF16 ladder runsladder-bf16-3600s: BF16 阶梯的运行ladder-fp8-900s: the FP8 ladder runs (F1, F2, base rerun)ladder-fp8-900s: FP8 阶梯的运行(F1、F2、base 重跑)cohort3-fp8kv-3600s/analysis/compare_round1_base_cand8.json: the 3600-s headline metricscohort3-fp8kv-3600s/analysis/compare_round1_base_cand8.json: 3600 秒的头条指标cohort3-fp8kv-3600s/requests: one CSV row per request of each 3600-s runcohort3-fp8kv-3600s/requests: 每个 3600 秒运行的逐请求 CSVfp8kv-validation/e2e_checks.json: the e2e checks, including F1 and F2fp8kv-validation/e2e_checks.json: e2e 检查, 包括 F1 和 F2scripts/make_page.py: the script that builds this pagescripts/make_page.py: 生成本页的脚本
17Lessons经验
- Test a kernel PR at the context lengths of the target workload. #15 made a verify step 38.5% faster with 4096-token prompts. On AgentX, it made requests above 192k tokens slower.
- 要用目标负载的上下文长度测试 kernel PR。 #15 在 4096 token 的 prompt 上让 verify 步快了 38.5%。 在 AgentX 上, 它却让 192k token 以上的请求变慢。
- Compare ablation results in the same context bin. In the same workload, a 900-s window and a 3600-s window had different shares of long requests.
- 要在同一个上下文长度段内比较 ablation 结果。 同一个负载, 900 秒窗口和 3600 秒窗口里长请求的占比不同。
- Find the stage that grows with the workload. At long contexts, the indexer selection and score stages set the step time. #24 and #42 gave most of the gain.
- 找出随负载增长的那个阶段。 长上下文下, indexer 的选择和打分阶段决定了单步时间。 #24 和 #42 带来了大部分收益。
- Compare against the published recipe. The BF16 baseline of the PR campaign hid the TTFT cost of BF16 KV. #60 removed that cost.
- 要和已发布的配方比较。 PR 开发期间的 BF16 对照组掩盖了 BF16 KV 的 TTFT 代价。 #60 去掉了这个代价。
- Use the window of the score for P90 decisions. In 900 s, two identical runs differed by 20%. In 3600 s, they differed by 1.3%.
- 判定 P90 时, 要用分数所用的窗口。 900 秒时, 两次相同的运行相差 20%。 3600 秒时, 只相差 1.3%。