[PR #343] [CLOSED] Don't pursue: BF16 decode GEMV via Turing tensor cores (sm_75) - measured negative #2587

Closed
opened 2026-11-04 02:01:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/343
Author: @hireymage
Created: 10/1/2026
Status: ❌ Closed

Base: main ← Head: tc-gemv-sm75-bench


📝 Commits (1)

  • 8c851bd bench: BF16 GEMV via Turing tensor cores on sm_75 - measured negative

📊 Changes

2 files changed (+362 additions, -0 deletions)

View changed files

➕ bench/results/2026-09-30-tc-gemv-sm75/README.md (+57 -0)
➕ bench/results/2026-09-30-tc-gemv-sm75/bench_tc_gemv.cu (+305 -0)

📄 Description

Don't pursue: BF16 decode GEMV via Turing tensor cores (sm_75) — measured negative

Question: the QSA prompt attention rides the Turing tensor cores (#270-style mma.sync.m16n8k8); can the decode GEMVs (bf16_gemv.cu) do the same?

This PR adds an isolated benchmark comparing the production warp kernel against the tensor-core path on the real decode shapes (n_in = 2560, BF16 weights), with three TC variants covering the conversion cost from every angle (W preconverted once / in-register / fused no-reduce form) and a full k-split occupancy sweep for the TC side. No inference-path changes.

Result: the TC variant loses on every real shape, 1.3–2.2×, even at its best config — after conversion overhead:

Shape Baseline µs Best TC µs Speedup
ssm_alpha/beta [2560,48] 8.73 11.32 0.77×
indexer.k_proj [2560,128] 7.14 12.09 0.59×
q_proj/router [2560,512] 9.48 15.78 0.60×
ple_value [2560,2560] 35.08 77.73 0.45×

Parity passes (max err vs fp64 ref at fp16-accumulation level, 1.7e-6–7.2e-6; BF16→FP16 conversion exact, 0/2,000,000). The warp kernel is already bandwidth-bound at 374 GB/s; the TC path reaches only ~169 GB/s and a single-token GEMV throws away 15/16 of the m16 MMA tile.

Measured on i7-8700K + RTX 2070 8 GB (sm_75, 36 SMs), engine 0.1.27 tree (bf16_gemv.cu unchanged through 0.1.30), qwen3.8-flash-next ~125.7B MoE Q2_0 in production. Conclusions: keep the warp kernel; the benchmark is checked in so nobody has to measure this twice and can rerun it on future hardware (native bf16, denser GEMV batching). Details and rerun instructions in bench/results/2026-09-30-tc-gemv-sm75/README.md.

Limit: latency from back-to-back CUDA-event timing (no ncu profile); production engine ran concurrently on the same GPU.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/343 **Author:** [@hireymage](https://github.com/hireymage) **Created:** 10/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `tc-gemv-sm75-bench` --- ### 📝 Commits (1) - [`8c851bd`](https://github.com/Niko1221/Strata/commit/8c851bddd47ed7cac189f5e1a8ae98d9679b603a) bench: BF16 GEMV via Turing tensor cores on sm_75 - measured negative ### 📊 Changes **2 files changed** (+362 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `bench/results/2026-09-30-tc-gemv-sm75/README.md` (+57 -0) ➕ `bench/results/2026-09-30-tc-gemv-sm75/bench_tc_gemv.cu` (+305 -0) </details> ### 📄 Description **Don't pursue: BF16 decode GEMV via Turing tensor cores (sm_75) — measured negative** Question: the QSA prompt attention rides the Turing tensor cores (#270-style `mma.sync.m16n8k8`); can the decode GEMVs (`bf16_gemv.cu`) do the same? This PR adds an isolated benchmark comparing the production warp kernel against the tensor-core path on the real decode shapes (n_in = 2560, BF16 weights), with three TC variants covering the conversion cost from every angle (W preconverted once / in-register / fused no-reduce form) and a full k-split occupancy sweep for the TC side. No inference-path changes. **Result: the TC variant loses on every real shape, 1.3–2.2×, even at its best config** — after conversion overhead: | Shape | Baseline µs | Best TC µs | Speedup | | --- | ---: | ---: | ---: | | ssm_alpha/beta [2560,48] | 8.73 | 11.32 | 0.77× | | indexer.k_proj [2560,128] | 7.14 | 12.09 | 0.59× | | q_proj/router [2560,512] | 9.48 | 15.78 | 0.60× | | ple_value [2560,2560] | 35.08 | 77.73 | 0.45× | Parity passes (max err vs fp64 ref at fp16-accumulation level, 1.7e-6–7.2e-6; BF16→FP16 conversion exact, 0/2,000,000). The warp kernel is already bandwidth-bound at 374 GB/s; the TC path reaches only ~169 GB/s and a single-token GEMV throws away 15/16 of the m16 MMA tile. Measured on i7-8700K + RTX 2070 8 GB (sm_75, 36 SMs), engine 0.1.27 tree (`bf16_gemv.cu` unchanged through 0.1.30), qwen3.8-flash-next ~125.7B MoE Q2_0 in production. **Conclusions: keep the warp kernel; the benchmark is checked in so nobody has to measure this twice** and can rerun it on future hardware (native bf16, denser GEMV batching). Details and rerun instructions in `bench/results/2026-09-30-tc-gemv-sm75/README.md`. Limit: latency from back-to-back CUDA-event timing (no ncu profile); production engine ran concurrently on the same GPU. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:01:34 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2587
No description provided.