fix(worker): guard kernel_warmup against missing torchvision on OOT runtimes - #386
Merged
cyber-pioneer merged 2 commits intoAug 17, 2026
Conversation
…untimes vllm 0.24.0's kernel_warmup() unconditionally imports minimax_m3_msa_warmup, whose chain reaches torchvision.transforms. OOT runtimes (cambricon, hygon, ascend, mthreads) never ship torchvision (installing it would overwrite the vendor-matched torch matrix), so the call raises ImportError at EngineCore init. The warmup is a no-op for any model other than MiniMaxM3, so skip it and log. Verified E2E on mthreads MUSA 4.3.6 (flagtree 0.6.1): serve reaches Application startup complete, greedy + chat CoT coherent. Co-Authored-By: Claude <noreply@anthropic.com>
Address review: the ImportError may not be torchvision specifically — log the actual error message so the skip reason is diagnosable. Co-Authored-By: Claude <noreply@anthropic.com>
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
vLLM 0.24.0's
kernel_warmup()(invllm/model_executor/warmup/kernel_warmup.py)unconditionally imports
minimax_m3_msa_warmup, whose import chain reachestorchvision.transforms. OOT runtimes (cambricon, hygon, ascend, mthreads) nevership torchvision — installing it would overwrite the vendor-matched torch matrix —
so the call raises
ImportErrorat EngineCore init and the server fails to start.The warmup is a no-op for any model other than MiniMaxM3, so we skip it and log a
warning. The existing import-site guard in
worker.pyalready protects the import;this adds the missing call-site guard.
Verification
Verified E2E on mthreads MUSA 4.3.6 (flagtree 0.6.1, torch 2.9.0+musa.4.3.6,
vLLM 0.24.0 empty-mode wheel, DeepSeek-R1-0528-Qwen3-8B-FlagOS):
Application startup complete(previously crashed withImportError: No module named 'torchvision')1+1=→2, 2+2=4, 3+3=6, ...)<think>block)vllm-0.24.0-5936039fAffected backends
All no-torchvision OOT backends in the runtime matrix: cambricon×2, hygon,
ascend×2, mthreads×2.
This PR was written in part with the assistance of generative AI.