server : unify mtmd image processing with post-decode callback#24520
Closed
ggerganov wants to merge 3 commits into
Closed
server : unify mtmd image processing with post-decode callback#24520ggerganov wants to merge 3 commits into
ggerganov wants to merge 3 commits into
Conversation
Add mtmd_helper_post_decode_callback to mtmd_helper_eval_chunk_single and mtmd_helper_decode_image_chunk, invoked after each successful llama_decode(). The server uses this callback to run common_speculative_process on the batch, keeping the draft context in sync with the target context during multi-modal prompt processing. This eliminates the need for a second process_chunk call on ctx_dft and removes the llama-ext.h workaround include. Assisted-by: pi:llama.cpp/Qwen3.6-27B
Collaborator
|
fyi, I'm solving the same problem via #24384 , so probably this doesn't need to be fixed |
Move the post-decode callback construction inside server_tokens::process_chunk() so that server-common.h no longer depends on mtmd-helper.h. The caller now passes ctx_tgt and ctx_dft directly. Assisted-by: pi:llama.cpp/Qwen3.6-27B
Member
Author
Ok, leaving this PR for reference if it can be helpful in any way. |
Member
Author
|
Superseded by #24645 |
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
Add `mtmd_helper_post_decode_callback` to `mtmd_helper_eval_chunk_single` and `mtmd_helper_decode_image_chunk`, invoked after each successful `llama_decode()`.
The server uses this callback to decode the batch on the draft context, keeping it in sync with the target context during multi-modal prompt processing. This eliminates the need for a second `process_chunk` call on `ctx_dft`.
Requirements