Repository navigation
[AMD][MI35X] Qwen3.8-Flash-Next FP4 SGLang agentic MTP: ROCm 10 image 20261117 + 7 upstream-PR patches, conc 1/2/12/24/48/80 / [AMD][MI35X] Qwen3.8-Flash-Next:ROCm 10 镜像 20261117 + 7 个上游 PR 补丁,并发 1/2/12/24/48/80 #4832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
86b84d4
5bae2b8
9cc14f8
c7ee09b
9b109e5
fc8b058
8f0d3a9
41c6e12
790c62f
f471b7e
864acff
7660c0f
7b543dc
d6a1023
159f073
4a1bf42
8ace494
37a9514
3ae2a06
5350364
b60ec8c
9cc9537
1a6d43f
960ec38
2a96997
2f623d8
41a539b
18ca6fb
aed7435
f34e82b
f43af27
f351ea1
b83a59b
2aa86f8
6ab7a96
43fd3c9
081c19b
62e6c3e
f04eb1a
842cd5d
73e098c
5427e9e
915431e
eb3e143
54c26f6
37e8ce4
3940089
f69dc83
14efb68
5de98e8
b583f77
33ce982
ba25863
b8d2356
f461911
908ec83
dd4d963
55eefb8
0232c03
13f2b0e
2ac71ff
a6a7247
3f7ca2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| #!/usr/bin/env bash | ||
| # Qwen3.8-Flash-Next kernels on lmsysorg/sglang-rocm:v0.5.23-rocm10-mi35x-20261117 (SGLang | ||
| # c67db7c762 and AITER 581579ab 0.1.29.dev156 with FlyDSL 0.4.2, both editable checkouts under | ||
| # /sgl-workspace). | ||
| # AITER | ||
| # - Not touched. The image's AITER has what the AITER release wheel gave this recipe before: | ||
| # ROCm/aiter#5992 (FlyDSL causal conv1d prefill, GDN decode/verify kernels), #6670 (FlyDSL | ||
| # fused QSA sparse decode, needed by sglang#45196), #6496 (FlyDSL single-kernel GDN fused | ||
| # chunked prefill) and #5993 (hc_mix kernels). The script only checks that the FlyDSL modules | ||
| # are importable. | ||
| # SGLang (each patch is the source-only diff of an open upstream PR, rebased onto the image's | ||
| # SGLang; tests, benchmarks and AITER's AOT registry dropped; the header of each file names the | ||
| # PR and its head commit) | ||
| # - 01 sglang#48648 fused decode-sized hyper-connection norm + inject, SGLANG_OPT_QWEN4_FUSED_HC | ||
| # - 02 sglang#45196 QSA sparse decode on the AITER FlyDSL kernel (on with SGLANG_USE_AITER) | ||
| # - 03 sglang#48649 faster QSA decode MQA logits (padded Q, group-strided launch) | ||
| # - 04 sglang#45529 fused QK norm + RoPE + gate for Qwen3.5 self-attention on gfx950 | ||
| # - 05 sglang#41879 GDN prefill conv on AITER FlyDSL, SGLANG_AITER_GDN_CONV | ||
| # - 06 sglang#44103 GDN chunked prefill on AITER, SGLANG_AITER_GDN_PREFILL[_H] | ||
| # - 07 sglang#48090 MTP verify target probs on the top-k support instead of a vocabulary-wide | ||
| # sort (on with SGLANG_USE_AITER under rejection sampling; the image lacks | ||
| # sglang#41916, so the patch carries its top-p rescale helper) | ||
| # Already in the image, so not patched: sglang#41683 (strided GDN prefill projection views, merged | ||
| # 2026-11-17), the monokernel (--enable-amd-monokernel), the AITER topk_gating router (sglang#40708), | ||
| # ratio-3 GDN packing (sglang#44302) and the 128-row hc_mix (sglang#41880). All Python. A patch | ||
| # that no longer applies, or a missing FlyDSL module, fails the worker. | ||
| set -euo pipefail | ||
| # srtctl only looks up setup_script here; the patches live with the single-node | ||
| # recipe and are read through the workspace mount. | ||
| patches=/infmax-workspace/benchmarks/single_node/srt-slurm-recipes/qwen3.8next/sglang/mi355x-fp4-mtp/patches | ||
| [[ -d $patches ]] || { echo "qwen3.8next: $patches not found" >&2; exit 1; } | ||
| # Later patches touch files of earlier ones, so a per-patch reverse check cannot | ||
| # tell a re-run apart; the marker records the script and patch set a container | ||
| # already has. | ||
| marker=/sgl-workspace/.qwen3.8next-rocm10-patches | ||
| digest="$( { cat "${BASH_SOURCE[0]}" "$patches"/*.patch; } | sha256sum | cut -d' ' -f1)" | ||
| if [[ -f $marker ]]; then | ||
| if [[ "$(cat "$marker")" == "$digest" ]]; then | ||
| echo "qwen3.8next patches already applied" | ||
| exit 0 | ||
| fi | ||
| echo "qwen3.8next: $marker is from a different patch set" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # The image's AITER must be the editable checkout with the FlyDSL kernels of the four PRs. | ||
| python3 - <<'PY' | ||
| import importlib.metadata as metadata | ||
| import importlib.util | ||
| import sys | ||
|
|
||
| for module in ( | ||
| "aiter.ops.flydsl.causal_conv1d_flydsl", | ||
| "aiter.ops.flydsl.qsa_sparse_decode", | ||
| "aiter.ops.flydsl.gdn_fused_prefill", | ||
| "aiter.ops.flydsl.hc_mix", | ||
| ): | ||
| if importlib.util.find_spec(module) is None: | ||
| sys.exit(f"qwen3.8next: {module} is missing from the image's AITER") | ||
| print( | ||
| f"qwen3.8next image aiter: amd-aiter {metadata.version('amd-aiter')}, " | ||
| f"flydsl {metadata.version('flydsl')}, from {importlib.util.find_spec('aiter').origin}" | ||
| ) | ||
| PY | ||
|
|
||
| apply() { | ||
| git -c safe.directory="*" -C "$1" apply "$patches/$2" | ||
| echo "qwen3.8next patch applied: $2" | ||
| } | ||
|
|
||
| apply /sgl-workspace/sglang 01-sglang-48648-qwen4-fused-hc-decode.patch | ||
| apply /sgl-workspace/sglang 02-sglang-45196-qsa-flydsl-sparse-decode.patch | ||
| apply /sgl-workspace/sglang 03-sglang-48649-qsa-decode-mqa-launch.patch | ||
| apply /sgl-workspace/sglang 04-sglang-45529-qwen35-fuse-selfattn-prepare.patch | ||
| apply /sgl-workspace/sglang 05-sglang-41879-aiter-gdn-conv-prefill.patch | ||
| apply /sgl-workspace/sglang 06-sglang-44103-aiter-gdn-chunked-prefill.patch | ||
| apply /sgl-workspace/sglang 07-sglang-48090-mtp-sparse-rejection-target-probs.patch | ||
|
|
||
| echo "$digest" > "$marker" | ||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||
| # Qwen3.8-Flash-Next Quark MXFP4 MoE (MTP experts included), FP8 attention and | ||||
| # FP8 PLE, AgentX on MI355X via SGLang with native NEXTN MTP. The ~116 GiB | ||||
| # checkpoint fits on one MI355X, so TP1. The upstream image is used unpatched. | ||||
| # checkpoint fits on one MI355X, so TP1. | ||||
| base: | ||||
| schema: 2 | ||||
| name: qwen3.8next-fp4-mi355x-sglang-agentic | ||||
|
|
@@ -15,6 +15,12 @@ base: | |||
| tachometer: | ||||
| enabled: false | ||||
| engine: sglang | ||||
| # The image (lmsysorg/sglang-rocm 20261117: SGLang c67db7c762, AITER 581579ab 0.1.29.dev156, | ||||
| # FlyDSL 0.4.2) already has the AITER FlyDSL kernels this recipe uses (ROCm/aiter#5992, #5993, | ||||
| # #6496, #6670), so AITER is not touched. The setup script patches SGLang with open upstream | ||||
| # PRs (sgl-project/sglang #48648, #45196, #48649, #45529, #41879, #44103, #48090); the patch | ||||
| # files are in patches/ next to this recipe. | ||||
| setup_script: qwen3.8next-rocm10-patches.sh | ||||
| roles: | ||||
| agg: | ||||
| nodes: 1 | ||||
|
|
@@ -41,6 +47,7 @@ base: | |||
| scheduler-recv-interval: 10 | ||||
| stream-interval: 50 | ||||
| reasoning-parser: qwen3 | ||||
| default-chat-template-kwargs: '{"enable_thinking": false}' | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 BLOCKING: This line adds back Why it matters: The AgentX replay would run with thinking off on this recipe only. That changes output lengths and MTP acceptance, so these results can't be compared with #4779, earlier runs of this config key, or the other qwen3.8next recipes. The golden AL file Fix: Remove the line. If thinking-off is intended, say so in the changelog entry and explain why this recipe should differ from the others.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Every point of this AgentX recipe, and its GSM8K evals, now runs Qwen3.8 with reasoning turned off. Neither the PR description nor the changelog entry says so. The new server default at line 51 applies to every request because the recipe sets no Why this was flaggedagentic.yaml:51 adds Verification: Trigger: every run of qwen3.8next-fp4-mi355x-sglang-agentic-mtp after this merge. All six points and their GSM8K evals change from thinking-on to thinking-off, and neither the changelog nor the PR description says so. agentic.yaml:51 adds |
||||
| tool-call-parser: qwen3_coder | ||||
| speculative-algorithm: NEXTN | ||||
| speculative-num-steps: 3 | ||||
|
|
@@ -59,19 +66,26 @@ base: | |||
| SGLANG_TIMEOUT_KEEP_ALIVE: '1800' | ||||
| SGLANG_ENABLE_SPEC_V2: '1' | ||||
| AITER_GDR_FLYDSL: '1' | ||||
| # The FlyDSL QSA sparse decode (sglang#45196) is on whenever SGLANG_USE_AITER | ||||
| # is set on gfx950. The GDN prefill (sglang#41879, #44103) runs AITER's | ||||
| # FlyDSL causal conv1d and the single fused chunked-prefill kernel | ||||
| # (ROCm/aiter#6496), which needs the bf16 SSM state set above. | ||||
| SGLANG_USE_AITER: '1' | ||||
| SGLANG_AITER_GDN_CONV: '1' | ||||
| SGLANG_AITER_GDN_PREFILL: '1' | ||||
| SGLANG_AITER_GDN_PREFILL_H: fused | ||||
| benchmark: | ||||
| env: | ||||
| AIPERF_REQUIRED_SERVER_METRIC_PREFIX: 'sglang:' | ||||
| AIPERF_APPLY_CHAT_TEMPLATE: 'true' | ||||
|
|
||||
| # c1, c2, c4 and c8 run the FlyDSL monokernel (--enable-amd-monokernel) for MTP | ||||
| # target verify and draft. Its verify writes the per-draft intermediate SSM | ||||
| # states, so ReplaySSM is off, and its prelude reads the PLE table on the GPU, | ||||
| # so the table is not offloaded. Admission equals the concurrency. These points | ||||
| # also set SGLANG_USE_AITER, which the monokernel requires (the image sets it | ||||
| # too), so they form their own GSM8K eval group. c12 and c16 keep ReplaySSM, | ||||
| # the PLE offload and 2x CONC admission. Every point uses mem-fraction-static | ||||
| # as given instead of the aiter backend's 0.85 scaling. | ||||
| # c1 and c2 run the FlyDSL monokernel (--enable-amd-monokernel) for MTP target verify | ||||
| # and draft. Its verify writes the per-draft intermediate SSM states, so ReplaySSM is | ||||
| # off, and its prelude reads the PLE table on the GPU, so the table is not offloaded. | ||||
| # Admission equals the concurrency. These points also set SGLANG_USE_AITER, which the | ||||
| # monokernel requires (the image sets it too), so they form their own GSM8K eval group. | ||||
| # Every point uses mem-fraction-static as given instead of the aiter backend's 0.85 | ||||
| # scaling. | ||||
| override_c1: | ||||
| roles: | ||||
| agg: | ||||
|
|
@@ -106,126 +120,84 @@ override_c2: | |||
| CONC: '2' | ||||
| KV_OFFLOADING: none | ||||
|
|
||||
| override_c4: | ||||
| roles: | ||||
| agg: | ||||
| args: | ||||
| enable-linear-replayssm-spec: null | ||||
| ple-offload-embedding: null | ||||
| enable-amd-monokernel: true | ||||
| max-running-requests: 4 | ||||
| cuda-graph-max-bs-decode: 4 | ||||
| env: | ||||
| SGLANG_AITER_HONOR_EXPLICIT_MEM_FRACTION: '1' | ||||
| SGLANG_USE_AITER: '1' | ||||
| benchmark: | ||||
| env: | ||||
| CONC: '4' | ||||
| KV_OFFLOADING: none | ||||
|
|
||||
| override_c8: | ||||
| roles: | ||||
| agg: | ||||
| args: | ||||
| enable-linear-replayssm-spec: null | ||||
| ple-offload-embedding: null | ||||
| enable-amd-monokernel: true | ||||
| max-running-requests: 8 | ||||
| cuda-graph-max-bs-decode: 8 | ||||
| env: | ||||
| SGLANG_AITER_HONOR_EXPLICIT_MEM_FRACTION: '1' | ||||
| SGLANG_USE_AITER: '1' | ||||
| benchmark: | ||||
| env: | ||||
| CONC: '8' | ||||
| KV_OFFLOADING: none | ||||
|
|
||||
| # c12, c24, c48 and c80 keep ReplaySSM and the PLE offload, store the target and draft KV | ||||
| # caches in FP8 (E4M3), and use a Mamba state pool whose checkpoint interval is 262144 | ||||
| # tokens, so a prompt gets no interior checkpoints (extra_buffer_lazy). mem-fraction-static | ||||
| # is 0.88, used as given. c12 and c24 admit 2x CONC and serve from GPU KV; c48 and c80 | ||||
| # add HiCache host-DRAM offload and admit 128 requests. HiCache takes the point's 299 GB | ||||
| # DRAM share from the matrix generator (hicache-size 298); TOTAL_CPU_DRAM_GB records it. | ||||
| # SGLANG_OPT_QWEN4_FUSED_HC (sglang#48648) fuses the decode-sized hyper-connection | ||||
| # norm and inject into the mix. The prefill CUDA graph backend is breakable (the AMD | ||||
| # reference recipes get it from an SGLang default change that this image lacks), which | ||||
| # captures the GDN prefill on static per-bucket tables; a batch outside the captured | ||||
| # buckets runs eagerly through the AITER fused prefill. c80 caches only the prompt on | ||||
| # finish and keeps at most two Mamba states per path. | ||||
| override_c12: | ||||
| roles: | ||||
| agg: | ||||
| args: | ||||
| args: &fp8_args | ||||
| kv-cache-dtype: fp8_e4m3 | ||||
| speculative-draft-kv-cache-dtype: fp8_e4m3 | ||||
| mem-fraction-static: 0.88 | ||||
| max-running-requests: 24 | ||||
| cuda-graph-max-bs-decode: 24 | ||||
| env: | ||||
| max-mamba-cache-size: 960 | ||||
| mamba-radix-cache-strategy: extra_buffer_lazy | ||||
| mamba-track-interval: 262144 | ||||
| cuda-graph-backend-prefill: breakable | ||||
| env: &fp8_env | ||||
| SGLANG_USE_AITER: '1' | ||||
| SGLANG_USE_AITER_UNIFIED_ATTN: '1' | ||||
| SGLANG_AITER_HONOR_EXPLICIT_MEM_FRACTION: '1' | ||||
| SGLANG_OPT_QWEN4_FUSED_HC: '1' | ||||
| benchmark: | ||||
| env: | ||||
| CONC: '12' | ||||
| KV_OFFLOADING: none | ||||
| CONC: '12' | ||||
|
|
||||
| override_c16: | ||||
| override_c24: | ||||
| roles: | ||||
| agg: | ||||
| args: | ||||
| max-running-requests: 32 | ||||
| cuda-graph-max-bs-decode: 32 | ||||
| env: | ||||
| SGLANG_AITER_HONOR_EXPLICIT_MEM_FRACTION: '1' | ||||
| <<: *fp8_args | ||||
| max-running-requests: 48 | ||||
| cuda-graph-max-bs-decode: 48 | ||||
| env: *fp8_env | ||||
| benchmark: | ||||
| env: | ||||
| CONC: '16' | ||||
| KV_OFFLOADING: none | ||||
| CONC: '24' | ||||
|
|
||||
| # c24, c48 and c80 keep ReplaySSM and the PLE offload, store the target and draft KV | ||||
| # caches in FP8 (E4M3), and add HiCache host-DRAM offload with a Mamba state pool | ||||
| # that tracks a checkpoint every 256 tokens (extra_buffer_lazy). HiCache sets | ||||
| # hicache-size 200 at c24 and 298 at c48 and c80. | ||||
| # mem-fraction-static is 0.88, used as given. c24 admits 2x CONC; c48 and c80 admit 128 requests. | ||||
| # c80 caches only the prompt on finish and keeps at most two Mamba states per path. | ||||
| override_c24: | ||||
| override_c48: | ||||
| roles: | ||||
| agg: | ||||
| args: &hicache_args | ||||
| kv-cache-dtype: fp8_e4m3 | ||||
| speculative-draft-kv-cache-dtype: fp8_e4m3 | ||||
| mem-fraction-static: 0.88 | ||||
| max-running-requests: 48 | ||||
| cuda-graph-max-bs-decode: 48 | ||||
| max-mamba-cache-size: 960 | ||||
| mamba-radix-cache-strategy: extra_buffer_lazy | ||||
| mamba-track-interval: 256 | ||||
| <<: *fp8_args | ||||
| max-running-requests: 128 | ||||
| cuda-graph-max-bs-decode: 128 | ||||
| max-mamba-cache-size: 720 | ||||
| enable-hierarchical-cache: true | ||||
| hicache-size: 200 | ||||
| hicache-size: 298 | ||||
| hicache-io-backend: kernel | ||||
| hicache-mem-layout: page_first | ||||
| hicache-write-policy: write_back | ||||
| env: &hicache_env | ||||
| SGLANG_AITER_HONOR_EXPLICIT_MEM_FRACTION: '1' | ||||
| SGLANG_USE_AITER_UNIFIED_ATTN: '1' | ||||
| env: *fp8_env | ||||
| benchmark: | ||||
| env: &hicache_client | ||||
| KV_OFFLOADING: dram | ||||
| CONC: '24' | ||||
|
|
||||
| override_c48: | ||||
| roles: | ||||
| agg: | ||||
| args: | ||||
| <<: *hicache_args | ||||
| max-running-requests: 128 | ||||
| cuda-graph-max-bs-decode: 128 | ||||
| max-mamba-cache-size: 720 | ||||
| hicache-size: 298 | ||||
| env: *hicache_env | ||||
| benchmark: | ||||
| env: | ||||
| <<: *hicache_client | ||||
| CONC: '48' | ||||
|
|
||||
| override_c80: | ||||
| roles: | ||||
| agg: | ||||
| args: | ||||
| <<: *hicache_args | ||||
| max-running-requests: 128 | ||||
| cuda-graph-max-bs-decode: 128 | ||||
| max-mamba-cache-size: 640 | ||||
| hicache-size: 298 | ||||
| # Cache only the prompt on finish; the AgentX replay never re-sends model output. | ||||
| strip-thinking-cache: true | ||||
| # At most two Mamba states per conversation path; stale interior states skip host write-back. | ||||
| mamba-max-states-per-path: 2 | ||||
| env: *hicache_env | ||||
| env: *fp8_env | ||||
| benchmark: | ||||
| env: | ||||
| <<: *hicache_client | ||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 (optional) The new setup script turns on nounset, which the repo's mandatory Bash rules ban. Every other setup script in this directory uses
set -eo pipefail. AGENTS.md:48 bansset -u,set -o nounsetandset -euo pipefailin active scripts. Fix: change line 24 toset -eo pipefail. Nothing in the script relies on unset-variable errors, sincepatches,markeranddigestare all assigned before use.Why this was flagged
AGENTS.md:48 says: "No nounset: no
set -u,set -o nounset,set -euo pipefail, orbash -u. Keep other options such asset -eo pipefail." The new script qwen3.8next-rocm10-patches.sh:24 usesset -euo pipefail. The sibling setup scripts in the same directory (glm5.3-tilert-rocm.sh:2 and the others) useset -eo pipefail. The base branch has no such script, so this PR adds the violation. Nounset is banned because it breaks unset-safe probes and check_env_vars handling. Dropping-uhere changes nothing else, because every variable the script reads is assigned locally.Verification: nit. Line 24 of inferencex-e2e/benchmarks/multi_node/srt-slurm-recipes/configs/qwen3.8next-rocm10-patches.sh is
set -euo pipefail. AGENTS.md:48 bansset -euo pipefailin active scripts. The base has no such file, so the violation is new. Every variable in the script is assigned before it is used, so-unever fires.