mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2071] [CLOSED] sm_75: a faster tiled FP32 block scorer (STRATA_SELECT_SIMT=2), and the case for SIMT on RTX 20 by default #3840
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#3840
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/2071
Author: @rafatxf
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:pr/sm75-select-simt2📝 Commits (1)
7395d07sm_75: STRATA_SELECT_SIMT=2, the tiled FP32 block scorer with 32 x 128 tiles📊 Changes
2 files changed (+132 additions, -6 deletions)
View changed files
📝
src/kernels/cuda/qsa_select.cu(+119 -6)📝
src/kernels/qsa_select_bench.cpp(+13 -0)📄 Description
On Turing the prompt path's QSA block scores run the warp kernel (no TF32 tensor cores, so
qsa_block_scores_tcfalls back), and at long context they dominate the prompt.STRATA_PREFILL_TIMING=1on an RTX 2080 Ti, appending 16K tokens to a 390K conversation (--serve, conversation cache reused):STRATA_SELECT_SIMT=1This PR adds
STRATA_SELECT_SIMT=2:block_scores_simt_kernelwith 32 queries × 128 blocks per CTA (8 × 8 products per thread instead of 8 × 4) and the next K chunk's loads in registers while the current one is used. Every (row, block) dot is the samefmafchain over k = 0..127 and the same relu sum over the heads, so its scores are bitwise those of=1.qsa_select_benchgets an optional hash of the fast scorer's bytes (QSA_BENCH_HASH=1) to show it: the same hash for=1and=2at 131K, 262K, 400K and 510K.=2stays opt-in like=1. The second half of this description is the data I'd offer for turning SIMT on by default on sm_75 (your call, as withSTRATA_BF16_TC).Setup
RTX 2080 Ti 22 GB (sm_75, PCIe 3.0 x16), i7-6700, 56 GB DDR4-2133, CUDA 13.0, driver 595, SM clock locked at 1650 MHz, 240 W.
v0.1.43built from source with-DSTRATA_BUILD_TESTS=ON. Model Q2_0,--resident-experts,--spec 4 --spec-min-p 0.7,--max-context 524288(YaRN ×2),--kv int8 --kv-resident 32768.Scorer:
qsa_select_bench CTX 256 5 524288Selections against the warp kernel: 256/256 identical at 262K, 400K and 510K, 255/256 at 131K (0.0002 % of cells). Accuracy against FP64: max error 5.8e-5 vs the warp kernel's 2.1e-5 (2.3e-7 of the score scale).
Engine, one-shot,
STRATA_SELECT_SIMT0 vs 2Prompt read, same binary, real text (the 256K token file of the benches):
Decode does not change: it scores with
block_scores_multi_kernel, which this does not touch.Quality: teacher-forced, the two paths against each other
The method from #655 (docs/UNSLOTH_Q4.md): a
--serveengine with--adapt-every 100000, the first P tokens read by the prompt path (the path this changes) as one request, then the next 2,048 tokens resumed at P through the verify windows with--short-read,STRATA_LOGPOSwithSTRATA_LOGPOS_TOPK=20writing every position. Raw text (Don Quixote, Spanish).STRATA_BF16_TCin #655 (0.0085-0.011) and below the 0.02-0.05 that DETAILS.md lists for other prompt-path changes.STRATA_DUMP_FIRST_LOGITS, full vocabulary): KL 7.5e-4 / 9.6e-3 / 7.3e-6 / 2.9e-4; the same argmax in 3 of 4 (at 98K the two candidates were a near-tie, and SIMT gave the real next token the higher probability)./v1/chat/completions, thinking off).The server here runs 0.1.43 with this patch and
STRATA_SELECT_SIMT=2since 2026-10-12.Tests
qsa_parity: 0 failures.qsa_select_benchwithQSA_BENCH_HASH=1: the same hash for=1and=2at every context above.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.