Skip to content

perf(hip): deep-K staging in the m32 n64 verify twin (bit-identical, +10% Ripple DFlash2 decode) - #359

Merged
AzeezIsh merged 1 commit into
mainfrom
perf/hip-w4a16-m32-deepk
Nov 13, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
perf/hip-w4a16-m32-deepk

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

Deep-K staging in the n64 instantiation of the 32-row verify twin from #354 (w4a16_m32_f16a_body<NT, KS>). It stages KS K-steps of A and B per barrier. n64 now uses KS=4 and n128 keeps KS=1, because wide N got worse at KS4 (gate/up went from 647 to 921 µs). The change is applied to both separate copies of w4a16_gemm.cu (27B and 35B-A3B); Flash-Next and Nemotron symlink to them.

The summation order is unchanged, so the output is bit-identical and ST-995 is not needed.

Evidence (DevLab Strix runner, gfx1151)

kbench (scripts/devlab/kbench_dn/w4a16_m32_deepk.hip on devlab/engine-study): 0 diffs against KS1 on every shape.

Shape KS1 (µs) KS4 (µs)
Ripple down, M17 (N5120, K40960) 1151 821
o 290 205
drafter fc 718 506
down, M9 1143 797

Ripple-65B + DFlash2, end to end (C1 mixed, steady all-decoding):

Round This branch main 75a6032 Runs
r1 6.3 tok/s 5.7 tok/s 43418571633 vs race-a
r2 6.2 tok/s 5.6 tok/s 43426502674 vs 43426507648
  • probe-ripple_dflash.json is byte-identical to main in both rounds.

27B NVFP4, C8, NUM_DRAFTS=3, 2 rounds (43426517156):

Arm C1 C4 C8 Faults C8 identical to solo
main 18.7 34.2 / 34.1 34.9 / 34.8 0 7/8
this branch 18.7 / 18.6 34.2 / 33.8 34.8 / 35.0 0 7/8 (same as main)

27B is neutral.

🤖 Generated with Claude Code

The n64 m32 twin serves Ripple's narrow long-K verify GEMMs (down 5120x40960,
o, fc), where 80 CTAs walking K one 32-K step per two barriers sit at ~100
GB/s. Stage KS=4 steps per barrier interval and run their WMMAs in ascending
k: same operands, same order, so outputs are bit-identical to m128_f16a.
gfx1151 kbench 43410492618 (0 differing outputs): down M17 1151 -> 821 us,
o 290 -> 205, fc M16 718 -> 506. n128 keeps KS=1 (wide shapes lose occupancy).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AzeezIsh
AzeezIsh merged commit e851e96 into main Nov 13, 2026
14 of 20 checks passed
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Post-merge (e851e96), both AMD boxes green:

  • Framework f285: build OK; Ripple+DFlash2 serves; req1 == req2 (greedy); 0 prefill-start errors; 0 lm_head teardown failures.
  • DevLab runner, DFlash2 steady decode: 6.3 tok/s (43435177740) and 6.2 tok/s on a repeat (43435192374). probe-ripple_dflash.json is byte-identical to pre-merge main.
  • DevLab runner, AR: 3.6 tok/s (43435182658).
  • 27B, C8, NUM_DRAFTS=3 (43426517156): neutral, 0 faults.

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