mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2091] [CLOSED] sm_75: the hyper-connection's xn16 written as the FP16 its tensor-core GEMMs read (bitwise, prompt +3 %) #3857
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#3857
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/2091
Author: @rafatxf
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:pr/sm75-xn-f16📝 Commits (1)
ba2a8ffsm_75: the hyper-connection xn16 written as the FP16 its tensor-core GEMMs read (bitwise)📊 Changes
5 files changed (+84 additions, -34 deletions)
View changed files
📝
include/strata/prefill/gemm.hpp(+5 -1)📝
include/strata/prefill/kernels.hpp(+4 -4)📝
src/prefill/gemm.cu(+34 -3)📝
src/prefill/kernels.cu(+25 -16)📝
src/prefill/prefill.cpp(+16 -10)📄 Description
The follow-up I mentioned in #655. With
STRATA_BF16_TC=1the prompt path convertsxn16(T × 10240) from BF16 to FP16 before each of its two GEMMs (the down and inject projections), in 16M-element slices: on a 130K prompt read that was ~2.8 s ofbf16_to_f16_kernel(nsys), 3.2 % of the read.Now the four
xn16writers (gr_norm,gr_norm_rs,gr_write_norm_rs,gr_write_cvec_norm_rs) can storegemm.cu's conversion of the BF16 value directly (bf_to_hf_conv: the same clamp of finite values beyond ±65504 and the same rounding asbf16_to_f16_kernel), andGemm::bf16(..., x_f16)skips the conversion on the tensor-core path - the same slices, so the same GEMMs. Any other path (one output row, no room for the buffers) converts the image back to BF16 a slice at a time (exact: every value is a BF16 that fits FP16, or was clamped as the tensor-core path clamps it).It is on only where it changes nothing: the stage runs BF16 on FP16 tensor cores (
Gemm::bf16_converts_x()), without the BF16X2 low parts and with the unpaddedxn16stride; the MTP draft's own read keeps BF16.STRATA_XN_F16=0turns it off.Setup
RTX 2080 Ti 22 GB (sm_75), i7-6700, CUDA 13.0, driver 595, SM 1650 MHz, 240 W;
v0.1.43. Model Q2_0,--resident-experts,--max-context 524288,--kv int8 --kv-resident 32768,STRATA_BF16_TC=1.Results
STRATA_XN_F16=0=1First logits after the 98K prompt (
STRATA_DUMP_FIRST_LOGITS): bitwise identical. A 4K one-shot run writes the same tokens.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.