Skip to content

[BugFix] Fix TypeError crash during dummy_run in OmniGPUModelRunner#2831

Merged
tzhouam merged 1 commit intovllm-project:dev/migrate-MR-v2from
Sy0307:fix/v2-dummy-run-type-error
Apr 16, 2026
Merged

[BugFix] Fix TypeError crash during dummy_run in OmniGPUModelRunner#2831
tzhouam merged 1 commit intovllm-project:dev/migrate-MR-v2from
Sy0307:fix/v2-dummy-run-type-error

Conversation

@Sy0307
Copy link
Copy Markdown
Contributor

@Sy0307 Sy0307 commented Apr 15, 2026

Purpose

Fix TypeError: Unexpected model output type: <class 'torch.Tensor'> crash during profile_run / dummy_run in V2 Omni model runner.

PR #2819 introduced a raise TypeError in the else branch of the hidden state extraction logic. However, during dummy_run=True (called by profile_rundetermine_available_memory), the model forward returns a bare torch.Tensor — not OmniOutput or a 2-tuple. The raise kills engine initialization for all Omni models on V2.

Replaces the raise TypeError with a passthrough hidden_states = model_output, which correctly handles bare tensors from dummy runs.

Test Plan

  • CI passes on H100 (Omni V2 tests: Qwen3-Omni, Qwen2.5-Omni, Qwen3-TTS)
  • Verify profile_run / determine_available_memory completes without crash

Test Result

Pending CI

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>
@Sy0307 Sy0307 marked this pull request as ready for review April 15, 2026 18:09
@Sy0307 Sy0307 requested a review from hsliuustc0106 as a code owner April 15, 2026 18:09
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@hsliuustc0106
Copy link
Copy Markdown
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.

@tzhouam tzhouam merged commit 3281a6f into vllm-project:dev/migrate-MR-v2 Apr 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants