[XPU] update xpu graph usage (#43043)
Signed-off-by: Xinyu Chen <xinyu1.chen@intel.com>
This commit is contained in:
@@ -22,6 +22,7 @@ class XpuCommunicator(DeviceCommunicatorBase):
|
||||
unique_name: str = "",
|
||||
):
|
||||
super().__init__(cpu_group, device, device_group, unique_name)
|
||||
self.ca_comm: None = None
|
||||
if self.use_all2all:
|
||||
if self.all2all_backend in ("naive", "allgather_reducescatter"):
|
||||
from .all2all import AgRsAll2AllManager
|
||||
|
||||
@@ -476,9 +476,15 @@ class GroupCoordinator:
|
||||
from vllm.distributed.device_communicators.cuda_communicator import (
|
||||
CudaCommunicator,
|
||||
)
|
||||
from vllm.distributed.device_communicators.xpu_communicator import (
|
||||
XpuCommunicator,
|
||||
)
|
||||
|
||||
if self.device_communicator is not None:
|
||||
assert isinstance(self.device_communicator, CudaCommunicator)
|
||||
assert isinstance(
|
||||
self.device_communicator,
|
||||
(CudaCommunicator, XpuCommunicator),
|
||||
)
|
||||
ca_comm = self.device_communicator.ca_comm
|
||||
if ca_comm is not None:
|
||||
maybe_ca_context = ca_comm.capture() # type: ignore
|
||||
|
||||
@@ -195,23 +195,6 @@ class XPUPlatform(Platform):
|
||||
"XPU Graph is disabled by environment variable, "
|
||||
"please set VLLM_XPU_ENABLE_XPU_GRAPH=1 to enable it."
|
||||
)
|
||||
elif parallel_config.world_size_across_dp > 1:
|
||||
compilation_config.cudagraph_mode = CUDAGraphMode.NONE
|
||||
logger.warning(
|
||||
"XPU Graph doesn't support capture communication ops, "
|
||||
"disabling cudagraph_mode."
|
||||
)
|
||||
else:
|
||||
if (
|
||||
attention_config.backend == AttentionBackendEnum.FLASH_ATTN
|
||||
and compilation_config.cudagraph_mode
|
||||
not in {CUDAGraphMode.NONE, CUDAGraphMode.PIECEWISE}
|
||||
):
|
||||
compilation_config.cudagraph_mode = CUDAGraphMode.PIECEWISE
|
||||
logger.warning(
|
||||
"FMHA sycl-tla kernels cannot be captured with XPU graphs, "
|
||||
"falling back to PIECEWISE graph mode on XPU platform."
|
||||
)
|
||||
|
||||
# Disable fusion passes not yet supported on XPU.
|
||||
pass_config = compilation_config.pass_config
|
||||
|
||||
@@ -294,7 +294,7 @@ class FlashAttentionMetadataBuilder(AttentionMetadataBuilder[FlashAttentionMetad
|
||||
# https://github.com/vllm-project/vllm/issues/22945
|
||||
_cudagraph_support = (
|
||||
AttentionCGSupport.ALWAYS
|
||||
if get_flash_attn_version() == 3
|
||||
if get_flash_attn_version() == 3 or current_platform.is_xpu()
|
||||
else AttentionCGSupport.UNIFORM_BATCH
|
||||
)
|
||||
supports_update_block_table: bool = True
|
||||
|
||||
Reference in New Issue
Block a user