Skip to content

fix(strix-hip): /v1/score on gfx1151 — batched paged prefill kernels take #331's state_end - #365

Merged
AzeezIsh merged 1 commit into
mainfrom
fix/hip-score-state-end
Nov 13, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
fix/hip-score-state-end

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

Problem

#331's prefix-bidirectional score mask (87bc7da) added a per-stream state_end argument after kv_lens to every batched paged prefill attention launch (prefill_attn_batched.rs). It also added the parameter to gb10's prefill_paged_compute.cuh under PREFILL_STATE_END.

strix-hip compiles the same inferspark_prefill_paged{,_fp8,_nvfp4}_batched.cu. They are symlinks to gb10 and #define PREFILL_STATE_END, but they build against strix-hip's own prefill_paged_compute.cuh, which never gained the parameter. On gfx1151 each of these launches passes one pointer more than the kernel declares, so every argument after kv_lens is read shifted. /v1/score's merged one-pass forward runs through them.

Fix

Port the gb10 change into both strix-hip kernels (BR32 and _64):

  • the parameter;
  • s_end = state_end[b];
  • the state-row KV block bound;
  • the mask: state rows see the state, question rows see every key.

Builds without PREFILL_STATE_END (sink, ricursive verify) get s_end = -1 as a constant, so the causal path is unchanged.

Evidence

DevLab Strix runner, nvidia/Qwen3.8-27B-NVFP4, scripts/devlab/score_check.sh, MAX_BATCH 8. The test scores 8 yes/no facts as branches of one few-shot prefix, with options " Yes"/" No":

Check main e851e96 (43485619596) this branch (43485835050)
T1 sanity (causal) 6/8 8/8
T2 merged vs solo, max |Δp| 0.111 0.011
T4 prefix_bidir sanity 4/8 (Δp vs causal 0.44) 8/8 (Δp 0.019, so the mask is applied)
Server errors 0 0

MAX_BATCH 1 answers 422 on both ("a branch needs 2 sequences, one pass holds 1"), as designed.

Still running before merge

  • score_check repeat on both, with a completions-logprob reference, a moved-split reference and latency: 43493815372 (this branch), 43493821474 (main).
  • 27B C8 chat A/B against main (43493827125).
  • Post-merge build+serve on framework and the runner.

🤖 Generated with Claude Code

…331 prefix_bidir)

#331 (87bc7da) added a per-stream state_end argument to the batched paged
prefill attention launches (prefill_attn_batched.rs) and to gb10's
prefill_paged_compute.cuh under PREFILL_STATE_END. strix-hip compiles the same
inferspark_prefill_paged{,_fp8,_nvfp4}_batched.cu (symlinks, which define
PREFILL_STATE_END) against its own prefill_paged_compute.cuh, and that header
never gained the parameter. On gfx1151 every batched paged prefill launch
therefore passes one pointer more than the kernel declares, and every argument
after kv_lens is read shifted. /v1/score's merged one-pass forward goes
through these kernels.

Port the gb10 change to both strix-hip kernels (BR32 and _64):
- the parameter;
- s_end from state_end[b];
- the state-row KV block bound;
- the mask (state rows see the state, question rows see every key).

With PREFILL_STATE_END undefined (the sink and ricursive builds) s_end is the
constant -1, and the causal path is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AzeezIsh
AzeezIsh merged commit 471fde5 into main Nov 13, 2026
22 of 25 checks passed
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Pre-merge gates (DevLab runner):

  • Score repeat (43493815372): identical to r1 (deterministic).
    • T1 8/8, T2 0.011, T4 bidir 8/8.
    • T3b moved-split reference 0.005, against main's 0.33 (43493821474).
    • Chat C4 == solo 12/12.
    • Latency p50: 1.21 s for 8 branches, 0.56 s for 1 branch.
  • 27B chat A/B against main c14f69e (43493827125): neutral.
    • C8 34.7/34.8 vs 34.8/34.8; C1 and C4 equal.
    • 6/8 identical to solo in both arms, 0 faults.

Post-merge build+serve on framework and the runner follows.

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