okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

albedocmake: strata_kernels links strata_kernels_cpu (iq_kernels.cu reads the latent colscale table from expert_layout.cpp; strata-q36ref failed to link)a4af4df61

main
2 files

files

README.md3.4 KiB
bench_tc_gemv.cu17.5 KiB

BF16 GEMV on Turing tensor cores (sm_75): measured negative

i7-8700K + RTX 2070 8 GB (sm_75, 36 SMs), engine 0.1.27 tree (bf16_gemv.cu is unchanged through 0.1.30), qwen3.8-flash-next (~125.7B MoE, GGUF-verified) Q2_0 in production. Isolated benchmark only - bench_tc_gemv.cu touches nothing in the inference path. Question: the QSA prompt attention already rides the Turing tensor cores (mma.sync.m16n8k8, the #270 path); can the decode GEMVs do the same?

Setup

Results (best TC config per shape)

Shape (decode, n_in = 2560, BF16 W)Baseline usBest TC usSpeedupConfig
ssm_alpha/beta [2560, 48]8.7311.320.77xpc, ks=16
indexer.k_proj [2560, 128]7.1412.090.59xpc, ks=16
indexer.q_proj / router [2560, 512]9.4815.780.60xpc, ks=4
ple_value [2560, 2560]35.0877.730.45xpc, ks=40

How to rerun

nvcc -arch=sm_75 -O3 -o bench_tc_gemv.exe bench_tc_gemv.cu
./bench_tc_gemv.exe

Prints the table above, per-shape latency/parity and the conversion exactness scan. On a newer card, adjust -arch; the packed-A layout comment in the source documents the fragment mapping it relies on.

Conclusion

Keep the warp kernel. Tensor cores are not a promising direction for the decode GEMVs on sm_75, and this was a measured loss (1.3-2.2x slower), not a failed attempt to optimize. The Turing MMA stays worthwhile where the input really has m16 rows of work: the QSA prompt-attention tiles, which is where #270 uses it. Someone looking to re-evaluate on future hardware (a card with native bf16 or denser GEMV batching) can rerun this instead of rebuilding it.