Commit 5bc50b1
refparity: TQ_DUMP_INTERMEDIATE + FFN magnitude drift diagnosis
Added per-layer sub-stage dumps (h{l}_in/postattn/preffn/ffnout) gated behind
TQ_DUMP_INTERMEDIATE=1 env. Zero impact on default dump output; opt-in for
finer-grained bisection of per-layer divergences.
Applied to Qwen3-0.6B Q4_K_M "Hello" prompt: attention and pre-FFN norm all
match HF at cos≥0.9996; divergence isolated to FFN matmul chain. FFN output
magnitude ratio vs HF:
L0/L1/L13: ~1.0 (matches HF)
L26: 0.81 (drifting)
L27: 0.53 (catastrophic — causes post_norm cos=0.24)
us.h27 ≈ hf.h27 + 0.334·hf.h26 (residual-leak fit). TQ_NO_Q4=1 swings error
to 1.54× — both Q4-converted and GGUF-native paths systematically wrong
beyond quantization noise. Not a one-liner; tracked for follow-up round.
The methodology (not the fix) transfers to 35B: extending refparity to
Qwen3.5-4B (DeltaNet hybrid, fits 16GB HF FP32) would diagnose the Qwen3.6
long-gen DeltaNet drift the same way.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 161a218 commit 5bc50b1
3 files changed
Lines changed: 98 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 | |
|---|---|---|---|
| |||
2774 | 2774 | | |
2775 | 2775 | | |
2776 | 2776 | | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
| 2780 | + | |
2777 | 2781 | | |
2778 | 2782 | | |
2779 | 2783 | | |
| |||
2840 | 2844 | | |
2841 | 2845 | | |
2842 | 2846 | | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
2843 | 2851 | | |
2844 | 2852 | | |
2845 | 2853 | | |
| |||
3008 | 3016 | | |
3009 | 3017 | | |
3010 | 3018 | | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
3011 | 3023 | | |
3012 | 3024 | | |
3013 | 3025 | | |
| |||
3108 | 3120 | | |
3109 | 3121 | | |
3110 | 3122 | | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
3111 | 3127 | | |
3112 | 3128 | | |
3113 | 3129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
73 | 87 | | |
74 | 88 | | |
75 | 89 | | |
| |||
99 | 113 | | |
100 | 114 | | |
101 | 115 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
0 commit comments