Repository navigation
Conversation
Validate normalized prompts against the text input vocabulary and the active processor markers for their supplied modalities. Keep output-token bounds, embedding overrides, session continuation and batch metadata setup on their existing contracts. Bound synthetic warmup inputs and add optional reduction of duplicate processor IDs after canonical request copying, preserving padded IDs and output ownership. Relationship to upstream: sgl-project#31908 (open) wires a plain [0, vocab_size) check into _validate_one_request. That check does not know about processor-registered multimodal markers (it would reject valid placeholder IDs outside the text vocabulary, or accept an image marker with no supplied media) and does not bound warmup IDs. sgl-project#35903 (same plain check) was closed without merge. Carried from #42. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
rodamani
marked this pull request as ready for review
September 29, 2026 23:21
rodamani
requested review from
CatherineSue,
HaiShaw,
JustinTong0323,
Ying1123,
hnyls2002,
ispobock,
merrymercy,
mickqian,
slin1237,
xiezhq-hermann,
yctseng0211,
yhyang201 and
yuan-luo
as code owners
September 29, 2026 23:21
SGLANG_MM_STRIP_PROCESSOR_INPUT_IDS is an independent payload optimization, so it moves to its own PR. The caller token-ID validation and warmup bound are unchanged. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
/tag-and-rerun-ci |
3 of 5 tasks
This branch has not been deployed
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
Caller-supplied
input_idsare not validated against the vocabulary before multimodal expansion (_validate_input_ids_in_vocabwas removed fromTokenizerManageras a dead helper). Out-of-range or negative IDs are not rejected at admission, and a caller can place a processor's multimodal marker ID in a prompt that supplies no media.Modifications
TokenizerManager._validate_generation_input_idschecks each normalized prompt against the text vocabulary (hf_text_config.vocab_size), allowing only the active processor's placeholder IDs for media actually supplied with that prompt (per batch item). Empty prompts, embedding overrides, session continuation and batch metadata keep their existing contracts.get_input_token_ids_for_data(base, LLaVA, inkling).SGLANG_MM_STRIP_PROCESSOR_INPUT_IDSpayload reduction that was originally bundled here is split into its own PR.test/registered/unit/managers/test_tokenizer_input_contracts.py(new),test_tokenizer_manager_rid_cleanup.py,test/registered/unit/entrypoints/test_server_warmup.py.Relationship to open PRs: #31908 wires a plain
[0, vocab_size)check into_validate_one_request, which does not know about processor-registered multimodal markers (it would reject valid placeholder IDs outside the text vocabulary, or accept a marker with no supplied media) and does not bound warmup IDs.Accuracy Tests
CPU: 55 passed, 23 subtests passed across the three files. Porting note: one test needed
scheduler.model_configon its stub because main's_process_and_broadcast_mm_inputsnow readsrequires_mm_token_modalities.Compatibility
Requests whose
input_idsare all inside[0, vocab_size)(or are the active processor's placeholders for media supplied with that prompt) behave as before. Requests with negative or out-of-vocabulary IDs, or with a multimodal marker but no matching media, now get aValueError(400) at admission instead of reaching the model. No new flags; text-only and embedding requests are unaffected.Speed Tests and Profiling
Adds a Python pass over caller-supplied
input_idsat admission (text-only requests have no media lookups). Not separately benchmarked.Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ✅ Run #36767748375
Latest PR Test (Extra): ❌ Run #36767747692
Latest PR Test (AMD ROCm 10): ❌ Run #36767748350