[PR #270] [CLOSED] qsa_prompt_attn: run the f16 tensor-core path on Turing (sm_75) #2538

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/270
Author: @kenh0u
Created: 9/30/2026
Status: ❌ Closed

Base: main ← Head: sm75-tensor-cores


📝 Commits (1)

  • 3d3939d qsa_prompt_attn: the f16 tensor-core path runs on Turing (sm_75) as two m16n8k8 steps

📊 Changes

1 file changed (+25 additions, -7 deletions)

View changed files

📝 src/kernels/cuda/qsa_prompt_attn.cu (+25 -7)

📄 Description

What this does

mma.m16n8k16 (f16) needs sm_80, so main compiles the tensor-core prompt attention to a trap on sm_75 and those cards run the fp32-FMA kernel — the gap #87 left in ("the sm_80 guard on the tensor-core prompt attention"). Turing (sm_75) has mma.m16n8k8 with the same A/B/C register mapping, so each k=16 step becomes two k=8 steps on the fragments exactly as they are already laid out (a[0]/a[1] with b[0], a[2]/a[3] with b[1]). The sum rounds twice, so the two paths do not agree bit for bit. Turing therefore takes the v1 kernel, which has no cp.async dependency.

Measured (Quadro RTX 8000, CUDA 12.9, arch 75)

  • qsa_prompt_attn_parity (-DCMAKE_CUDA_ARCHITECTURES=75): PASS, FAILURES: 0; vs FP64 new 6.99e-06, old 2.37e-06 (output scale 3.62); int8 kernel 62.3 → 19.6 ms per chunk (3.19x), fp16 65.0 → 25.1 ms (2.59x)
  • Engine, three Turing cards (RTX 8000 + 2× RTX 6000), on 0.1.29 main: 9.7K-token prompt 1,050 → 1,177 tok/s, 41.7K 1,124 → 1,251 tok/s; an 80K needle test answers correctly
  • Single-card relevance: #139's thread measured main 0.1.27 at PP 731-738 tok/s on one RTX 2080 Ti — this kernel is that card's prompt path too

AI tooling

Developed with Claude Code (GLM-5.3-Flash): implementation, sm_75 parity runs and the measurements above.


🔄 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/270 **Author:** [@kenh0u](https://github.com/kenh0u) **Created:** 9/30/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `sm75-tensor-cores` --- ### 📝 Commits (1) - [`3d3939d`](https://github.com/Niko1221/Strata/commit/3d3939dbe395bcad8197b81f5f319cc40302f889) qsa_prompt_attn: the f16 tensor-core path runs on Turing (sm_75) as two m16n8k8 steps ### 📊 Changes **1 file changed** (+25 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/kernels/cuda/qsa_prompt_attn.cu` (+25 -7) </details> ### 📄 Description ## What this does `mma.m16n8k16` (f16) needs sm_80, so main compiles the tensor-core prompt attention to a trap on sm_75 and those cards run the fp32-FMA kernel — the gap #87 left in ("the sm_80 guard on the tensor-core prompt attention"). Turing (sm_75) has `mma.m16n8k8` with the **same A/B/C register mapping**, so each k=16 step becomes two k=8 steps on the fragments exactly as they are already laid out (a[0]/a[1] with b[0], a[2]/a[3] with b[1]). The sum rounds twice, so the two paths do not agree bit for bit. Turing therefore takes the v1 kernel, which has no cp.async dependency. ## Measured (Quadro RTX 8000, CUDA 12.9, arch 75) - `qsa_prompt_attn_parity` (`-DCMAKE_CUDA_ARCHITECTURES=75`): **PASS, FAILURES: 0**; vs FP64 new 6.99e-06, old 2.37e-06 (output scale 3.62); int8 kernel 62.3 → 19.6 ms per chunk (**3.19x**), fp16 65.0 → 25.1 ms (2.59x) - Engine, three Turing cards (RTX 8000 + 2× RTX 6000), on 0.1.29 main: 9.7K-token prompt **1,050 → 1,177 tok/s**, 41.7K **1,124 → 1,251 tok/s**; an 80K needle test answers correctly - Single-card relevance: #139's thread measured main 0.1.27 at PP 731-738 tok/s on one RTX 2080 Ti — this kernel is that card's prompt path too ## AI tooling Developed with Claude Code (GLM-5.3-Flash): implementation, sm_75 parity runs and the measurements above. --- <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:07 +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#2538
No description provided.