Repository navigation
Description
Status (updated 2026-10-28 05:30Z)
State: in progress. Linux framework (gfx1151, 96 GB), Flash-Next NVFP4, on main since #197 (8863dc5e5). Gufo-matched rows, greedy, thinking off.
- Single stream:
- AR tg 12.2 tok/s; MTP1 tg 18.6 at depth 0.
- Gufo AR is 28.3, and MTP on mixed text is 36–40.
- Past the QSA bound:
- MTP turned off above ~2k tokens (12.1 tok/s at 8k/32k).
ATLAS_QSA_VERIFY_ACTIVE=1brings it back: 18.9 / 18.0 tok/s (f55).- Default flip on branch
perf/hip-qsa-verify-active-default88cffac78. Accuracy is already covered by gates that ran with=1. f58 proves the flip.
- Concurrency:
- Steady C=1/4/8 is 12.2 / 14.3 / 15.0 tok/s; Gufo AR C=8 is 125.
- Routed + shared MoE does not amortize across rows (f50: 66.8 launches/token at C1 and C4, 56% of the C4 step).
- Where the bytes go: an AR token reads ≥ 8.5 GB here (GDN, HC and head are BF16 in the NVIDIA checkpoint) against ~6 GB for Gufo. Kernel efficiency is the larger gap. Source analysis is in comment 6435247605; it is inference.
- Dead ends (findings only):
- qwen4_exp mHC: token-fused decode collapse, bit-identical (Flash-Next verify, up to −20 ms/step target) #154 HC
_mt: slower on gfx1151. - GB10
qwen4exp_moe_decodeon HIP: bit-identical, not faster (f52). - FP8 GDN: no HIP quantizer and GEMM yet; NVFP4 GDN doesn't fit.
- qwen4_exp mHC: token-fused decode collapse, bit-identical (Flash-Next verify, up to −20 ms/step target) #154 HC
Next: a gfx1151 batched MoE decode kernel (expert dedup across rows plus wave32 int8 dot).
Why: decode is where the Strix Halo port is furthest from what gfx1151 can sustain. Measured on winbox (Ryzen AI Max+ 395, Windows 11, ROCm 10 / TheRock, VGM 32 GB), C=1, greedy, thinking off, 256-token completions:
| arm | decode | fingerprint |
|---|---|---|
| serial | ≈ 9.5 tok/s | #80 c6efb5f60, win_serve_flashnext_nvfp4.ps1 boot-7g, 2026-09-28 (26.5 / 27.9 s per 256 tokens) |
| MTP K=2 | 17.5 tok/s, p1 0.977 | #80 c6efb5f60 + launcher commits 63ec00e4f, binary 710CA023, serve-amd.ps1 -Model qwen3.8-flash-next, 2026-09-30 |
Single observations: they locate the gap, but they aren't a baseline to gate on. Step 1 re-measures with n ≥ 3.
Done bar (C=1, greedy, serve-amd.ps1 -Model qwen3.8-flash-next and the Linux equivalent on the 128 GB box):
- serial decode ≥ 30 tok/s at ~1.5k context;
- MTP decode ≥ 40 tok/s at ~1.5k context and ≥ 35 tok/s at 32k;
- Windows ST-995 not below the Strix Halo Windows: Flash-Next port on main + MoE prefill transpose (2k TTFT ~2x) (supersedes #54) #80 record, and the 1007-turn replay at 0 dropped turns (AGENTS.md platform rule);
- speculative output no worse than today's tie-class drift against serial greedy.
Plan, each step gated by the one before:
- Measure (no code): a launch-mode profile of one serial and one MTP decode step, on Windows and on Linux. Split the step time into MoE expert GEMV, hyper-connection (mHC), attention/QSA, GDN, lm_head, and dispatch/copy overhead. Report achieved GB/s per kernel against the ~256 GB/s LPDDR5X bus. The biggest item decides step 2.
- Attack the top two items. Candidates already known from other targets:
- [job] Qwen3.8-Flash-Next: decode speed — MTP past the QSA bound, draft-vocab slicing, decode graphs #70's GB10 work: MTP past the QSA bound, draft-vocab slicing, decode graphs.
- [job] Qwen3.8-27B on Strix Halo: prefill 2.4x gap + DP4A verify tiers for K=5..9 #72's Strix 27B work: DP4A GEMV tiers and small-kernel/copy fusion.
- The MoE expert GEMV on the DP4A path.
- Stretch: make MTP verify bit-identical to single-token decode, so speculation is output-exact rather than tie-class.
Related: #57 (the port), #72 (Strix 27B decode/prefill), #130 (MTP drafting on GB10).
Activity
AzeezIsh commentedon Oct 2, 2026
Decode-graph design for Flash-Next. This gets built only if the Windows trace confirms launch overhead; the trace runs in Claude's winbox slot after #80's ST-995.
Already established from code:
decode_graph_unsupported()vetoes.decode_prestagealready hoists its host half.What blocks capture: position-dependent launch parameters in QSA.
qsa_qprepposargument (RoPE)qsa_scorecompleteblockscomplete_devexitqsa_select_topk_radixcomplete/tail_start/visibleargssel)qsa_gathern_selblock_topk·ratio + ratio), devicen_selqsa_block_pooln_new,first_block(host counters)(pos+1) % ratio == 0copy_d2dat offsetpos·hdseq_lenH2Dseq_len_devHost bookkeeping: graph replay skips Rust code, so
st.ingested/st.pooledadvance in a per-step hook, the PLEdecode_prestage/rearmpattern.Capture per regime: inert (≤ 2051), device top-k (≤ 16,384 blocks), eager host arm beyond. A graph is never replayed across a regime boundary.
Gate: greedy byte-identity graph vs eager at 2050 / 2051 / 2052 tokens, at 4095 / 4096 / 16,384 blocks, and past 16k; then ST-995 + replay.
Success measure: Windows serial decode step time vs Σ GPU time from the trace. The gap between the two is the ceiling of what this can recover.
AzeezIsh commentedon Oct 2, 2026
#143 step 1, first data: per-kernel GPU time of one Windows Flash-Next decode iteration. This is an observation from one traced request, not a production rate.
Fingerprint:
577F510D(Strix Halo Windows: Flash-Next port on main + MoE prefill transpose (2k TTFT ~2x) (supersedes #54) #80 + launcher commits + mainbe435875c),serve-amd.ps1 -Model qwen3.8-flash-next -Thinking off, recipe default seq.ATLAS_TRACE_LAUNCH=1 ATLAS_TRACE_LAUNCH_SYNC=1. Every launch is serialized, so per-kernel GPU time is exact, but the traced wall time isn't the production step time.SERIAL=1was set but MTP ran (mtp=1.00 tok_step=1.95), so this is MTP K=2.fnext_bench\claude-trace-request.txt, 27,699 launches.Per decode iteration (median of 19):
dense_gemv_bf16_batch2(grids 320 and 2048 × 256)hc_pre_finish_x4(grid 2×80 × 128)hc_pre_down(grid 2×10 = 20 WGs × 1024, 40 KB LDS)dense_gemv_bf16(lm_head, grid 62020)moe_expert_gate_up_shared_batch2_tmoe_expert_silu_down_shared_batch2_tmoe_expert_gate_up_shared_t+…silu_down_shared_thc_post+hc_pre_stagegated_delta_rule_wy2Median launch is 28.7 µs; 32% of launches are under 20 µs.
Reading:
hc_pre_downputs 20 workgroups on a 40-CU part.AzeezIsh commentedon Oct 2, 2026
Step 1 done: Flash-Next decode attribution (winbox, 2026-10-02)
Setup:
ATLAS_TRACE_LAUNCH=1 ATLAS_TRACE_LAUNCH_SYNC=1, landing binary577F510D(tree93a99cc094), serial, one 40-token greedy request, MTP on as served (tok_step=1.95). There are 27,699 launches in the window. Cycles are split at the LM-head launches.The step is GPU-bound, so decode graphs are not the lever here.
Where the 111 ms goes:
dense_gemv_bf16_batch2(GDN in-proj 16384×2560, out-proj)ATLAS_QWEN4EXP_BF16_GDNdefault). Halving needs lossy requant, so it's accuracy-gated and not a free win.hc_pre_down+hc_pre_finish_x4(mHC collapse, 97×)dense_gemv_bf16×2 (BF16[248320,2560])hc_post/hc_pre_stage)Correction to my earlier note: I'd guessed the GDN projections were FP8-dequantized to BF16, which would have meant a byte-identical FP8 path. They're not. This checkpoint ships them as BF16, so that option doesn't exist.
For your plan n3 X arm, @devin: this covers attribution. Only the trace-overhead measurement (no-trace vs trace) is left, if you still want it.
AzeezIsh commentedon Oct 27, 2026
2026-10-27: where Gufo's Flash-Next decode lead comes from. This reads its source; nothing in this comment is a measurement on our side.
Gufo (
gufo-org/gufo@bb5ab8dc) publishes Flash-Next Q4_K_XL numbers: AR 28.3 tok/s, MTP on mixed text 36–40 tok/s, C=8 MTP 127 tok/s (sum of rates). Its 116.9 tok/s README headline is repetitive text.Bytes per AR token (inferred):
What not to redo: token-fused HC (#154) was bit-identical but slower on gfx1151 (closed 10-02). #154 also found that SYNC traces inflate small kernels (
hc_pre_finish_x4reads 143 µs traced vs 39 µs isolated), so the 111 ms attribution above probably overstates HC.Queued (framework f43): a GDN-byte A/B on the existing switches, all at MTP1:
ATLAS_QWEN4EXP_FP8_GDN=full(E4M3, 128×128 blocks; rel-L2 2.6% on synthetic weights);ATLAS_QWEN4EXP_BF16_GDN=0(NVFP4, 9.3%).Each arm gets Gufo-matched tg, greedy identity and logprob drift vs base. If fp8full wins on speed, f45 runs ST-995 on it against the same-build reference 84.12 / 81.47. Per the neutral-switch rule, it only matters if it wins and holds accuracy.
Other Gufo techniques with a plausible fit: int8 dot-product GEMVs on Q8 weights; MoE expert dedup across verify rows (bit-identical); a reduced-vocabulary draft head (output-preserving, acceptance-gated). All are unmeasured here.
AzeezIsh commentedon Oct 27, 2026
Batched decode on Flash-Next/gfx1151: why it doesn't scale, and one dead end, measured. Framework, 2026-10-27.
Where the time goes (f50, SYNC launch trace, AR, b9ab4ed54). GPU time per generated token:
moe_expert_{gate_up,silu_down}_shared_t)qwen3_ssm/trait_decode_batched_hc.rs) triesffn.try_forward_km, which is dense-only (layers/mod.rs). MoE then falls back toforward_batched's per-row loop.!use_t_layout_for_decode(), so it doesn't apply to the transposed Flash-Next tables either.Dead end: GB10's
qwen4exp_moe_decodeon HIP (f52). Ported locally (perf/hip-qwen4exp-moe-decode750a18bfb: strix-hip symlink, HIP no-op for the PTX L2 prefetch, 64-bit warp masks, the!cfg!(atlas_hip)gate onATLAS_QWEN4EXP_MOE_FASTdropped). It builds and is bit-identical: all probes identical, mean |Δlogprob| 0.00000, AR and MTP. But it isn't faster on gfx1151:Per the neutral-or-worse rule, the branch is parked, not proposed. The C>1 fix needs a MoE decode kernel shaped for gfx1151. Gufo's approach (its source; not measured here) is wave32 int8-dot GEMVs plus deduplicating identical experts across rows.
Next lever being measured (f55):
ATLAS_QSA_VERIFY_ACTIVEon gfx1151. It defaults to off on gfx1151 ("unmeasured there"), so MTP turns off past ~2k context (f41/f49 MTP rows at 8k and 32k ran at AR speed). Our ST-995 and agentic recipes already ran with it on, so its accuracy is covered.AzeezIsh commentedon Oct 28, 2026
ATLAS_QSA_VERIFY_ACTIVE=1restores MTP past the QSA bound on gfx1151: +56% decode at 8k depth, +49% at 32k. Framework f55, merged main8863dc5e5, Flash-Next NVFP4,ATLAS_HIP_MOE_GROUPED_MIN_TOKENS=64, Gufo-matched (greedy, thinking off, pp ≈ 1,860 new tokens, tg128).Mixed text. Repetitive text runs 18.9 / 18.9 at 8k / 32k.
Reading:
Accuracy is already covered on gfx1151. Every Flash-Next ST-995 and agentic run on framework this week set
=1:The code comment "gfx1151 keeps default OFF (unmeasured there)" is out of date. The remaining step is a one-line default flip in
verify_active_decision, which I'll prepare as a local branch.AzeezIsh commentedon Oct 29, 2026
27B NVFP4 decode on gfx1151 is at the weight-bandwidth ceiling (strix s95, main
b5a8f6b15). Unserialized rocprofv3 kernel trace of a 1,840-token prompt followed by 256 decoded tokens (plain decode, MTP off,ignore_eos). Span 29.2 s, GPU busy 95.9%. The 4.1% idle is ~254k sub-10 µs launch gaps (1.06 s), so host overhead isn't the decode gap.w4a16_gemv_dp4a(NVFP4 MLP)w8a16_gemv(FP8 GDN + attention projections)paged_decode_attnBandwidth (inference from the checkpoint shapes):
Both are at strix's measured ~220 GB/s ceiling. That means:
Next on decode: measure what an NVFP4 re-encoding of the FP8 projections costs in accuracy (ST-995), since it would cut
3 GB/token (+20% plain decode, estimated). In parallel, MTP acceptance at depth.AzeezIsh commentedon Oct 29, 2026
27B NVFP4 decode table, MTP vs plain (strix s96, main
b5a8f6b15). Defaultserve-amd.shrecipe (MTP, 3 drafts) vsNUM_DRAFTS=0. 256 tokens withignore_eos; decode tok/s = completion ÷ (wall − first-token time), 2 runs each. 0 faults.MTP acceptance (
ATLAS_MTP_ACCEPT_DEBUG): p1 = 0.73–0.77, mean accepted ≈ 1.6–1.75 of 3, tokens per verify step ≈ 2.6. Plain decode drops with depth (10.2 → 7.7) as attention and KV reads add to the ~17 GB/token of weights (s95: the weight GEMVs already run at the ~220 GB/s ceiling).Next: a draft-count sweep (2/3/4/5) at 2k and 8k (s97). The other decode lever, fewer bytes per token via an NVFP4 re-encoding of the FP8 projections, needs an accuracy gate before it's worth building.
AzeezIsh commentedon Oct 29, 2026
Flash-Next NVFP4 decode on main
b5a8f6b15(framework f83 / f84).f83 table: 256 tokens with
ignore_eos, decode tok/s = completion ÷ (wall − first token), 2 runs each, 0 faults.Decode is flat with depth: QSA bounds the attention cost, unlike the 27B, which drops 10.2 → 7.7 plain over the same range. MTP is worth ~1.65× (p1 = 0.816).
f84 attribution: unserialized rocprofv3, 256 plain-decode tokens after a 1.8k prompt. GPU 93.4% busy (1.5 s of small-gap idle in 23.3 s).
dense_gemv_bf16hc_pre_downmoe_expert_gate_up_shared_thc_pre_finish_x4moe_expert_silu_down_shared_tgated_delta_rule_decode_f32paged_decode_attnUnlike the 27B, which is NVFP4/FP8 GEMV-bound at the bandwidth ceiling (s95), Flash-Next decode is dominated by BF16 dense GEMVs (32%) and hyper-connection work (26.5%, ~97 HC launches per token). Those are the decode levers here: fewer BF16 bytes (the BF16 dense projections are the ≥8.5 GB/token vs Gufo's ~6 GB noted earlier), and HC kernel efficiency. Next: map
dense_gemv_bf16's launches to weights and price a lower-byte format for them.AzeezIsh commentedon Oct 29, 2026
[amd-campaign f86/s106 · 2026-10-29 12:10Z · framework (desktop Strix Halo) · main b5a8f6b · Flash-Next NVFP4 decode, 256 tok, MTP 1 draft]
--lm-head-dtype fp8--lm-head-dtype nvfp4ATLAS_QWEN4EXP_FP8_GDN=1quantize_bf16_to_fp8_blockscalednot built for strix-hipFollow-ups:
perf/hip-fp8-gdn-quantizeradds the portable quantizer to strix-hip (compiles for gfx1151); A/B f88 queued.ATLAS_QWEN4EXP_HC_FASTkernels, so the env silently fell back. Port onperf/hip-hc-fast-port; A/B f87 (framework) + s107 (strix) queued. Grid-shape retune of scalarhc_pre_down(s106, strix): no shape beats production by >4%, dropped.AzeezIsh commentedon Oct 29, 2026
[amd-campaign f87/f88 · 2026-10-29 12:30Z · framework · Flash-Next NVFP4 decode, 256 tok, 1-draft MTP / plain]
perf/hip-fp8-gdn-quantizer,ATLAS_QWEN4EXP_FP8_GDN=1 ATLAS_GDN_FP8_DECODE=1): MTP 19.2/21.2 → 23.2/23.9 tok/s @1.9k, 19.6/20.3 → 22.0/23.1 @7.4k (+12..21%); plain 12.2 → 14.3 (+17%). Probes short + 2k differ (FP8 weights; numerics change) → accuracy gate f91 queued (ppl dense + above-bound + 12 needles). Merges as a default for Flash-Next on gfx1151 only if the gate passes.perf/hip-hc-fast-port): neutral (MTP 19.2→19.2 @1.9k, plain 12.2→12.2), probes identical. Per the neutral rule it does not merge; branch kept for reference. Inference (unverified): at T=1 the scalar path already sits near what these launches can draw in-context, so the 26.5% HC share is not a kernel-shape problem.AzeezIsh commentedon Oct 30, 2026
[amd-campaign f92/f93 · 2026-10-29 23:20Z · framework · Flash-Next NVFP4 FP8 GDN decode] agentic-webserver 50 runs, prefix cache ON, MTP 1 draft, chunk 2048, perf/hip-fp8-gdn-quantizer 624b11c build: default 48/50 (TTFT med 3404 ms) vs
ATLAS_QWEN4EXP_FP8_GDN=1 ATLAS_GDN_FP8_DECODE=147/50 (TTFT med 3408 ms); one failure each, on different runs. With f88's +12..21% decode and f91's ppl/needles pass: PR #262 makes the opt-in work on gfx1151 (defaults unchanged). A default flip needs a larger agentic sample.AzeezIsh commentedon Oct 30, 2026
[amd-campaign f103/f107 · 2026-10-30 10:30Z · framework · Flash-Next]
=0).AzeezIsh commentedon Oct 30, 2026
[amd-campaign f114 · 2026-10-30 16:30Z · framework · Flash-Next · memory tradeoff of #275, FP8 GDN default] At MAX_BATCH 8 + SSM 8 (raised to 10 for Marconi), pre-KV commit rose from 89.2 GB (f110, main 1585c38) to 91.1 GB (f114, with #275), leaving 0.1 GB / 203 blocks of KV (2.0 GB / 5,416 before) on the 96 GB GPU at util 0.95. C4/C8 requests then serialize (max TTFT 85 s / 195 s; aggregate = C1). The serve-amd default (MAX_BATCH 1) is unaffected (post-merge f112 OK). So the FP8 decode copy (+~1.9 GB on top of the BF16 kept for prefill) is a single-user win and a concurrency-capacity loss on Flash-Next. Options: make the default conditional on headroom (e.g. off when max_batch > 1), or free BF16 by using FP8 for prefill too (
=fullneedsw8a16_gemm_pipelined, expected-absent on strix-hip). Until then, C>1 setups should passATLAS_QWEN4EXP_FP8_GDN=0. Also f114: verify-row MoE dedup (perf/hip-moe-t-rows) is IDENTICAL and neutral at C1 MTP (26.4 = 26.4 tok/s); its C>1 effect is re-measured with FP8 GDN off in f115.AzeezIsh commentedon Oct 31, 2026
[amd-campaign · 2026-10-31 21:35Z · framework f159 · main 385d465]
ATLAS_QWEN4EXP_BATCH_SMALL=1measured neutral on gfx1151 twice (f130, f159: C8 38.25 vs 38.3). It never engaged:qwen4exp_decode_fuse::qwen4exp_gdn_decode_fused_rowsfails its kernel lookup on strix-hip.qwen4exp_decode_fuse.cuis not built for that target, because it relies on thread-block clusters (__cluster_dims__(QDF_REPEAT),cg::this_cluster().sync()), which gfx1151 has no equivalent for. So the per-row GDN chain still runs per row (f154:gated_delta_rule_decode_f3273,476 launches, 7.4% of C8), andATLAS_QWEN4EXP_DECODE_FUSE(C1) is likewise unavailable there. Port plan: each 3-block cluster → one 3 × QDF_D-thread block. Sizing it with a C1 decode profile (f157) first.AzeezIsh commentedon Nov 4, 2026
27B 8-user decode attribution, strix s210 (main 2f9c370,
nvidia/Qwen3.8-27B-NVFP4, MAX_BATCH 8, rocprofv3; 8 concurrent requests, each with 1,024 completion tokens verified; 244 s window, GPU busy 92.7%).One decode step (8 tokens) takes about 221 ms, so roughly 36 tok/s total:
--ssm-batched-recurrentis opt-in and off by default. Queued A/B: strix s212, with a greedy output probe on each arm.AzeezIsh commentedon Nov 4, 2026
Merged #326, main a523a07: 27B 8-user decode +13.1%. Bit-identical; framework,
nvidia/Qwen3.8-27B-NVFP4, MAX_BATCH 8, two rounds each.Changes, against the s210 step profile:
From the same kbench loop, these did not help and were reverted: