Commit 66cdb0b
committed
convert : add support for Gemma4AssistantForCausalLM (MTP drafter)
Register the Gemma4AssistantForCausalLM architecture for GGUF conversion.
This is the text-only MTP drafter model used for speculative decoding
with Gemma 4 models.
Key differences from Gemma4ForConditionalGeneration:
- attention_k_eq_v=true with no k_proj/v_proj tensors
(k_proj derived by slicing q_proj, v_proj = k_proj)
- k_norm derived from q_norm (same head_dim)
- Filters out post_projection and pre_projection tensors
(drafter-specific projection layers not needed for inference)
- Overrides shared_kv_layers to 0 for standalone inference
(HF config has 4, meaning all layers share KV with main model
during speculative decoding)1 parent 560304e commit 66cdb0b
2 files changed
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
768 | 812 | | |
769 | 813 | | |
770 | 814 | | |
| |||
0 commit comments