Skip to content

strix-hip GDN: vector LDS staging in the chunk_delta_h spine (bit-identical, +1.6..2.2% 27B prefill) - #260

Merged
AzeezIsh merged 1 commit into
mainfrom
perf/hip-gdn-vec-stage
Oct 29, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
perf/hip-gdn-vec-stage

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

gfx1151 only (kernels/strix-hip/common/gated_delta_rule_fla.cu, a strix-local file shared by qwen3.8-27b and qwen3.8-flash-next).

gated_delta_rule_chunk_delta_h_vfused (the serial GDN spine: 5.7% of a 27B 18k prefill, 7.1% of Flash-Next 6.6k) staged each chunk's W/U/K into LDS one bf16 per thread per iteration, and thread 0 computed all 65 decay expf. W/U now stage as uint4, and K as uint4 rows when the key row base is 16-byte aligned (element loop otherwise). Each thread computes one decay term.

Bit-identical: the harness hash of S, uc and the final state equals main's, and greedy probes are IDENTICAL on strix (s127) and DevLab.

1.9k 7.4k 12.5k
kernel, strix harness (27B geometry, one 2048-token chunk, s126 ×3) 6.0–6.7 → 3.8–3.9 ms (−40%)
e2e 27B, DevLab desktop, 4/4 rounds (run 40931998079, base = main incl. #259) 418–427 → 427–436 tok/s (+2.2%) 387–389 → 394–398 (+2.0%) 34.0–34.1 → 33.3–33.6 s (+1.6%)
e2e 27B, strix Z13 (s127 ×3) throttle noise noise noise

Splitting the v columns over more CTAs instead (also bit-identical) was 2–4× slower (s125), which is how the staging was identified as the critical path.

🤖 Generated with Claude Code

…ntical, -40% kernel)

gated_delta_rule_chunk_delta_h_vfused is the serial GDN spine, 5.7% of a
27B 18k prefill (s124) and 7.1% of Flash-Next's 6.6k (f78). It staged each
chunk's W, U and K into LDS one bf16 per thread per iteration (3 x 32
dependent loop trips), and thread 0 computed all 65 decay expf alone.
With only 48 CTAs (one per v-head) the staging was the critical path:
splitting the v columns across 2x/4x more CTAs made the kernel 2.3x / 4x
slower (s125), because each thread then had more loads to do.

W and U now stage as uint4. K stages as uint4 rows when the key row base
is 16-byte aligned, and keeps the element loop otherwise. Each thread
computes one decay term. The bytes and the expf operands are identical,
so the output is bit-identical: the harness hash of S, uc and the final
state equals main's.

strix s126 (27B geometry, one 2048-token chunk, interleaved x3):
6.0-6.7 ms -> 3.8-3.9 ms.

The common FLA file serves both qwen3.8-27b and qwen3.8-flash-next on
gfx1151.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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