Repository navigation
[Fix] Re-encode multimodal embeddings after cache mismatch - #36595
Merged
Merged
Conversation
mickqian
requested review from
Ying1123,
hnyls2002,
merrymercy and
xiezhq-hermann
as code owners
August 27, 2026 02:58
Collaborator
Author
Reproduction validationUsing the cached
The injection was applied only in scratch checkouts; no diagnostic code is included in this PR. |
Co-authored-by: john.xh <dengxuhuijohn@gmail.com>
5 tasks
3 tasks
This was referenced Sep 7, 2026
vincentzed
added a commit
to vincentzed/sglang
that referenced
this pull request
Sep 7, 2026
The wrong-length cache-hit guard landed in sgl-project#36595. Keep the LFM2-VL entry in the encoder-materializes-features set and the HIP cross-request encode, now behind a dedicated allowlist that keeps NPU and XPU on the per-request fallback. Add CPU unit tests for the gate and the batched path. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KVPUFiK2bhzjErEnCMv26w
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.
Motivation
based on #32404
A compact multimodal feature-hash collision can return a cached embedding whose token count does not match the placeholder span in the request. The mismatch currently reaches
_adjust_embedding_lengthand aborts prefill withInsufficient multimodal embedding length.Modifications
(hash, token_count)in the per-batch temporary map so colliding items with different placeholder lengths are not deduplicated.Validation
pre-commit run --files python/sglang/srt/managers/mm_schedule.py test/registered/chunked_prefill/test_mm_chunked_embedding_unit.pypython3 -m compileall -q python/sglang/srt/managers/mm_schedule.py test/registered/chunked_prefill/test_mm_chunked_embedding_unit.pyCI States
Latest PR Test (Base): ✅ Run #33052289112
Latest PR Test (Extra): ❌ Run #33052288823
Latest PR Test (AMD ROCm 7.2): ❌ Run #33052289142