Repository navigation
Commit a65a78d
Address code-review findings: dead code and tied embeddings
* `preprocess_weights` now honours `tie_word_embeddings`. Only an
explicit `language_model.lm_head.weight` populated `decoder.lm_head`
before, so a tied `neo_chat` variant would leave that initializer
unfilled. The released 8B checkpoint is untied, so this was latent, but
the registry declares a family/variant pair that anticipates siblings.
Mirrors the existing HunYuan VL-MoT handling. Covered by two new tests.
* Drops the `update_cache` parameter from `_MoTAttention`,
`_MoTDecoderLayer` and `_SenseNovaU1DecoderBody`. It was declared,
threaded through three modules, and never read: ONNX `Attention` always
emits `present = concat(past, new)`. The understanding prefix stays
frozen because the *caller* discards the denoiser's present outputs,
which is documented at that contract boundary in the task. Keeping a
flag that implied graph-level behaviour it did not have was a trap.
* Removes the unused expanded `mask` in the embedding model. `op.*` calls
emit IR nodes, so `del mask` dropped only the Python name — the
Unsqueeze/Expand survived until DCE. Also drops the vestigial
`num_heads` argument from `_rotate_half_axis`.
* Documents why GQA fusion cannot fire for either decoder graph (the
block-causal bias contains an `Or`, the denoiser has no attention_mask
input, and the three-axis RoPE is not `op.RotaryEmbedding`), so the
CUDA/fp16 export warning is not misdiagnosed later.
Verified graph-identical to the exported artifacts: all five components
match the on-disk node counts exactly, and the end-to-end image is
bit-identical to the pre-refactor run.
Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>1 parent 973b689 commit a65a78d
3 files changed
Lines changed: 58 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
224 | 245 | | |
225 | 246 | | |
226 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
439 | | - | |
| 438 | + | |
| 439 | + | |
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
455 | | - | |
456 | 455 | | |
457 | 456 | | |
458 | 457 | | |
| |||
500 | 499 | | |
501 | 500 | | |
502 | 501 | | |
503 | | - | |
504 | 502 | | |
505 | 503 | | |
506 | 504 | | |
| |||
523 | 521 | | |
524 | 522 | | |
525 | 523 | | |
526 | | - | |
527 | 524 | | |
528 | 525 | | |
529 | 526 | | |
| |||
560 | 557 | | |
561 | 558 | | |
562 | 559 | | |
563 | | - | |
564 | 560 | | |
565 | 561 | | |
566 | 562 | | |
| |||
571 | 567 | | |
572 | 568 | | |
573 | 569 | | |
574 | | - | |
575 | 570 | | |
576 | 571 | | |
577 | 572 | | |
| |||
722 | 717 | | |
723 | 718 | | |
724 | 719 | | |
725 | | - | |
726 | 720 | | |
727 | 721 | | |
728 | 722 | | |
| |||
751 | 745 | | |
752 | 746 | | |
753 | 747 | | |
754 | | - | |
755 | 748 | | |
756 | 749 | | |
757 | 750 | | |
| |||
780 | 773 | | |
781 | 774 | | |
782 | 775 | | |
783 | | - | |
784 | | - | |
785 | 776 | | |
786 | 777 | | |
787 | 778 | | |
| |||
793 | 784 | | |
794 | 785 | | |
795 | 786 | | |
796 | | - | |
797 | 787 | | |
798 | 788 | | |
799 | 789 | | |
| |||
921 | 911 | | |
922 | 912 | | |
923 | 913 | | |
924 | | - | |
925 | 914 | | |
926 | 915 | | |
927 | 916 | | |
| |||
1022 | 1011 | | |
1023 | 1012 | | |
1024 | 1013 | | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
1025 | 1022 | | |
1026 | 1023 | | |
1027 | 1024 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
0 commit comments