Repository navigation
[AMD][AgentX] DeepSeek-V4.1-Flash MI355X SGLang: cap running requests, fastokens tokenizer, and DP attention c128/c256 points / [AMD][AgentX] DeepSeek-V4.1-Flash MI355X SGLang:限制运行请求数、使用 fastokens 分词并新增 DP attention c128/c256 配置点 - #5034
limou102 wants to merge 16 commits into
Conversation
…P attention points
…ang-c128-c256 # Conflicts: # inferencex-e2e/perf-changelog.yaml
|
Thanks for the contribution!
中文感谢你的贡献!
|
There was a problem hiding this comment.
Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.
Besides the inline nit, I checked whether the binder resolves each of the five new matrix points to exactly one recipe variant. It does. validate_recipe in infx/srt_slurm/single_node.py matches on tp, data-parallel-size, expert-parallel-size, DP attention, gpus and CONC, and these fields tell override_tp2_c128_dp (EP1) apart from override_tp2_c128_dp_ep (EP2). TP2 c64 binds to the existing override_tp2_c64.
Extended reasoning...
The change touches three files: the dsv41flash MI355X SGLang agentic recipe, amd-master.yaml and perf-changelog.yaml, all of them CODEOWNER-owned. The note covers only binder uniqueness. It does not repeat the inline comment-rule nit.
| # SGLang ROCm 10 MI35X release image. TP2/EP1 up to c64, TP4/EP1 up to c16, | ||
| # DP2 attention with TP MoE from c32 to c128 (c32 and c64 overlap TP2), DP2/EP2 at c128, | ||
| # DP4/EP4 at c128 and c256. Host Engram on all. |
There was a problem hiding this comment.
🟡 nit (optional): Maintainers get two rewritten comments that only describe which TP/DP/EP topology covers which concurrencies, which the repo's comment rule forbids. They restate the search-space rows and the override list, so they go stale whenever a point changes. Fix: drop the topology listings at both sites and keep only short why-comments such as "Host Engram on all" if that needs explaining. Same pattern at 2 sites (configs/amd-master.yaml:1135-1137, srt-slurm-recipes/dsv41flash/sglang/mi355x-fp4-mtp/agentic.yaml:65-66).
Why this was flagged
AGENTS.md:56 says "No header comments describing a file, topology, config, recipe, override, or section". AGENTS.md:58 allows only short technical explanations of why a value was chosen, and never a restatement of the code. The diff rewrites and extends the comment at amd-master.yaml:1135-1137 ("TP2/EP1 up to c64, TP4/EP1 up to c16, DP2 attention with TP MoE from c32 to c128 ..., DP2/EP2 at c128, DP4/EP4 at c128 and c256"). It also extends agentic.yaml:65-66 ("amd-master.yaml runs TP2 through c64, TP4 through c16; DP2 covers c32 to c128, DP2 EP2 c128 and DP4 EP4 c128 and c256"). Both only restate the search-space rows at amd-master.yaml:1151-1155 and the override_* keys. The base had the same kind of comment in shorter form, and this PR had to edit both copies to keep them in sync. Each future point change carries the same maintenance cost and risk of drift.
Verification: AGENTS.md:56 says "No header comments describing a file, topology, config, recipe, override, or section." The diff rewrites inferencex-e2e/configs/amd-master.yaml:1135-1137 so it restates the search-space rows at lines 1151-1155. It also rewrites agentic.yaml:65-66 to describe another file's topology. These comments existed on the base in an older form. Nothing breaks at runtime: the comments only go stale when points change.
|
View unofficial run (performance): https://inferencex.semianalysis.com/inference?unofficialRun=44231353783 View unofficial run (accuracy): https://inferencex.semianalysis.com/evaluation?unofficialRun=44231353783 |
…ang-c128-c256 # Conflicts: # inferencex-e2e/perf-changelog.yaml
AgentX is text only; the V4.1 Rust image processor's build lock on the shared cache hung one DP rank at startup in CI.
|
Thanks, @limou102, for the contribution! Please also prepare an SGLang cookbook PR to align it with the recipes you proposed here. |
…ang-c128-c256 # Conflicts: # inferencex-e2e/perf-changelog.yaml
|
@limou102 staged run 43712971238. This run remains available across future |
# Conflicts: # inferencex-e2e/benchmarks/single_node/srt-slurm-recipes/dsv41flash/sglang/mi355x-fp4-mtp/agentic.yaml # inferencex-e2e/perf-changelog.yaml
…kenize with fastokens and drop DP2 c32
# Conflicts: # inferencex-e2e/perf-changelog.yaml
|
/use 44231353783 |
|
@limou102 staged run 44231353783. This run remains available across future |
|
sglang cookbook PR : sgl-project/sglang#50677 |
|
@limou102 SGLang #50677 is merged, but the cookbook still reflects an earlier configuration and does not fully match this PR’s final serving settings. Please verify and align all production-useful flags, environment variables, and worker/router commands, then merge the cookbook update before this PR merges. |
|
Hi @functionstackx , the current PR inherits While waiting for feedback from @functionstackx, @limou102, could you please follow the instructions here #4705 and try to provide solid evidence from your side to unblock the potential precision-sensitive concerns. Thanks! |
|
@chunfangamd @functionstackx Thanks for the review. Some context on the shared-expert quantization:
The SGLang cookbook has been updated to match this PR's final serving settings in sgl-project/sglang#52053: running-request caps, prefill-decode intervals, the new TP2 c64 point, |

Summary
In
main(#5029), the MI355X SGLang frontier ofdsv41flash-fp4-mi355x-sglang-agentic-dsparksags between TP2 c16 and TP2 c4 and between TP2 c4 and TP4 c1, and it stops at 181,052 tok/s/GPU. Most of the sag comes from scheduling. AgentX sessions idle between turns, so a TP2 server at concurrency 4 to 32 decodes about a quarter of its lanes on average, but in bursts of up to half. Wheremax-running-requestsis high, each burst widens the decode step and lowers P90 interactivity.This PR:
prefill-decode-interval192 to 48), TP2 c64 (128 to 32, interval 4 to 32,monokernel-backend: amd) and TP4 c4, c8 and c16 (8, 16 and 32 to 1, 2 and 4). Sessions past the cap queue instead of widening the step. TP2 c4, c16 and c32 and TP4 c1 keep their caps frommain.prefill-decode-interval32 instead of 8: 209.6 against 197.6 P90 interactivity at the same throughput.--tokenizer-backend fastokens(inmainonly TP2 c32 used it). The image ships fastokens, and its token ids equal the Hugging Face backend's on 8k to 508k-token inputs and on the chat template. A 195k-token prompt tokenizes in 3 ms instead of 0.37 s on the tokenizer manager's event loop.--image-processor-backend pil. AgentX and GSM8K send text only. Withauto, one DP rank builds the V4.1 Rust image processor under a file lock in the shared cache; in 3 of 6 TP2 DPA startups in CI that rank never got the lock and the server failed its health check.Under DP attention, one rank's prefill stalls every rank's decode. The c128/c256 variants therefore use a longer prefill-decode interval with
shortest-prefill-first,SGLANG_DSV41_ENGRAM_HOST_TABLE_LAYOUT=shared, and, with EP,SGLANG_DP_SHARED_EXPERT_LOCAL=1. All changes are SGLang flags and environment variables; there are no source patches.override_tp2_c128_dpoverride_tp2_c128_dp_epoverride_tp4_c128_dp_epoverride_tp4_c256_dp_epcuda-graph-max-bs-decode128, prefill-delayer low watermark 0.85,swa-prefix-tails12288Results from this PR's sweep 44231353783, against
main's sweep from #5029 (43344632854). Each cell is P90 interactivity (tok/s/user) / throughput (tok/s/GPU); bold marks points whose settings this PR changes or adds.main(#5029)The changed points gain 6% to 22% P90 interactivity at the same throughput, and the throughput end moves from 181,052 to 249,096 tok/s/GPU (+38%). On the P90 range
maincovers (73 to 775), the new frontier is higher on 93% of it, by more than 5% on 55% and by more than 20% on 33%. It is more than 2% belowmainon about 2% of the range, in two stretches at points whose settings this PR does not change: P90 604 to 606 (TP2 c4, 602.4 against 606.1) and P90 764 to 775 (TP4 c1, 763.4 against 775.2, a P90 ITL of 1.31 against 1.29 ms; CI records ITL to 0.01 ms). The unchanged points move by 2.4% or less between the two sweeps.Risk: the caps trade TTFT for P90 interactivity. In local 3600 s runs, mean TTFT was 6.4 s at TP2 c64 and 3.5 s at TP2 c32; neither scored metric counts it.
Validation details
mia1-p01-g11and measured 15% to 22% below their local results (TP2 c32 176.7, TP2 c4 515.5, TP4 c16 371.7, TP4 c4 617.3 P90). Each was rerun as a single job; the table uses every point's latest attempt. TP2 c4, TP4 c16 and TP4 c4 landed on g11 again in the rerun and measured within 1.4% of their local results. Failures in the sweep were host setup timing out while waiting for GPU memory to clear onmia1-p01-g09andmia1-p01-g15, and were rerun.infx.srt_slurm.single_node.select_recipewith golden acceptance 3.51 frombuild_overridesand measured withpython3 -m infx.bench agentic: TP4 c4 774.3 / 10,332, TP4 c8 616.6 / 17,282, TP4 c16 477.3 / 29,875, TP2 c8 456.6 / 32,641, TP2 c32 206.4 / 110,483, TP2 c64 102.1 / 162,080. All runs had 0 failed requests and passedvalidate_agentic_result.infx.evals.validate_scoresagainst the 0.90 floor (strict-match / flexible-extract): TP2 c64 0.9765 / 0.9757, TP2 DPA c64 0.9697 / 0.9689, TP2 DPA c128 0.9757 / 0.9750, TP4 DPA EP4 c256 0.9735 / 0.9727.swa-prefix-tails12288 instead of 4096: 77.4 / 249,096 in CI, against 80.3 / 229,956 in a local run with 4096 tails. With 4096 tails, idle sessions' prefixes were evicted and about 20% of prefill was recompute.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.中文
main(#5029)中dsv41flash-fp4-mi355x-sglang-agentic-dspark的 MI355X SGLang 前沿,在 TP2 c16 与 TP2 c4 之间、TP2 c4 与 TP4 c1 之间明显下凹,吞吐最高只到 181,052 tok/s/GPU。下凹主要来自调度:AgentX 的会话在两轮之间会空闲,TP2 并发 4 到 32 时平均只有约四分之一的 lane 在 decode,但会突发到一半。max-running-requests设得高时,每次突发都会撑宽 decode step,拉低 P90 交互性。本 PR:
prefill-decode-interval从 192 改为 48),TP2 c64 从 128 改为 32(interval 从 4 改为 32,并使用monokernel-backend: amd),TP4 c4、c8、c16 从 8、16、32 改为 1、2、4。超出上限的会话排队,不再撑宽 step。TP2 c4、c16、c32 和 TP4 c1 沿用main的上限。prefill-decode-interval从 8 改为 32:吞吐相同,P90 交互性从 197.6 提高到 209.6。--tokenizer-backend fastokens(main中只有 TP2 c32 使用):镜像自带 fastokens,在 8k 到 50.8 万 token 的输入和 chat template 上,它的 token id 与 Hugging Face 后端完全一致。19.5 万 token 的 prompt 分词从 0.37 秒降到 3 毫秒,而且不再占用 tokenizer manager 的事件循环。--image-processor-backend pil:AgentX 和 GSM8K 只发送文本。默认的auto会让一个 DP rank 在共享缓存的文件锁下编译 V4.1 的 Rust 图像处理扩展;CI 中 6 次 TP2 DPA 启动有 3 次该 rank 一直拿不到锁,服务健康检查失败。DP attention 下,任一 rank 做 prefill 都会阻塞所有 rank 的 decode。因此 c128/c256 变体使用更长的 prefill-decode interval 搭配
shortest-prefill-first、SGLANG_DSV41_ENGRAM_HOST_TABLE_LAYOUT=shared,开启 EP 时再加SGLANG_DP_SHARED_EXPERT_LOCAL=1。所有改动都只涉及 SGLang 启动参数和环境变量,没有修改源码,各变体参数见上方表格。结果见上表:本 PR 为 sweep 44231353783,
main为 #5029 的 sweep 43344632854,加粗的是本 PR 修改或新增的点。改动的点在相同吞吐下 P90 交互性提高 6% 到 22%,吞吐上限从 181,052 提高到 249,096 tok/s/GPU(+38%)。在main覆盖的 P90 区间(73 到 775)内,新前沿有 93% 高于main,其中 55% 高出 5% 以上,33% 高出 20% 以上。低于main超过 2% 的区间约占 2%,分为两小段,都出在本 PR 没有改动配置的点上:P90 604 到 606(TP2 c4,602.4 对 606.1),以及 P90 764 到 775(TP4 c1,763.4 对 775.2,即 P90 ITL 1.31 对 1.29 毫秒;CI 只记录到 0.01 毫秒)。未改动的点在两次 sweep 之间的差异都在 2.4% 以内。风险:限流是用 TTFT 换 P90 交互性。本地 3600 秒测试中,TP2 c64 的平均 TTFT 为 6.4 秒,TP2 c32 为 3.5 秒;两个评分指标都不计入 TTFT。
验证:44231353783 中所有 agentic 点和 GSM8K eval-only 作业都已通过。有 4 个点第一次运行时落在
mia1-p01-g11上,比本地结果低 15% 到 22%,已逐个单独重跑,表中取每个点最新一轮的结果;其中 TP2 c4、TP4 c16、TP4 c4 重跑时仍落在 g11 上,但结果与本地相差都在 1.4% 以内。sweep 中的失败都是mia1-p01-g09和mia1-p01-g15上等待 GPU 显存清空超时,已重跑。GSM8K(20261111 镜像,真实 DSpark 校验,1319 题,5-shot,门槛 0.90)strict-match / flexible-extract:TP2 c64 0.9765 / 0.9757,TP2 DPA c64 0.9697 / 0.9689,TP2 DPA c128 0.9757 / 0.9750,TP4 DPA EP4 c256 0.9735 / 0.9727。本地结果、被否决的备选参数等详见 Validation details。