mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4118] [Engine] Opt-in two-pass QSA prompt selection: 3xTF32 only near the top-k cut-off, the same cells #1801
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1801
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bitaccesscomau on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4118
Area
[Engine] (speed, kernels, models, the server and API)
What do you want to do?
Read long prompts faster on sm_80+ cards without changing any output.
On an RTX 3090 a cold 256K prompt spends about 13% of its read in the QSA selection (
STRATA_PREFILL_TIMING=1onv0.2.4.1:
qsa select17.4 s of a 136.3 s GPU timeline), most of it in the block scores.qsa_block_scores_tccomputes every block score of every query in 3xTF32 (48 m16n8k8 MMAs per indexer head and block), although only the
blocks near each query's top-k cut-off need that precision.
Proposed behaviour, opt-in with
STRATA_SELECT_TWO_PASS=1(off by default): score every block once in single-passTF32, bound per block how far that score can be from today's 3xTF32 score, and score again with today's 3xTF32
arithmetic, bit for bit, only the blocks whose bound reaches the cut-off.
qsa_block_topkthen returns today's cellsin today's order, ties included. With the variable unset nothing changes.
Measured on a working branch (one commit on
main7dd5cf18; one RTX 3090 24 GB on PCIe 3.0 x16 at 250 W, releasedefaults, the same binary with the switch off and on, 2 pairs of 2 runs): 256K prompt read 1,887 to 1,984 tokens/s
(+5.2%, run ratios 1.047 to 1.055), 128K +2.2%, 32K +0.2%, decode within the spread of the runs. Replies are
byte-identical to
mainat 1K, 32K, 128K and 256K with the switch off and on, and the switch's own check found 0queries with other cells out of 1,523,556 at 128K and 3,046,896 at 256K.
Tradeoffs:
SYCL are unchanged.
STRATA_SELECT_TWO_PASS_MIN, default 4096 blocks), and 32K isabout even.
real prompts the largest error used 0.21 of the bound.
today. None did on the prompts above.
Is this in scope as an opt-in switch? If so I will open the pull request; the code, tests and measurements are ready.
What do you do today instead?
Nothing: the 3xTF32 scorer scores every block. The closest existing work is #3498 (HIP,
STRATA_SELECT_SPLIT2), whichdrops the lo pieces and changes rounding (253 of 256 selections at 262K); this proposal keeps the selection bitwise.
@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.