Skip to content

inkling2 on AMD: flash prefill without register spills under hipcc 7.16 - #426

Merged
AzeezIsh merged 1 commit into
mainfrom
perf/inkling2-hip-flash-spills
Nov 25, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
perf/inkling2-hip-flash-spills

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

inkling2 on AMD: flash prefill without register spills under hipcc 7.16

hipcc 7.16 (runner toolchain, ROCm 7.16.26385) compiles the merged
flash kernel to 256 VGPRs + 117-128 VGPR spill slots; hipcc 7.13
(framework) gives 234 VGPRs / 0 spills. With this change: fused
softmax row staging (no tm/pv temporaries) + V staged as fp16 in LDS
(numerics bit-identical to the old per-head kernel's V path).

ISA after fix: 7.13 = 234 VGPR / 0 spills / 44KB LDS; 7.16 = 256 VGPR
/ 16 spill slots (residual spills in shfl_xor reduce blocks only).
Bit-identical output in the standalone CPU-reference harness
(q_len 1..4096, q_offset chunked, windows 0/16/64/1024).

Runner prefill (Ryzen AI MAX+ 395, gfx1151, hipcc 7.16):
main ~1,192/954 tok/s -> 1,327/1,174 tok/s (+11%/+23%).
Framework prefill: 1,362 -> 1,525 @7.7K, 1,109 -> 1,383 @31k.

Follows #413 (merged in train #421 as 75e3941), whose AMD flash prefill spills on the DevLab runners toolchain. AMD-only (#if SCALE / HIP_PLATFORM_AMD branch); gb10 PTX untouched. Runner gates (ST-995, agentic x10, H2H vs main bc0c3a3) in flight; results will be posted here before merge.

Generated with Devin

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA. Thank you!
Posted by the CLA Assistant Lite bot.

hipcc 7.16 (runner toolchain, ROCm 7.16.26385) compiles the merged
flash kernel to 256 VGPRs + 117-128 VGPR spill slots; hipcc 7.13
(framework) gives 234 VGPRs / 0 spills. With this change: fused
softmax row staging (no tm/pv temporaries) + V staged as fp16 in LDS
(numerics bit-identical to the old per-head kernel's V path).

ISA after fix: 7.13 = 234 VGPR / 0 spills / 44KB LDS; 7.16 = 256 VGPR
/ 16 spill slots (residual spills in shfl_xor reduce blocks only).
Bit-identical output in the standalone CPU-reference harness
(q_len 1..4096, q_offset chunked, windows 0/16/64/1024).

Runner prefill (Ryzen AI MAX+ 395, gfx1151, hipcc 7.16):
main ~1,192/954 tok/s -> 1,327/1,174 tok/s (+11%/+23%).
Framework prefill: 1,362 -> 1,525 @7.7K, 1,109 -> 1,383 @31k.
@AzeezIsh
AzeezIsh force-pushed the perf/inkling2-hip-flash-spills branch from 5783098 to 1809389 Compare November 25, 2026 20:36
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Runner gates at 1809389d2 (tree == 5783098cb)

leg run host result
prefill H2H, this PR 45673992469 X2-LA03-S01-D07 Spark 1,287 / 1,143 tok/s (7.7K / 31K); decode 42.7, C8 82.3; Strict prefill 1,281 / 1,140
prefill H2H, main bc0c3a34b 45679041312 X2-LA03-S01-D01 Spark 1,101 / 838; decode 42.8, C8 85.8
ST-995 Spark 45673951150 — 79.30 / 79.26, 0 faults (main #412-only: 79.10 / 79.63)
agentic ×10 Spark 45673975018 X2-LA03-S03-D08 10/10, 6.72 s/turn, 0 faults
  • Prefill vs main: +16.9% at 7.7K tokens and +36.4% at 31K, with decode unchanged. The kernel no longer spills under hipcc 7.16; main's 75e3941 spilled 117 VGPR slots on the runners.
  • Numerics (framework): pd 96/96 ×6, NLL code 0.63684 / text 0.89670, and the 150-request bfcl replay 150/150 with 0 faults.
  • gb10: the change is AMD-branch only, and the PTX is unchanged.

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