mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2093] [CLOSED] sm_75: the prompt path's top-k with one full read of the scores (identical ids) #3855
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#3855
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2093
Author: @rafatxf
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:pr/sm75-prompt-topk-sample📝 Commits (2)
4a6d11asm_75: the decode QSA selection at long context, split top-k and halving scorer (bitwise)50038b0sm_75: the prompt path's top-k with one full read of the scores (identical ids)📊 Changes
2 files changed (+628 additions, -3 deletions)
View changed files
📝
src/kernels/cuda/qsa_select.cu(+605 -3)📝
src/kernels/qsa_select_bench.cpp(+23 -0)📄 Description
Builds on #2072 (it sits next to that PR's split top-k in
qsa_select.cu); the first commit here is #2072's, the second is this one.Past ~115K cells the prompt path's top-k is DRAM traffic on Turing:
block_topk_wide_kernelreads a query's scores six times (four radix passes, a count, the emit), 400 KB a query at 400K, 256 queries a call.block_topk_sample_kernelreads them once:widthcells, the width-th largest cell key (block_topk_kernel's threshold) is ≥ LB, so every block at or above the threshold is a candidate: the threshold,aboveand the tie budget computed over the candidates with block_topk_kernel's rule are the reference's, and the candidates sorted by block (bitonic) emit the reference's cells in its order;block_topk_wide_kernel<true>runs it - the all-equal-scores case of the parity test takes that path.Used for prompt calls above 28,672 active blocks (below, the wide kernel is as fast);
STRATA_TOPK_SAMPLE=0keeps the wide kernel.Setup
RTX 2080 Ti 22 GB (sm_75), i7-6700, CUDA 13.0, driver 595, SM 1650 MHz, 240 W;
v0.1.43+ #2072,-DSTRATA_BUILD_TESTS=ON. Model Q2_0,--max-context 524288,--kv int8 --kv-resident 32768,STRATA_SELECT_SIMT=2(#2071).qsa_topk_parity CTX 256 20 524288 1(a prompt call), dispatched timeqsa_topk_parity --selftest: PASS (continuous, 64-level and equal scores; identical ids).qsa_topk_active_parity(STRATA_TOPK_ACTIVE_ANY=1): 20 cases, identical.Engine
First logits after a 196K prompt: bitwise identical to the run without it (
STRATA_DUMP_FIRST_LOGITS). The gain sits at depth: with this, #2071 and #2091 and #2092, appending 16K tokens to a 390K conversation (--serve) went 15.9 → 12.9 s here.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.