Commit Graph
79 Commits
Author SHA1 Message Date
af7bdf3d0c docs: complete cross-model rerun with ISWA fix + Gemma outlier log
Gemma 2: 3/3 NIAH all types (ISWA fix works), turbo4 slightly worse
than turbo3 (outlier, logged for investigation).
Llama 70B: confirmed 3/3 NIAH, PPL matches prior run.
Qwen MoE: sanity passed, known 8K/100% NIAH weakness confirmed.
Corrected Gemma PPL from 1-chunk estimate to proper 8-chunk values.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 19:15:10 -05:00
5eade98036 docs: full ISWA investigation story in cross-model-validation.md
Added complete investigation narrative: wrong initial hypothesis (hd256),
GGUF parsing, q4_0 comparison, FA elimination, 5 build_attn overloads,
root cause (missing WHT in ISWA overload), 16-line fix, PPL 13.7T → 3.80.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:57:26 -05:00
5bdd8b3737 docs: move ISWA discovery to cross-model-validation.md where it belongs
Resurrection doc is about turbo4 journey. ISWA discovery is a cross-model
testing finding. Added "Why Cross-Model Testing Matters" section to
cross-model-validation.md.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:53:51 -05:00
f2d56d60de docs: ISWA discovery story + cross-model testing methodology
Added Section 10 to resurrection doc: how cross-model smoke testing
caught the ISWA bug that single-model testing never would have found.
PPL 13.7 trillion → 3.80 on Gemma 2. Updated daily note with full
investigation timeline and cross-model results table.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:52:44 -05:00
3ce8c388e7 docs: cross-model complete — 7 models, Gemma FIXED, Llama 70B added
Gemma 2 ISWA fix: PPL 13.7T → 3.80 (missing WHT rotation in ISWA build_attn)
Llama 70B: turbo4 +8.3% (Q4_K_M weight+KV quant stacking)
All 7 models across 5 families tested. turbo4 consistently beats turbo3.
ISWA fix pushed to llama-cpp-turboquant fork.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:40:54 -05:00
46d4e75314 docs: Gemma 2 investigation — ISWA dual-cache likely root cause, not head_dim
Gemma 2 K/V head_dim IS 128 (not 256 as initially assumed). ISWA
(interleaved sliding window attention) creates dual KV caches.
q8_0 works fine. turbo3/turbo4 catastrophic. Likely ISWA interaction.
Quick bench parsing fixed. Llama 70B test pending.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:30:12 -05:00
398cadc9e8 docs: add QC precompute result (#16) + ILP root cause analysis
QC precompute: 10.10 tok/s at 8K (same as SMEM, -33% vs 4-mag).
Select() chains are catastrophically expensive on Apple8.

Key discovery: the 4-mag LUT works because of ILP — interleaving
constant reads with dot product ALU lets the GPU overlap memory
and compute. Separating phases (SMEM, deferred norm, QC precompute)
destroys this overlap and runs at 2x latency.

The remaining 38% gap cannot be closed by rearranging reads and ALU.
Requires block format change or fundamentally different computation.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:25:37 -05:00
bcbdda285c docs: add Q·centroid precompute section to SMEM experiment doc
Document approach #16 (QC precompute) — precompute mag[c]*Q[j] table
before K loop, trades 128 constant reads for 4 + branch overhead.
Awaiting benchmark results after 7pm.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:14:41 -05:00
e6fea6e363 docs: SMEM pre-dequant experiment — negative result (#15)
Threadgroup memory pre-dequant tested on M2 Pro: -51% at 8K context.
SMEM store/load overhead exceeds constant cache savings when each
dequanted value is used exactly once by its producer thread.

4-mag LUT remains the dequant-level ceiling (62% of no-dequant ceiling).

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:09:07 -05:00
5ec5939750 docs: Mixtral skipped (bad GGUF), Llama 70B running
Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:04:33 -05:00
e0aca7f521 docs: cross-model validation — 5 models tested, hd256 broken
hd128 models all work: Qwen MoE/Dense, Phi-4, Mistral Small.
turbo4 consistently closer to q8_0 than turbo3.
Gemma 2 27B (hd256): PPL catastrophe (13 trillion). Known limitation.
Mixtral 8x7B and Llama 70B pending.
Quick bench parsing fixes committed.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:59:58 -05:00
f553183bf7 docs: add KLD nuance to resurrection — q4_0 lower despite worse PPL
Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:49:21 -05:00
d4704f07b7 docs: NIAH 8K/100% investigation — quantization-related, not model
f16 passes 8K/100%, q8_0 and turbo4 both fail. Shared failure is
quantization noise on recently-written KV entries at end of context.
turbo4 recovers at 16K while q8_0 doesn't.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:24:31 -05:00
2b7b02824f docs: fix stale data in README + resurrection doc
README: turbo4 description updated to 4-bit PolarQuant, NIAH to v2
(31/33), contributing turbo4 entry updated, cache type table fixed.

Resurrection: decode 79.58→79.87, branch status updated to merged,
added NIAH v2/KLD/dense/PDF results to summary.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:14:13 -05:00
dde9cbda7d docs: q8_0 NIAH v2 — 30/33 (90.9%), turbo4 beats q8_0 (31/33)
q8_0 fails at 16K/30%, 8K/100%, 16K/100%.
turbo4 fails at 4K/0%, 8K/100%.
Shared failure at 8K/100% = model weakness, not quantization.
turbo4 has better retrieval than q8_0 baseline.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:03:25 -05:00
2a3ce88ad9 docs: NIAH v2 turbo4 — 31/33 (93.9%), consistent edge failures
Expanded from 9 to 33 tests (11 depths × 3 contexts).
Two consistent failures: 4K/0% and 8K/100% (same in both runs).
All other positions pass. 93.9% aggregate.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 14:50:26 -05:00
9cd29881df docs: add dense q8_0 PPL baseline (6.8884) for turbo4 comparison
Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 14:41:53 -05:00
74c12f2eb8 docs: dense turbo4 results — matches q8_0 decode, no regression
Dense 27B: turbo4 17.25 tok/s vs q8_0 17.17 (1.00x).
PPL 6.9378. Faster than turbo3 dense (16.73).
NIAH v2 with expanded depth sweep running.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 14:40:18 -05:00
661bc7fb47 docs: turbo4 full characterization — PPL, prefill, decode, NIAH, KLD, PDF
Complete turbo4 4-bit PolarQuant benchmark suite:
- PPL: +0.23% vs q8_0 (best after q8_0, better than q4_0)
- Prefill: 101-105% of q8_0 across 2K-32K
- Decode: 79.87 tok/s (93% q8_0, faster than turbo3)
- NIAH: 7/9 (matches q8_0)
- KLD: 0.0096 (40% lower than turbo3, matches q4_0 same-top-p)
- PDF 24K: 63.7 tok/s decode (20% faster than turbo3)

Also includes turbo4-resurrection.md paper documenting the full journey
from PPL 679 to beating q4_0 quality.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 14:19:35 -05:00
c55ea45a26 docs: q4_0 coverage gaps closed — full matrix complete
Multi-context PPL (8K/16K/32K): all 0.0000 delta ON/OFF
Prefill speed: matches q8_0 across all context lengths
Dense model: neutral (within noise)

Coverage matrix now complete for all 3 formats (q8_0, q4_0, turbo3)
across all test suite categories.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 00:24:49 -05:00
cb4f8e5369 docs: final polish + test suite formalized
Paper: abstract includes q4_0, conclusion softened, remove redundancy in 7.5
README: "up to +22.8%", prefill column label, fix duplicate Contributing nums
Test suite: formalize ad-hoc experiments (skip rate, server bench, failed exps)

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 23:48:59 -05:00
550798ae14 docs: paper final precision pass — scope claims, sharpen framing
- Abstract: "in certain tasks", minimal kernel modification
- Intro: standalone hook sentence
- Method: drop "3 lines" specificity
- Section 4.3: add detection power statement (0.6% threshold)
- NIAH: "potential secondary effect" instead of "second contribution"
- Section 7.5: tighter invariance statement
- Conclusion: "across all tested metrics and formats"

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 23:36:37 -05:00
5e162be4c6 docs: q4_0 full validation + cross-format summary
q4_0 tested across PPL, NIAH, decode — all neutral (0.0000 PPL delta,
identical NIAH, decode within noise). Added Section 7.4 (q4_0) and
Section 7.5 (cross-format summary) to paper. Updated conclusion with
format-independence finding.

Three formats validated: q8_0, q4_0, turbo3. No measurable impact on
any metric in any format. Attention-weight magnitude is a reliable proxy
for computational relevance, independent of KV representation.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 23:21:45 -05:00
a3f4f0887c docs: add q4_0 baseline to 50-chunk 32K validation
q4_0 (7.0857) included as reference baseline alongside q8_0 (7.0638).
turbo3 (7.1796) uses fewer bits (3.5 vs 4.0), slightly higher PPL expected.
Sparse V delta still 0.0000. q4_0 note: no optimization applied, included
for comparison only.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 21:35:48 -05:00
817900cfc9 docs: 50-chunk wikitext-103 validation — strongest sparse V evidence
32K context, 50 chunks, CI ±0.021:
  q8_0 baseline: 7.0638
  turbo3 WITHOUT sparse V: 7.1796
  turbo3 WITH sparse V: 7.1796
  Sparse V delta: 0.0000

10x statistical power vs prior wikitext-2 runs. Updated paper Section 4.3,
long-context validation doc, and quality benchmarks. All raw logs saved
with exact commands, methodology, and corpus details.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:53:14 -05:00
59efd5eddb docs: full long-context validation — direct skip rate + stronger PPL
- Direct skip-rate measurement via output_attentions (9% at 512 → 28% at 4K)
- PPL validation with q8_0 baselines: 8K/20ch, 16K/10ch, 32K/5ch
- ON/OFF delta 0.0000 at all context lengths on clean branch
- turbo3 +1.1-1.4% vs q8_0, consistent and unaffected by sparse V
- Note: PR #4 was reverted (broke turbo3 PPL 6.18 → 181.6)

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:26:29 -05:00
863d23f88d docs: clarify quality claims and evaluation scope
Long-context PPL validation (512-32K) shows numerically identical results
with and without sparse V. Scoped all claims to "in this setup", replaced
absolute language with measured observations.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:47:39 -05:00
97b071c594 docs: long-context sparse V validation — zero PPL delta through 32K
Bit-for-bit identical PPL at 512, 8K, 16K, 32K with/without sparse V
on both MoE and dense. Even at 32K (~90% skip rate), no quality impact.
Includes skip-rate estimates, methodology notes, and raw commands.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:36:35 -05:00
b7537e5b4f docs: f16 sparse V experiment — not worth it, reverted
f16 path too cheap for branch to pay off. -0.3% short, +1.3% long.
Logged and closed.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:13:35 -05:00
cb55e1c145 docs: tile-level V skip experiment — not worth it, reverted
MoE +0.6-0.9%, dense -0.8-1.1%. Tile max scan overhead exceeds savings.
Per-position sparse V remains the optimal approach.
Logged results and closed in optimization tracker.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:59:42 -05:00
382872b3a5 docs: soften KLD comparison wording
Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:30:07 -05:00
fb0aaae532 docs: KL divergence benchmarks — MoE and dense, 3 cache types each
MoE turbo3: KLD 0.016, 94.3% same top-p (2x q4_0, expected at 3.5 bits)
Dense turbo3: KLD 0.010, 96.0% same top-p
Added Section 4.4 to paper, filled quality-benchmarks.md tables,
created kl-divergence-results.md with full analysis.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:29:07 -05:00
03a2f3d69f docs: dense 27B validation — no regression, safe default
Sparse V on dense: +0.7% short, +1.3% 8K, +1.8% 16K. No downside.
Earlier -5.4% was system noise from stale processes (A/B/A confirmed).
Added Section 7.3 to paper + dense decode table to README.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:19:21 -05:00
b81f0a4b44 docs: last two — clarity fix in 4.6, confident tone in conclusion
Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:20:27 -05:00
5ef73c7d6e docs: final cleanup — kill redundancy, tighten tone, ship it
5 edits: merge duplicate generality sentences, tighten q8_0 wording,
collapse repeated SNR claim, remove bloggy italics, simple→straightforward.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:17:54 -05:00
6678911077 docs: final surgical edits — zero-cost framing, noise removal, q8_0 punch
6 precise changes: zero-cost optimization block, attention-gated shift
in abstract, SNR denoising claim, q8_0 as mechanism property, drop
"first instance" claim, tighter conclusion contrast.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:16:27 -05:00
450deaaad6 docs: six surgical edits — sharpen framing, no new content
1. Section 7.1: generality as attention mechanism property
2. Section 3.3: explicit no-retraining/no-calibration block
3. Section 4.6: tighter server vs benchmark framing
4. Section 4.7: threshold as redundancy boundary
5. Section 9: attention-aware class without overclaim
6. Section 6: eliminate vs optimize contrast

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:14:56 -05:00
a5472c3514 docs: targeted framing updates — attention-gated computation throughline
Abstract: generality driven by attention distribution, not dequant mechanism
Section 1: explicit shift from instruction-level to operation elimination
Section 6: attention-aware computation paragraph
Section 7: strengthened opening reasoning
Section 9: broader implication grounded as observation, not overclaim

No new experiments, tables, or references.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:07:45 -05:00
730b32fdf1 docs: final polish — fix section numbering, sharpen generality and conclusion
- Fix 7.2 misplaced under Section 8
- Generality: explicit reasoning (attention distribution, not dequant mechanism)
- Conclusion: sharper contrast (eliminating vs optimizing under constraints)
- Closing line: broader implication for long-context inference

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:03:46 -05:00
fcdc6e4abf docs: M2 Pro 4-mag + sparse V confirmed stacking — 0.45x → 0.73x
Combined K+V dequant optimizations on M2 Pro: 62% improvement from
unoptimized baseline. Prefill blended at 90% of q8_0. Moved from
future work to results in paper Section 7.2.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:01:48 -05:00
287a9b0914 docs: q8_0 sparse V quality validation — PPL and NIAH identical
PPL 6.1109 both ways. NIAH 7/9 both ways (same failures).
Sparse V is a pure compute win on q8_0: +5% decode, zero quality impact.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 07:56:24 -05:00
80ab3ded47 docs: sparse V validated on q8_0 — +5% decode, confirms generality
q8_0 with sparse V: 80.7 → 84.7 tok/s (+5.0%) on M5 Max.
Not TurboQuant-specific — any quantized KV cache benefits.
Added TURBO_SPARSE_V=0 disable override for A/B testing.
Raw logs included.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 07:48:10 -05:00
4199b6a87e docs: add link to full hardware analysis from Section 5
Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 07:24:00 -05:00
9bf10999e1 style: remove em dashes from sparse V paper, clean up punctuation
Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 07:22:14 -05:00
37772c27d8 docs: link threshold ablation logs from sparse V paper
Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 07:10:50 -05:00
1bc380b5c1 docs: threshold ablation sweep (τ=1e-4 to 1e-8) for sparse V paper
PPL identical across all 5 thresholds. Short-context decode within noise.
Confirms τ=1e-6 is safe with significant headroom to be more aggressive.
Raw benchmark logs included.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 07:07:07 -05:00
ef05f7dd2a docs: add real-world server benchmark to sparse V paper
70-page PDF via llama-server: 0.78x q8_0 decode at 24K context.
Documents the gap between synthetic bench (0.93x) and real server workloads.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 01:51:06 -05:00
fe7009aa0d Add technical report: Attention-Gated Value Dequantization
3-line sparse V dequant yields +22.8% decode at 32K with zero quality
loss. NIAH 9/9 (100%), PPL identical. Documents 14 failed dequant
approaches and why sparse V succeeds where they don't.

Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 00:33:40 -05:00
dd73976a03 docs: M5 long-context discovery — turbo3 ceiling 28% faster than q8_0 at 32K
LUT cost grows from 20% to 34% on M5 as context increases.
4-mag helps at 16K (+2.4%) but not 32K (-7.3%).
Context-adaptive dispatch planned.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: tturney@psyguard.ai
2026-03-27 00:11:44 -05:00
b0b9619ce3 docs: final 14-approach experiment log — complete decode optimization research
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: tturney@psyguard.ai
2026-03-26 23:36:51 -05:00