Repository navigation
[rl] SGLang engine: take the request's Prompt and the vision_processor argument - #6024
Merged
Merged
Conversation
…r argument #5824 changed the generation engine interface for image prompts: `EngineRequest.prompt_token_ids` became `EngineRequest.prompt` (a `Prompt`), and `Generator` passes `vision_processor` to every engine's build. The SGLang engine, which landed on main while #5824 was in review, kept the old interface: building it fails with "unexpected keyword argument 'vision_processor'", and every request would fail reading `prompt_token_ids`. - `SGLangEngine` takes `vision_processor` and raises unless it is None: it serves text prompts only. - It reads the request's `prompt.token_ids`. - `test_sglang_bitwise_parity` builds requests with `Prompt` and passes `vision_processor=None`.
wwwjn
requested review from
acisseJZhong,
fegin,
felipemello1,
shuhuayu and
tianyu-l
as code owners
November 11, 2026 00:51
wwwjn
commented
Nov 11, 2026
| del generator_name, output_dir | ||
| if vision_processor is not None: | ||
| raise ValueError( | ||
| "SGLangEngine serves text prompts only; image prompts " |
Contributor
Author
There was a problem hiding this comment.
BandAid fix for now - Just make API compatible.
I will ask agent to test multimodal sglang too.
acisseJZhong
approved these changes
Nov 11, 2026
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 (human-written)
Why
#5824 changed the generation engine interface for image prompts, and the SGLang engine (#5812), which landed on main while #5824 was in review, kept the old one:
EngineRequest.prompt_token_ids: list[int]becameEngineRequest.prompt: Prompt(tokens plus images).SGLangEngine.add_requestsstill readsrequest.prompt_token_ids(3 places).Generatorpassesvision_processor=to every engine'sbuild.SGLangEngine.__init__has no such parameter.Example. On main, any generator with
engine=SGLangEngine.Config():and, past that, every request:
AttributeError: 'EngineRequest' object has no attribute 'prompt_token_ids'.What changed
SGLangEnginetakesvision_processor: VisionProcessor.Config | None(asVLLMEnginedoes) and raises aValueErrorunless it is None: SGLang serves text prompts only, and image prompts needVLLMEngine.add_requestsreadsrequest.prompt.token_idsonce and uses it for the range check, the sampling params and SGLang'sinput_ids.test_sglang_bitwise_parity.pybuilds requests withPrompt(token_ids=...)and passesvision_processor=Noneto the engine'sbuild.Testing
Generatorpasses toengine.buildagainstSGLangEngine.__init__'s parameters: on main,vision_processoris missing; with this PR, nothing is.pre-commiton the two files passes.test_sglang_bitwise_parity.py(SGLang installed); it needs theciflow/rllabel.