mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #600] [CLOSED] qsa_prompt_attn: tensor-core kernel for Volta (sm_70, mma.m8n8k4) #2717
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#2717
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/600
Author: @fks
Created: 10/3/2026
Status: ❌ Closed
Base:
main← Head:feature/v100-prompt-attn-volta📝 Commits (4)
ee0843dqsa_prompt_attn: tensor-core kernel for Volta (sm_70, mma.m8n8k4)bb28e13docs: NVIDIA_V100.md and the measurements of the Volta prompt attentiondbb1a08bench: distribution check of the Volta prompt attention (teacher-forced KL, controls)eb7fe10docs: point the BF16 note at #540 (the BF16-via-FP16 PR #593 was closed in its favor)📊 Changes
4 files changed (+576 additions, -3 deletions)
View changed files
➕
bench/results/2026-10-03-v100-prompt-attn/README.md(+104 -0)➕
docs/NVIDIA_V100.md(+70 -0)📝
src/kernels/cuda/qsa_prompt_attn.cu(+390 -3)📝
src/kernels/qsa_prompt_attn_parity.cpp(+12 -0)📄 Description
On sm_70
qsa_prompt_attn_batchrefuses the device (#371), so the prompt path runs the QSA attention on the decode kernel, one query at a time with FP32 FMAs: 19.2% of the GPU time of a 28,650-token prompt on a V100 (nsys, 0.1.35,attn_chunk_kernel<1>).prompt_attn_v70_kernelis the v1 kernel's structure with the two matrix products onmma.sync.m8n8k4(FP16 in, FP32 accumulate): q.k with one 64-dim group (= one int8 scale group) per warp and 8 cells per quad-pair, p.v with 16 dims per quad-pair. q and p keep their hi + lo FP16 split, and the four dim groups' partials are added in a fixed order (deterministic). Int8, FP16 and K8V4 KV are handled; Q4_0 KV (mode 4, sm_80+ only) keeps the old kernel. The m8n8k4 fragment layout was measured on a V100 and agrees with turbomind'sSM70_MMA_884. It is used for compute capability 7.0 - 7.4;STRATA_PROMPT_ATTN_OLD=1is the old path.Accuracy (
qsa_prompt_attn_parity, synthetic, V100, 32K context, 2,048 queries per chunk, output scale ~3.6):The 1,500- and 2,100-token contexts also pass. The test now skips its Q4_0 cases below sm_80 instead of exiting 2 there (the dispatcher keeps the old kernel for them).
Prompt speed (one V100-PCIE-32GB, i9-7960X, CUDA 12.8,
origin/mainat99f3dbd, UnslothUD-IQ4_XS, int8 KV; cold server, random-word prompts, greedy; same binary,STRATA_PROMPT_ATTN_OLD=1against the default):Decode is unaffected (it does not use this path).
Output checks
tools/needle_bench.py, 8k / 32k / 128k at five depths, a fresh server per configuration): 15 of 15 found with the old path, 15 of 15 with the new kernel.Not covered: only the Unsloth IQ4_XS pack was run (not the GSQ-RCO quants); one request on one card. Method, profile and raw numbers:
bench/results/2026-10-03-v100-prompt-attn/; build and kernel overview:docs/NVIDIA_V100.md(both in this PR). Independent of the BF16-via-FP16 change in #540: different code files, and it stacks with it (a user measured +9% on top of #540)Written and measured with Claude Sonnet 5.5.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.