Skip to content

[XPU][Bugfix] Make Omni AR async output path device-agnostic - #5569

Merged
xuechendi merged 3 commits into
vllm-project:mainfrom
Joshna-Medisetty:fix/omni-async-output-device-agnostic
Aug 20, 2026
Merged

xuechendi merged 3 commits into
vllm-project:mainfrom
Joshna-Medisetty:fix/omni-async-output-device-agnostic

Conversation

@Joshna-Medisetty

Copy link
Copy Markdown
Contributor

Summary

The AR async output builder in gpu_ar_model_runner.py uses hardcoded torch.cuda.* (streams, events, set_device), which breaks the warm-up path on XPU and other non-CUDA accelerators.

Fix

Replace them with the torch.accelerator.* / generic torch.Event / torch.Stream APIs the repo already mandates :

  • torch.cuda.current_stream() + with torch.cuda.stream(s) → torch.accelerator.current_stream() + torch.accelerator.set_stream() with try/finally restore (same idiom as vllm_omni/diffusion/ipc.py)
  • torch.cuda.Event/Stream → torch.Event/torch.Stream
  • torch.cuda.set_device() → torch.accelerator.set_device_index()

No behavior change on CUDA; unblocks AR-stage models (e.g. Qwen3-TTS) on XPU.

Test

Qwen3-TTS-12Hz-1.7B runs to completion on Intel XPU with this change.

Replace hardcoded torch.cuda.* calls in the async output builder with the
torch.accelerator.* / generic torch.Event / torch.Stream equivalents that the
repo already mandates (pyproject banned-api; PRs vllm-project#3365, vllm-project#4496). This unblocks
the AR model-runner warm-up path on XPU (and other non-CUDA accelerators)
without relying on the XPU torch.cuda shim.

Signed-off-by: Joshna Medisetty <joshna.medisetty@intel.com>
@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 hsliuustc0106 added bug Something isn't working xpu PR related to XPU labels Jul 30, 2026
def __init__(
self,
payload: Any,
ready_event: torch.cuda.Event | None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have done monkey patch in vLLM side,
Please follow same method - https://github.com/vllm-project/vllm/blob/main/vllm/v1/worker/xpu_model_runner.py#L43

don't modify vllm_omni/worker/gpu_ar_model_runner.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted gpu_ar_model_runner.py and moved the fix into platforms/xpu/utils.py via torch_cuda_wrapper() (same pattern as vLLM xpu_model_runner.py). Added set_device and the missing stream/event/graph patches so the Omni async output path works on XPU without changing the shared GPU runner.

Align XPU cuda→xpu monkey patch with vLLM (streams, events, set_device,
graph capture). Revert device-agnostic changes in gpu_ar_model_runner.py
per platform-layer review feedback.

Signed-off-by: Joshna Medisetty <joshna.medisetty@intel.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@xuechendi xuechendi added the ready label to trigger buildkite CI label Aug 20, 2026
@xuechendi
xuechendi merged commit bd17618 into vllm-project:main Aug 20, 2026
7 of 9 checks passed
fan2956 pushed a commit to fan2956/vllm-omni that referenced this pull request Aug 23, 2026
…oject#5569)

Signed-off-by: Joshna Medisetty <joshna.medisetty@intel.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
fan2956 pushed a commit to fan2956/vllm-omni that referenced this pull request Aug 23, 2026
…oject#5569)

Signed-off-by: Joshna Medisetty <joshna.medisetty@intel.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
AndyZhou952 pushed a commit to AndyZhou952/vllm-omni that referenced this pull request Aug 26, 2026
…oject#5569)

Signed-off-by: Joshna Medisetty <joshna.medisetty@intel.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: AndyZhou952 <jzhoubc@connect.ust.hk>
JoseCarlosGarcia95 pushed a commit to valendra-tech/vllm-omni that referenced this pull request Sep 5, 2026
…oject#5569)

Signed-off-by: Joshna Medisetty <joshna.medisetty@intel.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
khairulkabir1661 pushed a commit to khairulkabir1661/vllm-omni that referenced this pull request Sep 25, 2026
…oject#5569)

Signed-off-by: Joshna Medisetty <joshna.medisetty@intel.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready label to trigger buildkite CI xpu PR related to XPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants