Skip to content

Commit bb59def

Browse files
TheTomclaude
andcommitted
docs: upstream competitive intel — pre-rotate-queries is the key AtomicBot-ai#28
Key findings from Dejan.ai, unixsysdev, and mudler: 1. QJL naively added back destroys quality (cosine 0.69) 2. Pre-rotate queries eliminates rotation from dequant path 3. WHT abandoned by everyone — dense QR or no rotation preferred 4. unixsysdev gets -0.8% speed loss with fused CUDA kernel 5. We're the only Metal implementation Co-Authored-By: tturney@psyguard.ai Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f134363 commit bb59def

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

docs/turbo-speed-investigation.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,29 @@ Target: D → 5-8 tok/s, then A/B → 20-40 tok/s.
228228
| **Inlined WHT (proper Metal)** | **10.7** | **THE FIX — #include caused CPU fallback** |
229229

230230
Rule: NEVER use #include in ggml-metal.metal. Always inline.
231+
232+
### 2026-03-25: Upstream competitive intelligence — GAME CHANGERS
233+
234+
**Finding 1: QJL residual kills quality when naively re-added**
235+
Dejan.ai found cosine similarity drops to 0.69 with naive QJL add-back.
236+
Must use MSE-only for drop-in replacement, or fused kernel for QJL.
237+
238+
**Finding 2: Pre-rotate queries, not keys (THE BIG WIN)**
239+
`<q, R^T * c[idx]> = <R*q, c[idx]>`
240+
Rotate query ONCE, then dequant is just a centroid table lookup.
241+
No rotation in the hot dequant path. Would make turbo3 as fast as q4_0.
242+
243+
**Finding 3: WHT abandoned by everyone**
244+
Both Dejan.ai and mudler tried WHT, both switched to dense QR.
245+
But with pre-rotate-queries, rotation method doesn't matter.
246+
247+
**Finding 4: unixsysdev gets -0.8% speed loss (CUDA, block=32)**
248+
Pure polar coordinate encoding, no random rotation, fused kernel.
249+
250+
**Finding 5: We're the only Metal implementation**
251+
Everyone else is CPU-only or CUDA. Our Metal kernels are unique.
252+
253+
### Immediate action items:
254+
- [ ] Test MSE-only (no QJL) — simplify dequant, may improve quality + speed
255+
- [ ] Implement pre-rotate-queries — eliminates rotation from dequant entirely
256+
- [ ] Consider block size 32 for better GPU parallelism

0 commit comments

Comments
 (0)