Commit 4b6019e
debug(kv): refined probe — hybrid arch limitation surfaced (not a production bug)
Extended R32 TQ_KV_PROBE to Qwen3 family. Findings:
Llama-3.2-1B non-hybrid: cos 0.994-0.997, MSE 0.02-0.09, 0/64 NaN
Qwen3-0.6B non-hybrid: cos 0.995-0.997, MSE 0.02-4.4, 0/128 NaN
Qwen3.5-4B DeltaNet+attn: inf/NaN, 6/256 NaN lanes
Qwen3.6-35B MoE+DeltaNet: inf/NaN, 6/256 NaN lanes
On hybrid arch the probe's full-dequant roundtrip produces NaN in ~5%
of lanes due to Hadamard-inverse × codebook edge case for small-rms
post-norm keys. Input verified finite (nan_in=0).
Production unaffected: attention on hybrid uses tq_turbo_kv_4b_attention_ref
(rotated-space dot, no full dequant). Probe measured the wrong path.
Methodology lesson: refparity's value is comparing the SAME code path
vs a reference. Probe chose a code path production doesn't use → false
positive on hybrid. Documented in env_vars.md; next-round fix is a
production-path-matching probe (query @ dequant(K) vs attention_ref).
Refined probe to recompute stats excluding NaN lanes so the signal
remains useful. Llama cos now cleanly 0.995+, 0/64 NaN (confirms R32).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 4d378f0 commit 4b6019e
3 files changed
Lines changed: 61 additions & 4 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 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
6 | 44 | | |
7 | 45 | | |
8 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1850 | 1850 | | |
1851 | 1851 | | |
1852 | 1852 | | |
1853 | | - | |
1854 | | - | |
1855 | | - | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
1856 | 1875 | | |
1857 | 1876 | | |
1858 | 1877 | | |
| |||
0 commit comments