A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 3, 08:00 UTC
[XPU] update xpu graph usage (#43043)
Signed-off-by: Xinyu Chen <xinyu1.chen@intel.com>
Xinyu Chen committed
May 19, 2026 at 23:09 UTC
d740e2c02919cfba5a86a40d1c12439d03f5ac07
4 files changed
+9
-19
vllm/distributed/device_communicators/xpu_communicator.py
+1
@@ -22,6 +22,7 @@ class XpuCommunicator(DeviceCommunicatorBase):
22
unique_name: str = "",
23
):
24
super().__init__(cpu_group, device, device_group, unique_name)
25
+ self.ca_comm: None = None
26
if self.use_all2all:
27
if self.all2all_backend in ("naive", "allgather_reducescatter"):
28
from .all2all import AgRsAll2AllManager
vllm/distributed/parallel_state.py
+7
-1
@@ -476,9 +476,15 @@ class GroupCoordinator:
476
from vllm.distributed.device_communicators.cuda_communicator import (
477
CudaCommunicator,
478
)
479
+ from vllm.distributed.device_communicators.xpu_communicator import (
480
+ XpuCommunicator,
481
+ )
482
483
if self.device_communicator is not None:
481
- assert isinstance(self.device_communicator, CudaCommunicator)
484
+ assert isinstance(
485
+ self.device_communicator,
486
+ (CudaCommunicator, XpuCommunicator),
487
+ )
488
ca_comm = self.device_communicator.ca_comm
489
if ca_comm is not None:
490
maybe_ca_context = ca_comm.capture() # type: ignore
vllm/platforms/xpu.py
-17
@@ -195,23 +195,6 @@ class XPUPlatform(Platform):
195
"XPU Graph is disabled by environment variable, "
196
"please set VLLM_XPU_ENABLE_XPU_GRAPH=1 to enable it."
197
)
198
- elif parallel_config.world_size_across_dp > 1:
199
- compilation_config.cudagraph_mode = CUDAGraphMode.NONE
200
- logger.warning(
201
- "XPU Graph doesn't support capture communication ops, "
202
- "disabling cudagraph_mode."
203
- )
204
- else:
205
- if (
206
- attention_config.backend == AttentionBackendEnum.FLASH_ATTN
207
- and compilation_config.cudagraph_mode
208
- not in {CUDAGraphMode.NONE, CUDAGraphMode.PIECEWISE}
209
- ):
210
- compilation_config.cudagraph_mode = CUDAGraphMode.PIECEWISE
211
- logger.warning(
212
- "FMHA sycl-tla kernels cannot be captured with XPU graphs, "
213
- "falling back to PIECEWISE graph mode on XPU platform."
214
- )
198
199
# Disable fusion passes not yet supported on XPU.
200
pass_config = compilation_config.pass_config
vllm/v1/attention/backends/flash_attn.py
+1
-1
@@ -294,7 +294,7 @@ class FlashAttentionMetadataBuilder(AttentionMetadataBuilder[FlashAttentionMetad
294
# https://github.com/vllm-project/vllm/issues/22945
295
_cudagraph_support = (
296
AttentionCGSupport.ALWAYS
297
- if get_flash_attn_version() == 3
297
+ if get_flash_attn_version() == 3 or current_platform.is_xpu()
298
else AttentionCGSupport.UNIFORM_BATCH
299
)
300
supports_update_block_table: bool = True