Skip to content

Commit 4806cc8

Browse files
TheTomclaude
andcommitted
docs: log simd_broadcast attempt — no speed improvement TheTom#23
Co-Authored-By: tturney@psyguard.ai Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8ab4031 commit 4806cc8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

docs/turbo-speed-investigation.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,17 @@ Target: D → 5-8 tok/s, then A/B → 20-40 tok/s.
112112
- Codex + roast reviewed WHT implementation: correct, no bugs
113113

114114
### Next: Start with Approach D (reduce per-call overhead)
115+
116+
### 2026-03-25: simd_broadcast attempt
117+
- Added simd_broadcast fast path for K and V dequant (nl_k==32 && DK==128)
118+
- Thread 0 dequantizes, broadcasts 128 floats via simd_broadcast loop
119+
- **Result: still 2.4 tok/s** — the 128-iteration simd_broadcast loop per cc iteration
120+
is itself expensive. 32 cc iterations × 128 broadcasts = 4096 simd_broadcast calls per block.
121+
- Codex review caught: DK>128 OOB bug (fixed), turbo4 using turbo3 dequant (fixed),
122+
uninitialized turbo_buf on non-lane-0 (fixed with zero-init)
123+
- **Conclusion**: simd_broadcast is wrong tool. Need threadgroup memory instead.
124+
125+
### Next: try threadgroup memory approach
126+
- Allocate extra threadgroup memory in FATTN_SMEM
127+
- One thread writes 128 floats to threadgroup, barrier, all threads read
128+
- This reduces to 1 dequant + 1 barrier per cc iteration instead of 128 broadcasts

0 commit comments

Comments
 (0)