Commit 4ecc7e4
committed
qwen35: force pre-norm hidden state for MTP
Tap the MTP/nextn hidden state before the final output norm in both the
trunk and MTP graphs of Qwen35 and Qwen35MoE, reverting the semantic core
of the post-norm migration (ggml-org#24025) while keeping the upstream `nextn`
naming and the masked (embeddings_nextn_masked) extraction path.
This restores the fork's pre-norm Qwen MTP optimization (TheTom#149) on top of
the rebased TurboQuant+ KV cache lineage, per explicit request to prefer
pre-norm over upstream's post-norm/nextn approach.
https://claude.ai/code/session_01HZZQMPA6D6KWgcuDsDarWa1 parent 03bbefa commit 4ecc7e4
2 files changed
Lines changed: 20 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
208 | | - | |
| 207 | + | |
209 | 208 | | |
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
213 | 212 | | |
214 | 213 | | |
215 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
216 | 218 | | |
217 | 219 | | |
218 | 220 | | |
| |||
619 | 621 | | |
620 | 622 | | |
621 | 623 | | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
622 | 630 | | |
623 | 631 | | |
624 | 632 | | |
625 | 633 | | |
626 | 634 | | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | 635 | | |
633 | 636 | | |
634 | 637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | | - | |
| 230 | + | |
233 | 231 | | |
234 | 232 | | |
235 | 233 | | |
236 | 234 | | |
237 | 235 | | |
238 | 236 | | |
239 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
| |||
716 | 717 | | |
717 | 718 | | |
718 | 719 | | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
719 | 726 | | |
720 | 727 | | |
721 | 728 | | |
722 | 729 | | |
723 | 730 | | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | 731 | | |
730 | 732 | | |
731 | 733 | | |
| |||
0 commit comments