Skip to content

Conversation

chaojun-zhang
Copy link
Contributor

@chaojun-zhang chaojun-zhang commented Jul 22, 2025

Essential Elements of an Effective PR Description Checklist

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Purpose

When running certain models in torch.compile mode, the system might try to use CUDA Graph-related code. This isn't supported on XPU platforms, so we've disabled it here.

Test Plan

VLLM_USE_V1=1 python examples/offline_inference/audio_language.py -m granite_speech

Test Result

Without this PR:
lora_b_stacked_2_ = None
File "/home/chaojun/vllm/vllm/compilation/cuda_piecewise_backend.py", line 164, in call
cudagraph = torch.cuda.CUDAGraph()
File "/home/chaojun/.local/lib/python3.10/site-packages/torch/cuda/graphs.py", line 74, in new
return super().new(cls, keep_graph)
File "/home/chaojun/.local/lib/python3.10/site-packages/torch/_utils.py", line 996, in err_fn
raise RuntimeError(f"Tried to instantiate dummy base class {class_name}")
RuntimeError: Tried to instantiate dummy base class CUDAGraph

With this PR:

Adding requests: 100%|███████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.00s/it]
Fetching 25 files: 100%|████████████████████████████████████████████████████████████| 25/25 [00:00<00:00, 23101.48it/s]
Processed prompts: 100%|███████████| 1/1 [00:03<00:00, 3.68s/it, est. speed input: 61.98 toks/s, output: 12.50 toks/s]
the first words i spoke in the original phonograph a little piece of practical poetry mary had a little lamb its fleece was white as snow and everywhere that mary went the lamb was sure to go

(Optional) Documentation Update

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request disables CUDA graphs for the XPU platform, preventing a runtime crash. While this is a valid fix, consider implementing a dedicated XpuPiecewiseBackend or using a platform-agnostic backend for XPU to improve long-term stability.

@@ -86,6 +86,7 @@ def inference_mode(cls):
def check_and_update_config(cls, vllm_config: VllmConfig) -> None:
cache_config = vllm_config.cache_config
model_config = vllm_config.model_config
vllm_config.compilation_config.use_cudagraph = False
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Disabling CUDA graphs for the XPU platform prevents a runtime crash, which is a valid fix. However, the system attempts to use a CUDA-specific backend (cuda_piecewise_backend.py) on the XPU platform. Consider implementing a dedicated XpuPiecewiseBackend or using a platform-agnostic backend for XPU to improve long-term stability.

Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@chaojun-zhang chaojun-zhang marked this pull request as draft July 22, 2025 07:17
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