server : do not cap slot context to training context (#22140)#22145
Open
jinweihan-ai wants to merge 1 commit intoggml-org:masterfrom
Open
server : do not cap slot context to training context (#22140)#22145jinweihan-ai wants to merge 1 commit intoggml-org:masterfrom
jinweihan-ai wants to merge 1 commit intoggml-org:masterfrom
Conversation
The per-slot cap overrides the user-requested context size even when it was explicitly extended via RoPE scaling (YaRN), which is the whole point of YaRN-aware models such as Qwen3. The KV cache is already allocated for the full n_ctx_seq, so capping slot.n_ctx only throws away addressable cells that the user paid memory for. llama_context already warns about "possible training context overflow" when n_ctx_seq > n_ctx_train, so dropping the server-side cap keeps the safety signal without silently ignoring --ctx-size. Closes ggml-org#22140
|
Hi @jinweihan-ai, thanks for your contribution! Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:
Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below. |
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.
Summary
Fixes #22140.
server_contextsilently capped each slot'sn_ctxto the model's training context, so any user who extended the context via RoPE scaling (YaRN) — the whole point of models like Qwen3 — effectively had their--ctx-sizeignored once the slot was created, even though the KV cache had already been sized for the fulln_ctx_seq.This PR drops the cap and keeps only the warning.
llama_contextitself already logs"n_ctx_seq (...) > n_ctx_train (...) -- possible training context overflow", so users still see the safety signal.Before
After
/propsnow reportsdefault_generation_settings.n_ctx = 4096(previously2048).Test plan
stories260K.gguf(n_ctx_train = 2048) and-c 4096.n_ctxin both the slot init log and the/propsendpoint./completionstill returns correctly after the change (20 tokens, stop=true, coherent output).Requirements
n_ctxand/completionchecked) before submitting. Human review and validation in the loop.