Skip to content

serve-amd.sh: qwen4_exp exact batching lane on above MAX_BATCH 1 (Flash-Next C4 +59%, C8 +85%) - #289

Merged
AzeezIsh merged 1 commit into
mainfrom
perf/hip-q4e-batch-fast-default
Oct 31, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
perf/hip-q4e-batch-fast-default

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

Recipe-only. When MAX_BATCH > 1, serve-amd.sh now defaults ATLAS_QWEN4EXP_BATCH_FAST=1, next to the existing FP8 GDN rule. Explicit values win, and the code default stays off.

Why: on gfx1151 this lane is what batches a Qwen3.8-Flash-Next multi-sequence decode step. Without it, the mHC multi-seq paths run the MoE one row at a time: framework f113 counted 97,920 MoE gate_up launches for 2,040 tokens × 48 layers at C=8.

Measured (framework, main build, Gufo protocol):

C1 C4 C8 solo-vs-C8 identity
AR, lane off → on (f128, ×2) 12.8 → 12.8 15.3 → 24.3 15.1 → 27.9 5/8 → 5/8
MTP 1 draft, off → on (f132) 20.6 → 17.5 15.2 → 25.6 15.0 → 27.3 5/8 → 7/8

The C1 MTP cost (the lane takes over the single-sequence verify) is why this is gated on MAX_BATCH > 1 rather than set as a code default; MAX_BATCH=1 serving is untouched. The lane is the documented exact path ("every row of a batched multi-sequence step runs single-sequence decode's arithmetic"). The _t_rows dedup kernels stay gated off on hip: un-gated, the lane faults at C4 (f127). BATCH_SMALL on top measured neutral (f130).

🤖 Generated with Claude Code

…sh-Next C4 +59..68%, C8 +82..85%)

ATLAS_QWEN4EXP_BATCH_FAST is what batches a Qwen3.8-Flash-Next
multi-sequence decode step on gfx1151. Without it, the mHC multi-seq
paths run the MoE a row at a time (framework f113). Framework, main
build:
- f128, AR: C4 15.3 -> 24.3, C8 15.1 -> 27.9 tok/s; C1 12.8 unchanged
- f132, MTP 1 draft: C4 15.2 -> 25.6, C8 15.0 -> 27.3 tok/s; solo-vs-C8
  identity 7/8 vs 5/8

The lane also takes over the single-sequence MTP verify, which costs a
lone request ~15% (f132: C1 MTP 20.6 -> 17.5 tok/s). So the recipe turns
it on only above MAX_BATCH 1, next to the FP8 GDN rule, and the code
default stays off. Explicit values win. The t_rows dedup kernels stay
gated off on hip: un-gated, the lane faults at C4 (f127).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AzeezIsh
AzeezIsh merged commit 13b71a7 into main Oct 31, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant