Skip to content

Enable XPU inference for InternVLA-M1 (backend-safe)#33

Open
padatta wants to merge 1 commit into
InternRobotics:InternVLA-M1from
padatta:padatta/xpu-enablement
Open

Enable XPU inference for InternVLA-M1 (backend-safe)#33
padatta wants to merge 1 commit into
InternRobotics:InternVLA-M1from
padatta:padatta/xpu-enablement

Conversation

@padatta

@padatta padatta commented Jul 6, 2026

Copy link
Copy Markdown

Summary

Enables InternVLA-M1 inference on Intel XPU.

Changes

  • InternVLA/model/modules/vlm/QWen2_5.py
    • Add _get_autocast_device() helper (reads the model's device).
    • Load Qwen2.5-VL with backend-safe attention + placement: flash_attention_2 and device_map="cuda" on CUDA; sdpa and device_map="xpu"/"cpu" otherwise.
    • Replace hard-coded torch.autocast("cuda", ...) with the detected device (2 sites).
  • InternVLA/model/framework/M1.py
    • Replace hard-coded torch.autocast("cuda", ...) with the detected device (4 sites).
    • chat_with_M1(): device defaults to the model's own device instead of a fixed string.
    • main device selection prefers XPU, then CUDA, then CPU.

Compatibility

  • CUDA: unchanged
  • XPU: newly supported

Testing

  • python -m py_compile on changed files.
  • Inference smoke test on Intel XPU.

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.

1 participant