[PR #187] [CLOSED] decode: QSA block scores read each key block once per window (bit-identical) #2497

Closed
opened 2026-11-04 02:00:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/187
Author: @q8atnight
Created: 9/30/2026
Status: ❌ Closed

Base: main ← Head: pr/qsa-scores-multi


📝 Commits (2)

  • 16df125 decode: QSA block scores read each key block once for all of a window's queries (bit-identical; STRATA_SCORES_MULTI=0 = old grid)
  • 7206157 decode: QSA scores multi - comment names every caller that takes it (decode captured or not, prefill's pooled16); no box-specific note (review)

📊 Changes

1 file changed (+56 additions, -0 deletions)

View changed files

📝 src/kernels/cuda/qsa_select.cu (+56 -0)

📄 Description

Summary

In a captured decode window qsa_block_scores launched a (max_blocks / 8) x nq grid (~24,600 mostly idle blocks per
layer) and re-read every pooled key block once per query. New kernel: a fixed grid strides over the key blocks, reads
each once and scores it for all of the window's queries (up to 8); per (block, query) the same arithmetic in the same
order as block_scores_kernel. Used only when no active-block count is given (the captured decode window).

One commit on top of 0.1.27 (a790805); all four of my current branches were compile-tested together on 0.1.27.

Measured

Measured on 2x RTX 3090, IQ3_S, with the engine this was developed in (0.1.24 + the dual-GPU work): at 32K context the
"scores+topk" stage 1.02 -> 0.90 ms per window; verify window 20.28 -> 20.04 ms.

Correctness

Bit-identical scores.

Switch

STRATA_SCORES_MULTI=0 = the old grid.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/187 **Author:** [@q8atnight](https://github.com/q8atnight) **Created:** 9/30/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/qsa-scores-multi` --- ### 📝 Commits (2) - [`16df125`](https://github.com/Niko1221/Strata/commit/16df12504f711bba130d6d9b11a41cab83f4333f) decode: QSA block scores read each key block once for all of a window's queries (bit-identical; STRATA_SCORES_MULTI=0 = old grid) - [`7206157`](https://github.com/Niko1221/Strata/commit/7206157be26c195c885bccd6103f8bddcb563c7b) decode: QSA scores multi - comment names every caller that takes it (decode captured or not, prefill's pooled16); no box-specific note (review) ### 📊 Changes **1 file changed** (+56 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/kernels/cuda/qsa_select.cu` (+56 -0) </details> ### 📄 Description ## Summary In a captured decode window `qsa_block_scores` launched a (max_blocks / 8) x nq grid (~24,600 mostly idle blocks per layer) and re-read every pooled key block once per query. New kernel: a fixed grid strides over the key blocks, reads each once and scores it for all of the window's queries (up to 8); per (block, query) the same arithmetic in the same order as `block_scores_kernel`. Used only when no active-block count is given (the captured decode window). One commit on top of 0.1.27 (a790805); all four of my current branches were compile-tested together on 0.1.27. ## Measured Measured on 2x RTX 3090, IQ3_S, with the engine this was developed in (0.1.24 + the dual-GPU work): at 32K context the "scores+topk" stage 1.02 -> 0.90 ms per window; verify window 20.28 -> 20.04 ms. ## Correctness Bit-identical scores. ## Switch `STRATA_SCORES_MULTI=0` = the old grid. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:00:44 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2497
No description provided.