server: check draft context creation error#24922
Merged
Merged
Conversation
ngxson
approved these changes
Jun 23, 2026
Geminihaha
pushed a commit
to Geminihaha/llama.cpp
that referenced
this pull request
Jun 25, 2026
papamoose
pushed a commit
to papamoose/llama.cpp
that referenced
this pull request
Jun 27, 2026
sanmai
added a commit
to sanmai/llama.cpp
that referenced
this pull request
Jun 30, 2026
The probe block collapsed from ~75 lines to ~30. Removed: spec_eagle3 detection, the try_set_stub_ctx_other lambda, stub_attempted, the 2-attempt retry loop, and the catch-fallback. What remains is the Sculpture-principle version:
if (has_draft && spec_mtp) { // gemma4-assistant separate draft
// build no_alloc target stub -> cparams_dft.ctx_other
}
try { /* probe + accumulate */ } catch { /* SRV_WRN, reserve nothing */ }
- Change 2 (null-check) dropped — it's upstream ggml-org#24922.
- EAGLE3 no longer special-cased — no stub, fails loudly via ggml-org#24922 under default --fit (= master status quo, --ctx-size escape hatch), no regression.
Validated post-simplification
- Gemma (has_draft + spec_mtp): stub built, estimate 5293 MiB, MTP active, 127 t/s, n_ctx→58880.
- Qwen (in-model MTP, has_draft=false): no stub, estimate 4256 MiB "MTP context", MTP active, 139 t/s, n_ctx→83968.
- Build + smoke test pass.
adrianhoehne
pushed a commit
to adrianhoehne/llama.cpp
that referenced
this pull request
Jul 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
We don't check if context was properly created when loading draft model. If context does not fit into memory we write an error and continue without enabling speculative decoding. Unless user looks into logs they would be unaware of the situation.
With this change we will stop loading the model if context fails to be created.
I've also fixed trying to free uninitialized memory - introduced by a recent refactor (#24843).
free(): invalid pointeris thrown and process aborted when loading model is canceled beforebatch.init()is called - e.g. if user provide a path to an non-existent model.I can remove that part if it is planned to be handled in some other way.
Fixes #24758
Requirements