GLM-4.7-Flash MTP support - #24868
Conversation
|
@am17an I would appreciate any feedback you may have, especially on the helpers split :) |
|
rebased on master to include #24832 |
| const llama_layer & layer, | ||
| int il); | ||
|
|
||
| ggml_tensor * build_mtp_moe_ffn( |
There was a problem hiding this comment.
the MTP model is just like any other model. So you don't need to helpers like this. Just use the helpers like build_moe_ffn
There was a problem hiding this comment.
Does it mean I should put all code into one long graph_mtp() ?
There was a problem hiding this comment.
what I mean is that you should re-use the helpers in llama-graph as much as possible instead of creating your own. Also I'm not sure if there is a need for a graph_mtp class. You can see how we currently do it for qwen/gemma/step3.5 etc
There was a problem hiding this comment.
I based my code on qwen35, it has:
struct graph_mtp : public llm_graph_context {
graph_mtp(const llama_model & model, const llm_graph_params & params);
};
I did same but then I split long graph_mtp into smaller functions
|
@jacekpoplawski is this ready for review? |
I will refactor to one big function this evening |
|
@CISC could you check this out maybe? :) |
|
@am17an do you have any suggestions on who I should ask for a second review? :) |
|
Wait till @CISC is back I guess? |
a212875 to
416fd82
Compare
416fd82 to
bebadf3
Compare
|
@CISC Can you please tell me how to load the provided MTP-only GGUF w/o redownloading the complete model GGUF (if that is even possible). Because it is not clear to me at all. |
I think you need -md |
Overview
tested trunk-only, mtp-only and combined (default) GGUFs
Additional information
https://huggingface.co/jacek2024/GLM-4.7-Flash-MTP-GGUF
The original idea was to add MTP support for GLM-4.5-Air. But I noticed that GLM-4.7-Flash also has an MTP layer and is much smaller, so I used it as the initial target for learning and getting some feedback.
llama_model_deepseek2::graph_mtp::graph_mtpwas implemented by comparing the existingllama_model_deepseek2::graph::graphimplementation withllama_model_qwen35::graph_mtp::graph_mtpbenchmarks
GLM-4.7-Flash-MTP-default-Q8_0.gguf
GLM-4.7-Flash-MTP-default-BF16.gguf
GLM-4.7-Flash-trunk-only-Q8_0.gguf + GLM-4.7-Flash-MTP-only-BF16.gguf
Requirements