[BugFix] Fix TypeError crash during dummy_run in OmniGPUModelRunner#2831
Merged
tzhouam merged 1 commit intovllm-project:dev/migrate-MR-v2from Apr 16, 2026
Merged
Conversation
Model forward returns a bare torch.Tensor during dummy_run/profile_run, which is neither OmniOutput nor a 2-tuple. The raise TypeError in the else branch kills profile_run → determine_available_memory → engine initialization. Replace with passthrough assignment. Signed-off-by: Sy03 <1370724210@qq.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
|
Fix is correct for the immediate issue — dummy_run returns bare torch.Tensor and the previous raise was blocking V2 initialization. Consider making the passthrough more explicit rather than a catch-all else: could check to avoid silently accepting unexpected types. Also missing a regression test that verifies profile_run / dummy_run completes without raising TypeError on V2 Omni models. |
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.
Purpose
Fix
TypeError: Unexpected model output type: <class 'torch.Tensor'>crash duringprofile_run/dummy_runin V2 Omni model runner.PR #2819 introduced a
raise TypeErrorin the else branch of the hidden state extraction logic. However, duringdummy_run=True(called byprofile_run→determine_available_memory), the model forward returns a baretorch.Tensor— notOmniOutputor a 2-tuple. Theraisekills engine initialization for all Omni models on V2.Replaces the
raise TypeErrorwith a passthroughhidden_states = model_output, which correctly handles bare tensors from dummy runs.Test Plan
profile_run/determine_available_memorycompletes without crashTest Result
Pending CI