You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[job] Qwen3.8-27B on Strix Halo: prefill 2.4x gap + DP4A verify tiers for K=5..9 #72
State: in progress. strix (gfx1151, 58 GB), 27B NVFP4, on main 8863dc5e5. Measured this week; the tables are in the comments from 2026-10-27/28.
Accuracy (ST-995):
DFlash2 γ8: 84.12/74.65.
DFlash2 γ4: 83.52/73.31, reproduced exactly on main. The drop is systematic.
MTP K=4: 83.92/74.75.
Agentic (50/50 on all three):
DFlash2 γ4: Σwall 8,835 s.
DFlash2 γ8: 9,379 s.
MTP K=4: 9,926 s.
Speed:
Prose tg: γ4 12.4–13.5, MTP 13.2–13.4, AR 9.9–10.5, γ8 7.6–8.0 (γ8 over-speculates on prose).
pp is ~240 tok/s at depth 0, against Gufo's ~635.
Prefill is GEMM-bound at ~14 TF/s effective (s22).
Default: stays DFlash2 γ8. γ4 is a speed option at −1.3 normalized ST-995; that's the owner's call.
Concurrency: AR scales to C=4 at 25.8 tok/s steady, then drops at C=8 on this memory-tight box. MTP stops scaling after C=2.
Queued: merged-main gates for γ8 (s35 ST-995, s36 agentic) and MTP (s37, s38).
Next lever: prefill GEMM rate (w4a16 t_m128_f16a / w8a16 at ~14 TF/s, against ~30 TF/s possible with WMMA).
Kind
Feature for a model we already support
Model
nvidia/Qwen3.8-27B-NVFP4 (Strix Halo gfx1151)
What's the job?
Strix prefill is ~2.4x behind pwilkin's llama.cpp stack (104 vs 256.8 tok/s at 31.5k) and γ=8 DFlash2 verify runs 255 ms at K=9 because rows 5..9 land on the float w4a16_gemv_batch8/16 tiers, not DP4A. Steps: stage-6 prefill matrix (ATLAS_BF16_TC_PREFILL / FP8_M64 / NO_FFN_NVFP4_MMQ); MMQ for GDN/attn prefill; fused gate+up dual-accumulator GEMM; DP4A verify tiers for K=5..9 (check VGPRs first). Done = prefill ≥ 180 tok/s at 31.5k and γ=8 verify ≤ 150 ms, ST-995 within noise.
Impact radius
Shared code, other models could change
What else could it touch?
strix-hip kernels only; the W4A8 DP4A path changes numerics (5.58 % mean rel. error on the decode GEMV) so KL + ST-995 must re-gate.
changed the title [-][job] GB10: raise the Atlas tensor-core GEMM ceiling (29-39 vs cuBLAS 75-206 TFLOP/s)[/-][+][job] Qwen3.8-27B on Strix Halo: prefill 2.4x gap + DP4A verify tiers for K=5..9[/+]on Sep 25, 2026
Stage-6 prefill matrix (strix, 2026-09-25) — no kernel-tier flag beats the default
main66 (5b07b953) on gfx1151, nvidia/Qwen3.8-27B-NVFP4, serve-amd.sh defaults (prefill chunk 2048), max-seq 34000. Prefill tok/s = prompt tokens / TTFT, median of 3, greedy hash identical in every cell (565339bc).
arm
~1.9k
~7.2k
~29k
default
233
202
139.8
ATLAS_BF16_TC_PREFILL=1
210
187
140.7
ATLAS_FP8_M64_PREFILL=1
176
159
123
ATLAS_NO_FFN_NVFP4_MMQ=1
205
192
140.6
Main has moved a lot since 09-13 (131.7 tok/s at ~2k then, 233 now). The gap to pwilkin (256.8 at 31.5k) is 1.8x, down from 2.4x.
The GEMM tier is not where the long-context gap is: every arm converges at ~140 at 29k, and throughput falls with length (233 → 140), which points at attention / GDN cost growing with context.
Next (running): rocprofv3 kernel ranking of one ~7k prefill, sliced to the request window, plus the prefill-chunk knob (2048 vs 8192) at ~29k.
The long-prefill gap is GEMM efficiency, not attention/GDN (at 7k; attention's share will grow toward 29k). Both GEMMs run at ~15-16 TFLOP/s, ~27 % of a ~59 TFLOP/s gfx1151 WMMA peak (estimate: 40 CU × 512 FLOP/clk × 2.9 GHz).
The stage-6 flags only move the FFN tier; nothing touched the FP8 projection GEMM (29.5 %).
Levers, in order: (1) the FP8 w8a16_gemm_n_m128 — the nvidia pack's GDN/attn projections are FP8; an in-SMEM FP8→BF16 dequant + WMMA with deeper pipelining, or requant them to NVFP4 (the fp8to4 checkpoint already exists and passed ST-995); (2) fused gate+up with dual accumulators (pwilkin mmb.cu) so the FFN's activation tile is read once and gate/up are never written to global; (3) then re-profile at 29k where attention grows.
Chunk-size knob (2048 vs 8192 at ~29k) is running now.
Strix prefill, part 2 (main66, gfx1151, 2026-09-25):
The chunk-size knob is not the long-context lever. At 29k: --max-prefill-tokens 2048 gives 144.6 / 138.5 tok/s; 8192 gives 139.6 / 137.2. That is the same within noise.
fp8to4 checkpoint profile (the nvidia-derived conversion; the FP8 weights become W4A16), 7.2k prompt, measured under rocprofv3: 212.4 tok/s. The nvidia pack's unprofiled default is 202 tok/s.
share
time
calls
kernel
69.6 %
23.58 s
1216
w4a16_gemm_t_m128
7.2 %
2.45 s
48
inferspark_prefill_paged_64
5.4 %
1.83 s
192
w4a16_gemm_t
4.1 %
1.38 s
192
gated_delta_rule_chunk_delta_h_vfused
3.2 %
1.10 s
45
dense_gemm_bf16
2.7 %
0.90 s
192
gated_delta_rule_recompute_wu
2.4 %
0.80 s
192
gated_delta_rule_chunk_fwd_o
(Profiler window: busy 33.88 s of 34.06 s.)
What this means. On both packs, prefill is one GEMM family. On the nvidia pack it is the W4A16 + W8A16 pair (47 % + 30 %); on fp8to4 it is a single kernel, w4a16_gemm_t_m128, at 70 %. That kernel runs at ~27 % of the estimated WMMA peak.
The only big Strix prefill lever is that GEMM's tile efficiency. Neither attention nor GDN comes to more than 7 %.
Next: occupancy and LDS analysis of w4a16_gemm_t_m128: tile shape, dequant placement, and the WMMA issue rate.
So the kernel is not LDS-bound. The conflicts were real, but they were hidden behind something else.
Now running: a speed-of-light ablation on strix (timing only; the output is deliberately wrong).
X1 drops the per-element FP8 scale bit-decode.
X2 also drops the E2M1 LUT reads.
All loads are kept, so memory traffic is identical.
If either moves prefill tok/s, the in-register NVFP4 dequant is the limiter, and the fix is to hoist or share the scale decode (it runs ~8x redundantly across threads) or to pre-dequant.
If neither moves it, the limiter is WMMA issue or latency, and the lever is occupancy: ~41 KB LDS per CTA with 4 waves gives about 1 CTA per CU.
First Strix Halo 27B prefill win landed as a PR: #79 (ready for review).
Change: an exact, cheaper NVFP4 dequant in w4a16_gemm_t_m128.
Kernel: −17 % GPU time.
Prefill:+5.7 % at 1.9k, +4.7 % at 7.2k, medians of interleaved runs.
Output: greedy byte-identical in every arm.
Memory: no extra.
What is left in this kernel. The timing-only ceiling with a trivial scale is −26 % kernel time. The remaining gap is the exact E4M3 scale decode, which runs ~8x redundantly across the threads that share a scale group.
A cross-lane share (v_permlane16/x16) would cut that redundancy with no memory cost.
A precomputed fp16 scale (every E4M3 value is exact in fp16) would cut it at +0.125 B/weight.
Measurement note for anyone benchmarking on this box. Back-to-back 7k prefills throttle about 10 % (e.g. 203.7 → 189.8 → 183.8 tok/s within one server), so single sequential A/B runs are ±5 %. Interleave arms and compare medians by request position.
Tried and parked: sharing the exact E4M3 scale decode across lanes in w4a16_gemm_t_m128 (on top of #79 @ fd2fbeb; ISA only, not run).
Why it looked worth doing: in M128_STORE_TILE, lanes j, j+8, j+16, j+24 of each wave hold the same 16 scale bytes. Each of them decodes all 16 with e4m3_scale_half, so the decode is 4x redundant inside a wave and 8x across the CTA. The X3 ablation (trivial scale) puts the exact decode at about 7-9 % of kernel time.
The design:
Each lane decodes one column quarter.
It fetches the other three through row_xmask:8 DPP and two v_permlanex16.
Values are moved bit-for-bit, so the output is bit-identical by construction.
ISA, TheRock hipcc 10.0.0, -O3 -ffp-contract=off --offload-arch=gfx1151:
The kernel already sits at the 256-VGPR cap. Keeping the four shared scales and the per-lane column permutation live pushes it into real scratch traffic in the tile loop. So this lever needs VGPR headroom first, for example a smaller A/B register-prefetch footprint, before it can pay off. Not pursued further for now. Next on this kernel family: the w8a16_gemm_n_m128 speed-of-light ablation (30 % of the 7.2k prefill).
After those land, re-measure both done-bar numbers on one tree: prefill at ~29–31.5k (bar ≥ 180 tok/s) and γ8 verify ms per step (bar ≤ 150 ms, from 255).
Scale back:
The scale-share lever is correctly parked (VGPR cap).
Progress on the γ8 verify side (Strix Linux, gfx1151, 2026-09-26/27)
Where the time goes. One DFlash2 γ8 step on nvidia/Qwen3.8-27B-NVFP4 takes about 280 ms of GPU time. That's the rocprofv3 OFF arm of strix job 038d, MinHeap code prompt, 512 tokens, mean_na 5.66.
On this prompt, DFlash γ8 decodes about as fast as MTP K=4, ~24 tok/s each, so the verify GEMVs are the whole game.
PRs opened from this:
dflash_head: NVFP4 batch8 tier for the DFlash2 drafter's projection GEMMs at γ 5..8 #108, drafter NVFP4 batch8 tier. The 16 % drafter BF16 block moves to NVFP4. Measured −9 % GPU time and +10 % decode tok/s. The DFlash output sha changes, because speculation isn't output-neutral: the MTP reference stays fixed, but acceptance moves. An ST-995 γ8 leg on this build is queued before it can leave draft.
The timing-only X3 ablation (trivial scale) bounds what's left in the scale decode at about −26 % kernel time.
The cross-lane scale share was parked at 39 spills.
#
lever
expected
cheap verification
1
GROUP_M CTA swizzle, same as #94 did for w8a16_gemm_n_m128 (−30 % there, B-load bound)
0–15 %, and the cheapest thing to try
rasterisation change only; kernel time + TCC_HIT/miss; keep if > 3–5 %
2
Precomputed fp16 scales (every E4M3 value is exact in fp16), turning the decode into a load
10–15 %, capped by X3's −26 %
repack one layer and diff SQ_INSTS_VALU
3
Shrink the register prefetch to zero spills (fewer in-flight B fragments / shorter prefetch distance)
5–15 %
require 0 scratch loads/stores in the ISA; restore a stage if latency-bound
4
2 CTAs/CU with a smaller tile
0–10 %, conditional
only if LDS ≤ 32 KB and VGPRs fit
5
split-phase dequant into LDS
< 5 %
skip unless 3 fails
—
hipBLASLt on a bf16 copy
rejected
doesn't fit the 58 GB box
Cost check on #2: +0.125 B/weight on the dense FFN (5120 × 17408 × 3 × 64 ≈ 17.1 G weights) is about +2.1 GB. That only fits because #93 freed 5.5 GB on the same box, so budget for it explicitly against the DFlash2 γ8 recipe's headroom.
Suggested order: 1 → 3 → 2. Swizzle and spill removal cost no memory, and a fresh rocprof VGPR/spill readout comes before wiring anything, as with the reuse2 lesson.
Kernel-level root cause of the gfx1151 NVFP4 prefill gap. Static ISA analysis is done; a GPU microbench is queued.
Method. Upstream clang 23 targeting gfx1151, with Atlas's HIP flags and ROCm 7.13 headers. The production sources compile unmodified (plus a one-line bit-cast shim for upstream clang's bf16 WMMA builtin signature). I counted the hot-loop instruction mix from the loop blocks.
Hardware facts (compiled probes):
f32→bf16 has no instruction on gfx1151: software RNE is 5 VALU.
f32→f16 is 1 VALU.
v_pk_mul_f16 exists; there is no packed bf16 math.
WMMA runs on the SIMD VALUs (~32 cycles per 16×16×16), so every dequant instruction displaces matrix issue.
Per-32-K-step hot loop:
kernel
instr
WMMA
instr/WMMA
sw bf16 rounds
w4a16_gemm_t_m128 (dense prefill; 46% of 27B prefill per job 077)
f16 of every E2M1 value has a zero low byte, so one v_perm per four codes converts them.
The E4M3 scale goes to f16 via bits<<7 × 256, then one v_pk_mul_f16 multiplies two weights at a time.
Exact: proven exhaustively, 0 mismatches over all 254 non-NaN scale bytes × 16 codes, subnormals included. Today's kernels round every scaled weight to bf16.
The fp32 tensor/expert scale moves to the epilogue. Activations are converted bf16→f16 once per GEMM input.
The MoE twins also get the m128 register-prefetch / double-buffer pipeline. The MoE kernels were an older port: LDS lookup table, per-element operand building, two barriers per step.
Prediction: ~1.3–1.5× on the dense GEMM (≈25–33 TF/s from 19–24); more on the MoE kernels.
Qwen's adversarial review (overflow, denormals, possibly f16-rounded WMMA products) is covered by edge cases in the bench.
Activation overflow above 65504 would need a per-row power-of-two pre-scale. Real activation amax gets measured before wiring.
Validation: strix job 144 and a winbox slot after #80's ST-995.
Production kernels compiled verbatim beside the twins.
An FP64 host reference with exact weights.
27B and Flash-Next dense shapes at M=2048, plus Flash-Next routed MoE (512 experts, top-10).
Engine wiring and the AGENTS.md gates follow only if the bench shows the speedup and the accuracy.
Full write-up: atlas-audit 14_LOG_2026-10-02.md §12.
Prefill attention on gfx1151: quantified lead (static ISA, inferspark_prefill_paged via prefill_paged_compute.cuh; attention is 8.5% of 27B prefill at 8k and 33% at 29k).
Hot loop: 2,730 instructions per KV tile for 48 WMMA (57/WMMA). The top ops are 322 s_waitcnt, 288 v_cvt_f16_f32, 262 v_lshlrev, and 256 ds_load_u16.
Cause: P is already F16 (atlas-core: treat W4A16_NVFP4 as NVFP4 in quant detection (#88) #90), but the P·V V operand is built one element at a time: bb[k] = (__fp16)(float)smem_K[k_off + k][d_col]. That's a column-strided 2-byte LDS read plus a bf16→f32→f16 conversion per element, repeated for 2 K16 steps × 8 N-tiles in every warp. That accounts for exactly the 256 ds_load_u16 per lane, and roughly 700 instructions per tile (~25%).
Fix: stage V once per tile as F16, transposed (k-contiguous, 80-byte row stride so fragments are two ds_load_b128). That's ~64 LDS writes per thread vs 256 reads + 288 cvt.
Constraint: a transposed F16 V tile is ~20 KB of LDS. The kernel was tuned under 32 KB for 2 workgroups/CU (the occ2 K/V buffer-share), so this needs an aliasing design (e.g. with smem_S / Q after QK) or an occupancy A/B.
Not started; queued behind the F16 GEMM twins (job 144). Details in atlas-audit log §12.7.
The F16-operand GEMM twins discussed above are now up as draft #155: dense m128, routed MoE and w8a16 FP8, plus engine wiring. 914/914 tests pass. It isn't merge-ready until the GPU bench (strix job 144, also built on winbox) shows the speedup and accuracy, and then the AMD gates.
Gufo, same box (s140): DFlash2 C1 9.3, C4 29.5, C8 42.5; AR C8 40.8
Atlas leads C1, matches C4; C8 is 0.80x (AR) / 0.72x (MTP). It was 0.41x on 10-29.
Inference: at C8, MTP is now slower than AR (30.4 vs 32.5; s163 shows the same). s168 tests ATLAS_MTP_MAX_SEQS=4 (AR above 4 active) as a gfx1151 default.
[amd-campaign · 2026-10-31 19:05Z · merged #297 → main 4fd2736 · strix s169] gfx1151 now turns MTP off above 4 active sequences. Exact train, 27B NVFP4, MTP 3 drafts, Gufo protocol ×2: C8 29.2 → 34.0 (+16%), C1 14.3 → 14.45, C4 28.35 → 28.15. Flash-Next shows the same crossover (framework f142: MTP vs AR C6 28.4/30.0, C8 31.3/34.1; MTP wins C1 and C4). Open, measured, not yet merged: an A-row cache-set aliasing fix in the batched decode GEMVs. BF16 batchm is 1.45–3.4× on the kernel, byte-identical (framework f148); e2e A/B f149 and the FP8 n2 port f150 are running.
[amd-campaign · 2026-11-01 · DevLab run 41242793577 · ref e3200c9+ (st995.sh rescore fix)] ST-995 for unsloth/Qwen3.8-27B-NVFP4 on Atlas (LM_HEAD=bf16): overall 85.43 / normalized 82.72; non_live 85.95, live 85.88, hallucination 76.33 (irrelevance 95.83, live_irrelevance 56.82). The NVIDIA checkpoint on Atlas scored 84.12 / 74.95 (live_irrelevance 37.50). Inference: most of the Atlas-vs-Gufo hallucination gap (Gufo 84.22 / 81.12, live_irrelevance 92.05) follows the checkpoint, not the engine. Unsloth on Atlas is within 1 point normalized of the 83.68 Strix baseline.
Independent GEMM ceiling, strix (hipblaslt-bench, BF16 in / F32 accumulate, the 27B MLP shapes; TFLOP/s = 2MNK / time)
tokens M
gate/up (N 17408, K 5120)
down (N 5120, K 17408)
512
22.9
23.6
2048
31.3
24.2
8192
32.4
23.5
hipBLASLt ceiling for the MLP at our 2048-token chunk: about 28.4 TFLOP/s, weighting the three projections by their time.
Our kernel (w4a16_gemm_t_m128_f16a, s191): about 22.6 TFLOP/s. That's ~80% of hipBLASLt BF16, and our kernel also unpacks the NVFP4 weights inside the loop.
What matching hipBLASLt would buy: about 4.4 s off a 45 s fresh 14.4k prefill, roughly 10%. Inference: there's no 2× left in 27B GEMMs on gfx1151.
Bigger chunks don't help: hipBLASLt at 8192 tokens is no faster than at 2048.
The down projection (K 17408) is the weak shape for hipBLASLt as well.
Follow-up to the accuracy head-to-head. framework f185 / strix s195, main f506e92.
Weight precision is ruled out. On nvidia/Qwen3.8-27B-NVFP4, the loader keeps the GDN qkvz + out_proj as native block-scaled FP8 ("native FP8 GDN … no NVFP4 requant; prefill+decode via w8a16"). llama.cpp widens the same FP8 values to BF16, so both engines compute on equal weights. (ATLAS_GDN_BF16_WEIGHTS=1 is for the Unsloth layout only: on this checkpoint it faults at the first prefill.)
MTP is not what limits 8-user decode (s195, ×2 rounds):
MAX_BATCH 8
C1
C4
C8
recipe (MTP)
15.6 / 14.2
30.3 / 28.2
34.7 / 32.5
MTP off
9.9 / 9.7
26.6 / 26.1
33.1 / 33.8
The C8 gap to llama.cpp (42–47) is in the batched decode kernels.
Next for accuracy: f186 runs ST-995 with MTP off; s196 is a fresh control with the recipe on current main.
The 27B accuracy gap is not MTP.nvidia/Qwen3.8-27B-NVFP4, main f506e92, ST-995, thinking off, MAX_BATCH 1:
run
overall
normalized
live_irrelevance
irrelevance
strix s196c, recipe (MTP)
84.32
74.58
38.64
58.33
framework f186d, MTP off
84.52
75.71
42.05
62.50
llama.cpp, same checkpoint (runner)
86.63
81.79
89.77
66.67
MTP is worth about one point, so it isn't the cause.
Ruled out so far: weight precision, tool grammar and MTP.
What's left is on the server side: how the prompt is rendered, Rust message preprocessing, or tool-call parsing. Both engines get identical requests from the same spark benchmark run bfcl-subset client.
In progress (DevLab 41587487769): replaying 60 live_irrelevance items against Atlas and llama.cpp on the runner and diffing the raw replies.
Root cause of the 27B accuracy gap: Atlas's <tool_call> logit bias.
Evidence. DevLab run 41587487769 used one runner and nvidia/Qwen3.8-27B-NVFP4 for both engines. It replayed 60 BFCL live_irrelevance items with tools, greedy, thinking off:
engine
items answered with a tool call (each a fail)
Atlas (recipe)
29 / 60
llama.cpp v0.8.0
8 / 60
Atlas declines in prose and then emits a call anyway:
live_irrelevance_17-2-5: "I don't have access to a VirusTotal API tool … unable to retrieve", then get_current_weather, finish=tool_calls.
18-2-6, 14-2-2 and 2-0-2 call a tool with empty content. llama.cpp answers each of them in prose.
Cause.api/chat/sampling_setup.rstool_call_bias adds +3.0 to <tool_call> on every tool-armed step. It's gated by [behavior].tool_call_steering, which defaults to true and is skipped only under --reference-mode. gb10/qwen3.8-flash-next turned it off in 565aa68 (tool_call_steering = false, max_inter_tool_prose = 0, verbatim_prompt = true); the strix-hip MODEL.tomls never did.
Fix under test: branch perf/hip-27b-reference-tools (on main 0fa3dc7):
A 17ead7be2: tool_call_steering = false, max_inter_tool_prose = 0. Tested by strix s201.
B ed48e505f: A + verbatim_prompt = true. Tested by framework f193 and DevLab (devlab/reftools-eval).
Bound: s199b runs --reference-mode.
The gates are ST-995 against control s196c (84.32 / 74.58, live_irrelevance 38.64), agentic with prefix cache ON (50/50 is the bar), and speed neutrality on the runner.
Gain from reference mode: +3.1 overall and +8.9 normalized over the recipe.
On identical weights, Atlas beats llama.cpp by +1.0 / +1.7.
Next: the MODEL.toml fix (perf/hip-27b-reference-tools, A = no steering, B = A + verbatim_prompt) has to reproduce this without --reference-mode, so the default recipe carries it.
27B ST-995 with thinking on, after #324 (strix s204, main 2f9c370, nvidia/Qwen3.8-27B-NVFP4, --default-chat-template-kwargs '{"enable_thinking":true}', run-1793756887430017766):
thinking
overall
normalized
irrelevance
live_irrelevance
on (s204)
88.94
89.97
100.00
96.59
off (f193 / DevLab)
88.24 / 88.54
84.83 / 85.56
75.00 / 79.17
94.32
Thinking on adds about 5 normalized points. Note: the 27B MODEL.toml leaves thinking_default unset, and the ST-995 leg sends no thinking flag, so dropping --disable-thinking alone does not turn thinking on (s200c reproduced the thinking-off score exactly).
DFlash2 on Atlas is not a decode lever on gfx1151 (strix s206, DFLASH=1, incoai/Qwen3.8-27B-DFlash2):
Single user: 8.9 tok/s, vs 13.8 with MTP on the same box.
8 users: the server would not start ("drafter balloon: 1.5 GiB alloc failed" at util 0.82).
Gufo's DFlash2 (24.9 tok/s single-user on framework) is its own implementation.
Activity
[-][job] GB10: raise the Atlas tensor-core GEMM ceiling (29-39 vs cuBLAS 75-206 TFLOP/s)[/-][+][job] Qwen3.8-27B on Strix Halo: prefill 2.4x gap + DP4A verify tiers for K=5..9[/+]AzeezIsh commentedon Sep 25, 2026
Stage-6 prefill matrix (strix, 2026-09-25) — no kernel-tier flag beats the default
main66 (
5b07b953) on gfx1151,nvidia/Qwen3.8-27B-NVFP4,serve-amd.shdefaults (prefill chunk 2048), max-seq 34000. Prefill tok/s = prompt tokens / TTFT, median of 3, greedy hash identical in every cell (565339bc).ATLAS_BF16_TC_PREFILL=1ATLAS_FP8_M64_PREFILL=1ATLAS_NO_FFN_NVFP4_MMQ=1AzeezIsh commentedon Sep 25, 2026
Kernel ranking: Strix long prefill is GEMM-efficiency-bound (rocprofv3, 2026-09-25)
main66 on gfx1151, nvidia 27B, one 7,235-token prefill (chunk 2048), trace sliced to the request window: 33.0 s busy of a 33.17 s span (99.5 %).
w4a16_gemm_t_m128w8a16_gemm_n_m128inferspark_prefill_paged_64chunk_delta_h_vfused+recompute_wu+chunk_fwd_o)w8a16_gemm_n_m128— the nvidia pack's GDN/attn projections are FP8; an in-SMEM FP8→BF16 dequant + WMMA with deeper pipelining, or requant them to NVFP4 (thefp8to4checkpoint already exists and passed ST-995); (2) fused gate+up with dual accumulators (pwilkinmmb.cu) so the FFN's activation tile is read once and gate/up are never written to global; (3) then re-profile at 29k where attention grows.AzeezIsh commentedon Sep 25, 2026
Strix prefill, part 2 (main66, gfx1151, 2026-09-25):
The chunk-size knob is not the long-context lever. At 29k:
--max-prefill-tokens2048 gives 144.6 / 138.5 tok/s; 8192 gives 139.6 / 137.2. That is the same within noise.fp8to4 checkpoint profile (the nvidia-derived conversion; the FP8 weights become W4A16), 7.2k prompt, measured under rocprofv3: 212.4 tok/s. The nvidia pack's unprofiled default is 202 tok/s.
w4a16_gemm_t_m128inferspark_prefill_paged_64w4a16_gemm_tgated_delta_rule_chunk_delta_h_vfuseddense_gemm_bf16gated_delta_rule_recompute_wugated_delta_rule_chunk_fwd_o(Profiler window: busy 33.88 s of 34.06 s.)
What this means. On both packs, prefill is one GEMM family. On the nvidia pack it is the W4A16 + W8A16 pair (47 % + 30 %); on fp8to4 it is a single kernel,
w4a16_gemm_t_m128, at 70 %. That kernel runs at ~27 % of the estimated WMMA peak.The only big Strix prefill lever is that GEMM's tile efficiency. Neither attention nor GDN comes to more than 7 %.
Next: occupancy and LDS analysis of
w4a16_gemm_t_m128: tile shape, dequant placement, and the WMMA issue rate.AzeezIsh commentedon Sep 25, 2026
w4a16_gemm_t_m128: LDS bank conflicts removed, and throughput-neutral (draft #79).So the kernel is not LDS-bound. The conflicts were real, but they were hidden behind something else.
Now running: a speed-of-light ablation on strix (timing only; the output is deliberately wrong).
AzeezIsh commentedon Sep 25, 2026
First Strix Halo 27B prefill win landed as a PR: #79 (ready for review).
w4a16_gemm_t_m128.What is left in this kernel. The timing-only ceiling with a trivial scale is −26 % kernel time. The remaining gap is the exact E4M3 scale decode, which runs ~8x redundantly across the threads that share a scale group.
v_permlane16/x16) would cut that redundancy with no memory cost.Measurement note for anyone benchmarking on this box. Back-to-back 7k prefills throttle about 10 % (e.g. 203.7 → 189.8 → 183.8 tok/s within one server), so single sequential A/B runs are ±5 %. Interleave arms and compare medians by request position.
AzeezIsh commentedon Sep 26, 2026
Tried and parked: sharing the exact E4M3 scale decode across lanes in
w4a16_gemm_t_m128(on top of #79 @ fd2fbeb; ISA only, not run).Why it looked worth doing: in
M128_STORE_TILE, lanesj, j+8, j+16, j+24of each wave hold the same 16 scale bytes. Each of them decodes all 16 withe4m3_scale_half, so the decode is 4x redundant inside a wave and 8x across the CTA. The X3 ablation (trivial scale) puts the exact decode at about 7-9 % of kernel time.The design:
row_xmask:8DPP and twov_permlanex16.ISA, TheRock hipcc 10.0.0,
-O3 -ffp-contract=off --offload-arch=gfx1151:w4a16_gemm_t_m128v_*)v_permlanex16/ DPPThe kernel already sits at the 256-VGPR cap. Keeping the four shared scales and the per-lane column permutation live pushes it into real scratch traffic in the tile loop. So this lever needs VGPR headroom first, for example a smaller A/B register-prefetch footprint, before it can pay off. Not pursued further for now. Next on this kernel family: the
w8a16_gemm_n_m128speed-of-light ablation (30 % of the 7.2k prefill).AzeezIsh commentedon Sep 26, 2026
Triage (2026-09-26). Strix 27B prefill is trending the right way:
Ready to merge, all byte-identical and measured:
After those land, re-measure both done-bar numbers on one tree: prefill at ~29–31.5k (bar ≥ 180 tok/s) and γ8 verify ms per step (bar ≤ 150 ms, from 255).
Scale back:
AzeezIsh commentedon Sep 27, 2026
Progress on the γ8 verify side (Strix Linux, gfx1151, 2026-09-26/27)
Where the time goes. One DFlash2 γ8 step on nvidia/Qwen3.8-27B-NVFP4 takes about 280 ms of GPU time. That's the rocprofv3 OFF arm of strix job
038d, MinHeap code prompt, 512 tokens, mean_na 5.66.w8a16_gemv_batch8(FP8 GDN qkvz/out_proj + attn QKV)w4a16_gemv_dp4a_dual_batch8(FFN gate+up)dense_gemv_bf16_batchm(BF16)w4a16_gemv_dp4a_batch8(FFN down)w4a16_gemv_batch8On this prompt, DFlash γ8 decodes about as fast as MTP K=4, ~24 tok/s each, so the verify GEMVs are the whole game.
PRs opened from this:
Where that leaves the step:
kernels/gb10/common/w4a16_gemv.cu, shared with gb10, so it needs a strix shadow);w4a16_gemv_batch8, which the drafter now uses too.Also this session:
wy9..wy16weren't declared absent on strix-hip.AzeezIsh commentedon Sep 27, 2026
Next levers for
w4a16_gemm_t_m128(Qwen3.8-Max consult, ranked, checked against the numbers in this thread).Where it stands: about 16 TFLOP/s, roughly 27 % of an estimated gfx1151 WMMA peak, at the 256-VGPR cap with 8 spills.
w8a16_gemm_n_m128(−30 % there, B-load bound)TCC_HIT/miss; keep if > 3–5 %SQ_INSTS_VALUCost check on #2: +0.125 B/weight on the dense FFN (5120 × 17408 × 3 × 64 ≈ 17.1 G weights) is about +2.1 GB. That only fits because #93 freed 5.5 GB on the same box, so budget for it explicitly against the DFlash2 γ8 recipe's headroom.
Suggested order: 1 → 3 → 2. Swizzle and spill removal cost no memory, and a fresh rocprof VGPR/spill readout comes before wiring anything, as with the reuse2 lesson.
AzeezIsh commentedon Sep 28, 2026
Status 2026-09-28. The Strix 27B PRs ride the per-deployment HIP train #131: #79 (NVFP4 dequant, prefill +5%), #93 (−7.2 GB), #94 (FP8 prefill GEMM, prefill +6–13%), #101 (DP4A batch8 verify, decode +8.5%), #107 (wy9..16 manifest), #124 (C≥2 crash) and #123 (shutdown abort).
055c-hip-train-gate, running: agentic 1007 turns, 2 and 4 concurrent, ST-995, and clean shutdown.059/060, and it closes if the result is neutral.054zzz1died building the model, and the agentic serve got 0.8 GB of KV). Its GB10 crash fix (1dd752f54) is being verified in625zzz4. Once it passes, it follows HIP train (Strix Linux + Windows): #79 #93 #94 #101 #104 #107 #123 #124 #131.AzeezIsh commentedon Oct 2, 2026
Kernel-level root cause of the gfx1151 NVFP4 prefill gap. Static ISA analysis is done; a GPU microbench is queued.
Method. Upstream clang 23 targeting gfx1151, with Atlas's HIP flags and ROCm 7.13 headers. The production sources compile unmodified (plus a one-line bit-cast shim for upstream clang's bf16 WMMA builtin signature). I counted the hot-loop instruction mix from the loop blocks.
Hardware facts (compiled probes):
v_pk_mul_f16exists; there is no packed bf16 math.Per-32-K-step hot loop:
w4a16_gemm_t_m128(dense prefill; 46% of 27B prefill per job 077)w8a16_gemm_n_m128(FP8 layers; 26% per job 077)moe_w4a16_fused_gate_up_t/…ptrtable_t(Flash-Next routed experts)Fix: F16 operands with an exact dequant.
v_permper four codes converts them.bits<<7 × 256, then onev_pk_mul_f16multiplies two weights at a time.Prediction: ~1.3–1.5× on the dense GEMM (≈25–33 TF/s from 19–24); more on the MoE kernels.
Validation: strix job 144 and a winbox slot after #80's ST-995.
Full write-up: atlas-audit
14_LOG_2026-10-02.md§12.AzeezIsh commentedon Oct 2, 2026
Prefill attention on gfx1151: quantified lead (static ISA,
inferspark_prefill_pagedviaprefill_paged_compute.cuh; attention is 8.5% of 27B prefill at 8k and 33% at 29k).s_waitcnt, 288v_cvt_f16_f32, 262v_lshlrev, and 256ds_load_u16.bb[k] = (__fp16)(float)smem_K[k_off + k][d_col]. That's a column-strided 2-byte LDS read plus a bf16→f32→f16 conversion per element, repeated for 2 K16 steps × 8 N-tiles in every warp. That accounts for exactly the 256ds_load_u16per lane, and roughly 700 instructions per tile (~25%).ds_load_b128). That's ~64 LDS writes per thread vs 256 reads + 288 cvt.smem_S/ Q after QK) or an occupancy A/B.AzeezIsh commentedon Oct 2, 2026
The F16-operand GEMM twins discussed above are now up as draft #155: dense m128, routed MoE and w8a16 FP8, plus engine wiring. 914/914 tests pass. It isn't merge-ready until the GPU bench (strix job 144, also built on winbox) shows the speedup and accuracy, and then the AMD gates.
43 remaining items
AzeezIsh commentedon Oct 31, 2026
[amd-campaign · 2026-10-31 17:40Z · strix s166 · main b73b73e] 27B same-box h2h, Atlas side (Gufo protocol, prefix cache on):
Inference: at C8, MTP is now slower than AR (30.4 vs 32.5; s163 shows the same). s168 tests
ATLAS_MTP_MAX_SEQS=4(AR above 4 active) as a gfx1151 default.AzeezIsh commentedon Oct 31, 2026
[amd-campaign · 2026-10-31 19:05Z · merged #297 → main 4fd2736 · strix s169] gfx1151 now turns MTP off above 4 active sequences. Exact train, 27B NVFP4, MTP 3 drafts, Gufo protocol ×2: C8 29.2 → 34.0 (+16%), C1 14.3 → 14.45, C4 28.35 → 28.15. Flash-Next shows the same crossover (framework f142: MTP vs AR C6 28.4/30.0, C8 31.3/34.1; MTP wins C1 and C4). Open, measured, not yet merged: an A-row cache-set aliasing fix in the batched decode GEMVs. BF16 batchm is 1.45–3.4× on the kernel, byte-identical (framework f148); e2e A/B f149 and the FP8 n2 port f150 are running.
AzeezIsh commentedon Nov 1, 2026
[amd-campaign · 2026-11-01 21:20Z · strix s177b · main de0ac8e] 27B NVFP4 headline through serve-amd.sh recipe defaults, ×2:
SSM_SLOTS=8, TTFT after 8k of context 35.3 → 9.25 s, after 16k 68.7 → 10.5 s. The old default of 0 drops every prefix hit on hybrid models; serve-amd.sh: SSM_SLOTS defaults to 8 so hybrid models reuse cached prefixes (TTFT after 8k context 3.2–3.8× lower) #311 makes 8 the default.AzeezIsh commentedon Nov 1, 2026
[amd-campaign · 2026-11-01 · DevLab run 41242793577 · ref e3200c9+ (st995.sh rescore fix)] ST-995 for unsloth/Qwen3.8-27B-NVFP4 on Atlas (LM_HEAD=bf16): overall 85.43 / normalized 82.72; non_live 85.95, live 85.88, hallucination 76.33 (irrelevance 95.83, live_irrelevance 56.82). The NVIDIA checkpoint on Atlas scored 84.12 / 74.95 (live_irrelevance 37.50). Inference: most of the Atlas-vs-Gufo hallucination gap (Gufo 84.22 / 81.12, live_irrelevance 92.05) follows the checkpoint, not the engine. Unsloth on Atlas is within 1 point normalized of the 83.68 Strix baseline.
AzeezIsh commentedon Nov 2, 2026
[amd-campaign · 2026-11-02 01:15Z · strix s185 · main 9571227] 27B NVFP4 agentic-webserver, 50 iterations, through serve-amd.sh recipe defaults: MAX_BATCH 1, MTP, prefix caching on,
SSM_SLOTS=8(the #311 default). Result: 50/50 pass; TTFT median 1.79 s, p90 4.66 s, max 14.9 s over 537 requests; Marconi prefix hits restored 484, dropped 49; 0 faults.AzeezIsh commentedon Nov 2, 2026
27B prefill attribution, strix s191 (main f506e92, nvidia/Qwen3.8-27B-NVFP4, rocprofv3, one fresh 14,356-token prompt, chunk 2048: 44.97 s = 319 tok/s, GPU 99.9% busy)
AzeezIsh commentedon Nov 2, 2026
Independent GEMM ceiling, strix (
hipblaslt-bench, BF16 in / F32 accumulate, the 27B MLP shapes; TFLOP/s = 2MNK / time)AzeezIsh commentedon Nov 2, 2026
27B accuracy head-to-head on identical weights (DevLab runner run 41492887907; stock llama.cpp v0.8.0 8642541b2 converts
nvidia/Qwen3.8-27B-NVFP4out of the box: 27 GB GGUF, NVFP4 10.3 GB + BF16 17.9 GB; ST-995, thinking off, one slot)This is a ~7-point normalized gap from the engine alone, almost all of it in live_irrelevance (the model should decline a tool call).
Already ruled out: tool grammar (s146 matched s144 exactly).
Probably not the template: there's no
jinja-templates/override for this model_type, so both engines render the checkpoint's own template (inference).Untested candidates:
Next: an Atlas A/B that removes each candidate in turn, on the same ST-995 leg.
AzeezIsh commentedon Nov 2, 2026
Follow-up to the accuracy head-to-head. framework f185 / strix s195, main f506e92.
Weight precision is ruled out. On
nvidia/Qwen3.8-27B-NVFP4, the loader keeps the GDN qkvz + out_proj as native block-scaled FP8 ("native FP8 GDN … no NVFP4 requant; prefill+decode via w8a16"). llama.cpp widens the same FP8 values to BF16, so both engines compute on equal weights. (ATLAS_GDN_BF16_WEIGHTS=1is for the Unsloth layout only: on this checkpoint it faults at the first prefill.)MTP is not what limits 8-user decode (s195, ×2 rounds):
The C8 gap to llama.cpp (42–47) is in the batched decode kernels.
Next for accuracy: f186 runs ST-995 with MTP off; s196 is a fresh control with the recipe on current main.
AzeezIsh commentedon Nov 3, 2026
The 27B accuracy gap is not MTP.
nvidia/Qwen3.8-27B-NVFP4, main f506e92, ST-995, thinking off, MAX_BATCH 1:spark benchmark run bfcl-subsetclient.AzeezIsh commentedon Nov 3, 2026
Root cause of the 27B accuracy gap: Atlas's
<tool_call>logit bias.Evidence. DevLab run 41587487769 used one runner and
nvidia/Qwen3.8-27B-NVFP4for both engines. It replayed 60 BFCL live_irrelevance items with tools, greedy, thinking off:Atlas declines in prose and then emits a call anyway:
live_irrelevance_17-2-5: "I don't have access to a VirusTotal API tool … unable to retrieve", thenget_current_weather,finish=tool_calls.18-2-6,14-2-2and2-0-2call a tool with empty content. llama.cpp answers each of them in prose.Cause.
api/chat/sampling_setup.rstool_call_biasadds +3.0 to<tool_call>on every tool-armed step. It's gated by[behavior].tool_call_steering, which defaults to true and is skipped only under--reference-mode.gb10/qwen3.8-flash-nextturned it off in 565aa68 (tool_call_steering = false,max_inter_tool_prose = 0,verbatim_prompt = true); the strix-hip MODEL.tomls never did.Fix under test: branch
perf/hip-27b-reference-tools(on main 0fa3dc7):17ead7be2:tool_call_steering = false,max_inter_tool_prose = 0. Tested by strix s201.ed48e505f: A +verbatim_prompt = true. Tested by framework f193 and DevLab (devlab/reftools-eval).--reference-mode.The gates are ST-995 against control s196c (84.32 / 74.58, live_irrelevance 38.64), agentic with prefix cache ON (50/50 is the bar), and speed neutrality on the runner.
AzeezIsh commentedon Nov 3, 2026
Confirmed on framework (f190b). Main f506e92, the same 60 live_irrelevance items:
--reference-modeAzeezIsh commentedon Nov 3, 2026
With the server-side defaults off, the gap is closed and Atlas leads.
nvidia/Qwen3.8-27B-NVFP4, ST-995, thinking off:--reference-mode, strix s199b (main f506e92), run-1793695910446604122--reference-mode, DevLab 41593030112 (main 9c45191)perf/hip-27b-reference-tools, A = no steering, B = A +verbatim_prompt) has to reproduce this without--reference-mode, so the default recipe carries it.AzeezIsh commentedon Nov 3, 2026
Merged: #324 → main 2f9c370. strix-hip 27B:
tool_call_steering = false,max_inter_tool_prose = 0,verbatim_prompt = true.Post-merge build + serve of the new main is queued first on both boxes (s202, f195).
AzeezIsh commentedon Nov 4, 2026
27B ST-995 with thinking on, after #324 (strix s204, main 2f9c370,
nvidia/Qwen3.8-27B-NVFP4,--default-chat-template-kwargs '{"enable_thinking":true}', run-1793756887430017766):thinking_defaultunset, and the ST-995 leg sends no thinking flag, so dropping--disable-thinkingalone does not turn thinking on (s200c reproduced the thinking-off score exactly).DFlash2 on Atlas is not a decode lever on gfx1151 (strix s206,
DFLASH=1, incoai/Qwen3.8-27B-DFlash2):