Commit 4d378f0
debug(kv): TQ_KV_PROBE — per-layer KV quantization sanity at sampled positions
Extends the existing pos=0/L0 KV debug dump into a sampled probe across
layers × positions 0/25/50/100/200. Gated by TQ_KV_PROBE=1.
Purpose: apply the refparity methodology (that surfaced the BPE and MoE
silent-quality bugs earlier this session) to the project's killer-feature
claim — turbo_kv_4b = 7× compression at +0% PPL.
Measurement on Llama-3.2-1B Q8_0 + turbo_kv_4b KV, 200-token narrative:
cosine range across all 16 layers × 4 positions: 0.994 - 0.997
MSE range: 0.018 - 0.087
no drift over position (pos=200 ≈ pos=25)
no outlier layer (L6/L9 slightly higher MSE, correlates with their
natural K rms — not a bug)
Unlike BPE and MoE (silent bugs this session), KV compression passes
the per-layer sanity check cleanly. The project's 7×/+0% PPL claim is
structurally sound — not just aggregate-metric validated.
Next: extend probe to Qwen3.x (larger head_dim, IMRoPE) and to the
delta-compression P-frame path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 52e78cb commit 4d378f0
3 files changed
Lines changed: 55 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
6 | 40 | | |
7 | 41 | | |
8 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1825 | 1825 | | |
1826 | 1826 | | |
1827 | 1827 | | |
1828 | | - | |
1829 | | - | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
1830 | 1842 | | |
1831 | 1843 | | |
1832 | 1844 | | |
1833 | 1845 | | |
1834 | 1846 | | |
1835 | 1847 | | |
1836 | | - | |
1837 | 1848 | | |
1838 | 1849 | | |
1839 | 1850 | | |
1840 | | - | |
1841 | | - | |
1842 | | - | |
1843 | | - | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
1844 | 1857 | | |
1845 | 1858 | | |
1846 | 1859 | | |
| |||
0 commit comments