mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1720] [CLOSED] dequant: coalesced Q8_0 path (four threads per block, 16-byte stores), bit-identical, 7x faster on V100 #3630
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#3630
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/1720
Author: @eelgaev
Created: 10/9/2026
Status: ❌ Closed
Base:
main← Head:dequant-q8-0-coalesced📝 Commits (1)
17a16c6dequant: coalesced Q8_0 path (four threads per block, 16-byte stores)📊 Changes
1 file changed (+32 additions, -0 deletions)
View changed files
📝
src/kernels/cuda/dequant_bf16.cu(+32 -0)📄 Description
The prompt path dequantizes each dense Q8_0 projection (GDN qkv/gate/out, QSA q/k/v/out, shared expert, hc) into the GEMM scratch before cuBLAS.
dequant_kernelruns one thread per 32-value block, so a warp's 2-byte stores land 64 bytes apart: about 70 GB/s of writes on a V100.dequant_q8_0_kernelgives each block to four threads, 8 values each, written with 16-byte stores: a warp reads 8 consecutive blocks and writes 512 consecutive bytes. The arithmetic per value is unchanged (d * q), so the output is the same bits. It is used for Q8_0 only when the output rows are contiguous (ld == cols) and the pointers are aligned (blocks to 2 bytes, output to 16); everything else (including the paddedldscratch) takesdequant_kernelas before. One file, 32 lines added, nothing else changed.Bitwise
Every 2-D Q8_0 tensor of Qwen3.8-Flash-Next UD-Q4_K_XL (498 tensors) through
dequant_f32,dequant_bf16anddequant_f16, built frommain(fb58e0d) and from this branch: an FNV-1a hash over all outputs is equal for all three output types.dequant_bf16_testcovers Q8_0 against the CPU reference as before.Speed (V100-SXM2-16GB, each call timed on its own)
Whole prompts on 4x V100, 4,096-token chunks (where this was first used): 18K 4,537 -> 4,708, 65K 6,540 -> 6,766, 123K 6,783 -> 6,985 tok/s (+3-4%). The kernel is plain CUDA (no architecture-specific instructions), so newer cards take the same path.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.