fix(runner): pass request_id to model.preprocess() for per-request state#2746
Closed
linyueqian wants to merge 1 commit intovllm-project:mainfrom
Closed
fix(runner): pass request_id to model.preprocess() for per-request state#2746linyueqian wants to merge 1 commit intovllm-project:mainfrom
linyueqian wants to merge 1 commit intovllm-project:mainfrom
Conversation
OmniGPUModelRunner._preprocess() calls model.preprocess() per request but never passes the request_id. Models that maintain per-request state (e.g. VoxCPM2TalkerForConditionalGeneration) fall back to a hardcoded "default" id, causing all concurrent requests to share a single state. This produces two bugs in batched inference: - Stop logic failure: shared state mixes stop signals across requests, so requests never terminate (58s audio for 4s sentences) - Prefill shape mismatch: second preprocess() overwrites first's masks, causing RuntimeError when forward() reads stale dimensions Fix: inject req_id into req_infos before the preprocess() call. Tested on H20 (single GPU, enforce_eager): - 2 concurrent requests: audio duration 2.72s + 5.28s (was 57s + 58s) - Single request: unchanged (RTF ~0.21) Signed-off-by: Yueqian Lin <pandaleefree@gmail.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Collaborator
Author
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
OmniGPUModelRunner._preprocess()iterates overself.input_batch.req_idsbut never passes the request ID tomodel.preprocess(). Models that maintain per-request state (e.g. VoxCPM2) fall back to a hardcoded"default"ID, so all concurrent requests share a single state object.This one-line fix injects
req_infos["request_id"] = req_idbefore thepreprocess()call.Bugs fixed (found while testing #2690):
RuntimeError: size mismatchpreprocess()overwrites first'sprefill_masks;forward()reads stale dimensionsKnown remaining issue (not addressed here): 4 concurrent requests hit
msgspec.ValidationError: cannot unpack non-iterable NoneType objectin the orchestrator IPC layer when requests finish at different times andmm_payloadcontainsNoneaudio entries. This is a separate orchestrator-level serialization bug.Test plan
Tested on H20 (single GPU, enforce_eager=true):
msgspecbug