Skip to content

spec : auto-detect mtp draft model type - #27005

Merged
ngxson merged 1 commit into
masterfrom
cisc/spec-autodetect-draft-mtp
Aug 13, 2026
Merged

spec : auto-detect mtp draft model type#27005
ngxson merged 1 commit into
masterfrom
cisc/spec-autodetect-draft-mtp

Conversation

@CISC

@CISC CISC commented Aug 13, 2026

Copy link
Copy Markdown
Member

Overview

cont #26814

Additional information

Checks for presence of NextN tensor in draft model to auto-detect draft-mtp.

Requirements

@CISC
CISC requested a review from a team as a code owner August 13, 2026 10:49
@CISC CISC changed the title spec : autodetect mtp draft models spec : auto-detect mtp draft model type Aug 13, 2026
Comment thread common/speculative.cpp

const std::string arch = gguf_get_val_str(gguf_ctx.get(), arch_id);
if (arch != "dflash") {
const uint32_t block_count = gguf_get_val_u32(gguf_ctx.get(), gguf_find_key(gguf_ctx.get(), (arch + ".block_count").c_str()));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we throw error if gguf_find_key fails ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will return -1 which will GGML_ASSERT in gguf_get_val_u32, and since <arch>.block_count is a required key I don't think we need to be very informative here.

@ngxson
ngxson merged commit 1d2869c into master Aug 13, 2026
25 of 27 checks passed
@CISC
CISC deleted the cisc/spec-autodetect-draft-mtp branch August 13, 2026 11:39
EZForever added a commit to EZForever/llama.cpp that referenced this pull request Aug 14, 2026
ngxson added a commit that referenced this pull request Aug 15, 2026
* common: support --models-dir loading MTP assistant models

* common: preset: check for MTP models with strict prefix

* common: preset: Take advantage of PR #27005

* handle other draft types

* drop eagle3

* clean up

---------

Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
CowboyTim pushed a commit to aardbeiplantje/llama.cpp that referenced this pull request Aug 16, 2026
CowboyTim pushed a commit to aardbeiplantje/llama.cpp that referenced this pull request Aug 16, 2026
…4431)

* common: support --models-dir loading MTP assistant models

* common: preset: check for MTP models with strict prefix

* common: preset: Take advantage of PR ggml-org#27005

* handle other draft types

* drop eagle3

* clean up

---------

Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
brittlewis12 pushed a commit to brittlewis12/llama.cpp that referenced this pull request Aug 17, 2026
brittlewis12 pushed a commit to brittlewis12/llama.cpp that referenced this pull request Aug 17, 2026
…4431)

* common: support --models-dir loading MTP assistant models

* common: preset: check for MTP models with strict prefix

* common: preset: Take advantage of PR ggml-org#27005

* handle other draft types

* drop eagle3

* clean up

---------

Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants