mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#3881
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/2146
Author: @rafatxf
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:pr/sm75-prompt-attn-1stage📝 Commits (3)
945c83dsm_75: the v2 int8 prompt attention with register staging instead of cp.async (STRATA_PA_V2T=1)05f7010sm_75: v2 prompt attention in one stage, three blocks per SM (bitwise)7138c1etests: pa_bench (the prompt attention on a recorded selection); STRATA_QSA_DUMP_LAYER / _STEPS📊 Changes
4 files changed (+202 additions, -10 deletions)
View changed files
📝
CMakeLists.txt(+5 -0)📝
src/kernels/cuda/qsa_prompt_attn.cu(+77 -8)📝
src/prefill/prefill.cpp(+10 -2)➕
tests/cuda/pa_bench.cpp(+110 -0)📄 Description
Stacked on #2092 (the Turing v2 prompt attention,
STRATA_PA_V2T=1): its first commit is #2092's.With register staging, #2092's v2 keeps the next chunk's K/V pieces in registers until the current chunk's p·v is done, so its second shared-memory stage buys nothing on Turing - but
Smem2is 45.6 KB and a Turing SM has 64 KB: one 4-warp block per SM, one warp per scheduler, every latency exposed. ncu on a 130K chunk: 12.5 % warps active, the tensor pipe at 8 %.Below sm_80 the kernel now takes
Smem2T: one K/V stage, and no separate q·k partials (part, 8.4 KB). The partials of cell groupnt(8 cells, 16 rows) are exactly 512 bytes, and the cells they come from occupy bytes[512 nt, 512 nt + 512)of the warp's own K slice (the swizzle stays inside a cell's 64 bytes), read by then - so after a__syncwarpeach group's partials overwrite its own cells. The softmax reads them across warps after the same__syncthreadsas before, and the next chunk'sstore_stagecomes after the second one, as before. 19.7 KB a block: three per SM (168 registers fit three). Same arithmetic, same order: the same bits.The second commit adds
tests/cuda/pa_bench.cpp, which replays a recorded selection (STRATA_QSA_DUMPgetsSTRATA_QSA_DUMP_LAYER=iandSTRATA_QSA_DUMP_STEPS=1), random q and int8 K/V, and prints the median time and an output hash.Setup
RTX 2080 Ti 22 GB (sm_75), i7-6700, CUDA 13.0, SM 1650 MHz, 240 W;
v0.1.43+ #2092. Q2_0,--prefill auto:16384,STRATA_PA_V2T=1.pa_bench(QSA layer 5, last chunk of a 130,559-token prompt: 15,871 queries × 2,051 cells)2541296d11c7be6f2541296d11c7be6fEngine
(with the fused experts of #2145 on; the generated text is the same.) Deep, served (
--serve, 512K context): 389,560 tokens from scratch 255.0 → 223.6 s and +16K at 406K 12.82 → 11.42 s together with the fused experts; needle 2/2 at 352,660 tokens.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.