Skip to content

fix(worker): guard kernel_warmup against missing torchvision on OOT runtimes - #386

Merged
cyber-pioneer merged 2 commits into
flagos-ai:v0.3.0-devfrom
tengqm:fix/oot-torchvision-kernel-warmup-guard
Aug 17, 2026
Merged

fix(worker): guard kernel_warmup against missing torchvision on OOT runtimes#386
cyber-pioneer merged 2 commits into
flagos-ai:v0.3.0-devfrom
tengqm:fix/oot-torchvision-kernel-warmup-guard

Conversation

@tengqm

@tengqm tengqm commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

vLLM 0.24.0's kernel_warmup() (in vllm/model_executor/warmup/kernel_warmup.py)
unconditionally imports minimax_m3_msa_warmup, whose import 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 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.py already 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):

  • Server reaches Application startup complete (previously crashed with
    ImportError: No module named 'torchvision')
  • Greedy completion coherent (1+1=2, 2+2=4, 3+3=6, ...)
  • Chat CoT coherent (<think> block)
  • Fingerprint vllm-0.24.0-5936039f

Affected 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.

…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>
@github-actions github-actions Bot added the core label Aug 17, 2026
Comment thread vllm_fl/worker/worker.py Outdated
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>
@cyber-pioneer
cyber-pioneer merged commit 5b592be into flagos-ai:v0.3.0-dev Aug 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants