server : support multi-modal context checkpoints#19849
Merged
Conversation
6c5b8fa to
1ec9145
Compare
Contributor
|
I think it might make more sense to post this here instead of the original pr: @ggerganov These 3 changes should fix the incorrect checkpoint reuse I mentioned in regards to #19849 in server-task.h, add a new pos_end to checkpoint struct: in sever-context.cpp at checkpoint creation: and also in server-context.cpp, when checking if we have valid checkpoints: |
Member
Author
|
@ngxson PTAL, I think this is good to merge. |
ngxson
approved these changes
Feb 25, 2026
tools/server/server-task.h
Outdated
| llama_pos pos_min; | ||
| llama_pos pos_max; | ||
|
|
||
| int n_tokens; |
Collaborator
There was a problem hiding this comment.
should we change this to int64_t to match what's pos_next(int64_t) expects?
neilopet
added a commit
to neilopet/llama.cpp
that referenced
this pull request
Feb 26, 2026
PR ggml-org#19849 (multi-modal context checkpoints) introduced an off-by-one in server_tokens::size_up_to_pos: max_pos + 1 overflows the sequence position by one token, causing "Invalid input batch" HTTP 500 errors on every request after the first. Change max_pos + 1 to max_pos to match the expected 0-based position semantics. Ref: ggml-org#19901
bartowski1182
pushed a commit
to bartowski1182/llama.cpp
that referenced
this pull request
Mar 2, 2026
* Modify llama-memory-hybrid-iswa.cpp * Modify llama-memory-recurrent.cpp * Modify server-common.cpp * Modify server-common.h * Modify server-context.cpp * Modify server-task.h * Added comment to llama-memory-hybrid-iswa.cpp * Remove comment from server-context.cpp * Stylistic fix server-context.cpp * Fix an issue when seqrm isn't called in server-context.cpp * cont : alternative impl * cont : cleanup * cont : n_tokens -> int64_t --------- Co-authored-by: timkhronos <timkhronos@gmail.com>
ArberSephirotheca
pushed a commit
to ArberSephirotheca/llama.cpp
that referenced
this pull request
Mar 3, 2026
* Modify llama-memory-hybrid-iswa.cpp * Modify llama-memory-recurrent.cpp * Modify server-common.cpp * Modify server-common.h * Modify server-context.cpp * Modify server-task.h * Added comment to llama-memory-hybrid-iswa.cpp * Remove comment from server-context.cpp * Stylistic fix server-context.cpp * Fix an issue when seqrm isn't called in server-context.cpp * cont : alternative impl * cont : cleanup * cont : n_tokens -> int64_t --------- Co-authored-by: timkhronos <timkhronos@gmail.com>
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.
alt #19747
fix #19690
fix #19858
This continues the work from #19747 to enable multi-modal checkpointing in
llama-server. Avoids changes tolibllama. Fixesn_pastambiguity of "number of tokens" and "next position" by tracking the position separately with a newpos_nextvar.