Skip to content

perf(hip): Flash-Next hc_pre_down stays single-pass at decode widths (bit-identical, ~+8% C8) - #384

Merged
AzeezIsh merged 2 commits into
mainfrom
perf/hip-hc-pre-down-cutover
Nov 16, 2026
Merged

AzeezIsh merged 2 commits into
mainfrom
perf/hip-hc-pre-down-cutover

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

What

On HIP, Flash-Next's mHC low-rank down projection switched from the single-pass hc_pre_down to hc_pre_down_tiled at T ≥ 5. That came from kbench 42932386097: tiled 189 vs single-pass 319 µs at T=8. #373 then made hc_pre_down 2.7x faster, and the cutover went stale.

Tiled was 205 µs per call, 11.4% of strix Flash-Next C8 decode GPU time. Decode widths (T ≤ HC_TT) now take hc_pre_down on every platform. Tiled keeps T > 8 (prefill), unchanged.

Both kernels compute each (t, r) as one lane-strided warp walk plus the same shuffle tree, so outputs are bit-identical.

Evidence (strix DevLab runner)

gate result
kbench, outputs memcmp-equal (43868021041) T=4 56.4 vs 149.7 µs, T=5 59.6 vs 163.2, T=6 66.4 vs 166.4, T=8 76.3 vs 183.7
in-situ C8 profile (43872204318 vs 43841189468 / 43817898424) hc down 205 µs tiled → 88 µs hc_pre_down per call (11.4% → 5.1% of GPU time); C8 profiled 45.9 vs 42.4 tok/s agg
C1 greedy decode shas (43872209397) 09714ec21a48 / 103770824dbe / 242c7689320c, identical to main
C8 per-stream shas from main's own set (main's rounds differ by batch composition)
framework same-box C8 A/B f316, queued; this PR merges after it confirms

🤖 Generated with Claude Code

AzeezIsh and others added 2 commits November 16, 2026 08:03
…(bit-identical)

HIP cut the mHC low-rank down projection over to hc_pre_down_tiled from T=5
(kbench 42932386097, tiled 189 vs single-pass 319 us at T=8). #373 then made
the single-pass hc_pre_down 2.7x faster and the cutover went stale: tiled
was 205 us a call, 11.4% of strix Flash-Next C8 decode. Re-measured (kbench
43868021041, outputs memcmp-equal): T=5 59.6 vs 163.2 us, T=6 66.4 vs 166.4,
T=8 76.3 vs 183.7. Decode widths now take hc_pre_down on every platform;
tiled keeps T > HC_TT (prefill), unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Framework f316 same-box C8 A/B (3 rounds x 8 x 256 tokens): main 47.4 / 49.3 / 49.7 vs branch 49.2 / 52.0 / 52.0 tok/s agg (+4.7%); per-stream shas identical across arms. Trimmed the comment (file was 501 lines, cap is 500).

@AzeezIsh
AzeezIsh merged commit 86a0b09 into main Nov 16, 2026
24 of 27 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