mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1095] [CLOSED] kv_q8: the gather decodes 8 int8 per thread (V100 experimental build, +11%) #3019
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#3019
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/1095
Author: @ATIVX928
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:v100/kv-q8-gather-v2📝 Commits (2)
51402feaudit: where the int8 KV read decodes, and whether it is vectorizedaf52a5ekv_q8: the gather decodes 8 int8 per thread (bitwise, +11% on the 32k microbench)📊 Changes
3 files changed (+184 additions, -2 deletions)
View changed files
➕
bench/results/2026-10-03-v100-kv-int8-read/README.md(+51 -0)📝
src/kernels/cuda/kv_q8.cu(+83 -1)📝
src/kernels/kv_q8_parity.cpp(+50 -1)📄 Description
What
The int8 KV gather (
kv_gather_q8_kernel, used by the 32K prompt path) decodes four int8 codes per thread. This decodes eight, withuint2/uint4loads and stores, and falls back to the four-wide path when the alignment does not allow the wider access. It is the int8-gather piece of the V100 work in #627, split out on its own.Gating
The wide kernel is compiled only under
-DSTRATA_EXPERIMENTAL_SM60=ONand only launched on a device below cc 7.5 (pre75_q8_gather()), withSTRATA_Q8_GATHER_WIDE=0as the A/B arm. The ready-made engine compiles the original kernel; as a check, the non-experimental object's SASS sha256 is identical to main's (a4af40d8…, 54376 bytes).Measured
V100-SXM2-16GB, CUDA 12.8,
kv_q8_parity --bench, 2,051 selected cells at 32K:+11.3% on the gather kernel.
32K end-to-end
2x V100-SXM2-16GB, 32,504-token prompt, int8 KV, MTP spec 4, expert-cache auto, prompt cache off; median of 5 rounds after a warm-up. Single-card prefill 1550.4 tok/s and dual-card 2203.0 vs main's 1557.1 / 2207.0 - within the +-1% session noise. The gather is a few tens of microseconds of a 21-second prefill, so the +11.3% stays a kernel-level gain.
Tests
kv_q8_parityPASS (worst INT8-vs-FP16 error 0.59 quantization steps), both the wide default andSTRATA_Q8_GATHER_WIDE=0.Notes
bench/results/2026-10-03-v100-kv-int8-read/README.mdrecords the measurement and the footprint/bandwidth comparison of int8 vs q4_0 vs k8v4.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.