[XPU] enable XPU GRAPH by default (#51600)
Signed-off-by: zhenwei-intel <zhenwei.liu@intel.com>
This commit is contained in:
@@ -317,7 +317,6 @@ if TYPE_CHECKING:
|
||||
VLLM_ELASTIC_EP_SCALE_UP_LAUNCH: bool = False
|
||||
VLLM_ELASTIC_EP_DRAIN_REQUESTS: bool = False
|
||||
VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS: bool = True
|
||||
VLLM_XPU_ENABLE_XPU_GRAPH: bool = False
|
||||
VLLM_XPU_FORCE_N_CONTIG_WEIGHT: bool = False
|
||||
VLLM_XPU_USE_SAMPLER_KERNEL: bool = True
|
||||
VLLM_XPU_INC_WNA16_BACKEND: Literal["auto", "ark", "w4a16", "w4a8"] = "auto"
|
||||
@@ -2139,10 +2138,6 @@ environment_variables: dict[str, Callable[[], Any]] = {
|
||||
"VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS": lambda: bool(
|
||||
int(os.getenv("VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS", "1"))
|
||||
),
|
||||
# Whether enable XPU graph on Intel GPU
|
||||
"VLLM_XPU_ENABLE_XPU_GRAPH": lambda: bool(
|
||||
int(os.getenv("VLLM_XPU_ENABLE_XPU_GRAPH", "0"))
|
||||
),
|
||||
# Force N-contiguous weight layout for all XPU unquantized linears.
|
||||
"VLLM_XPU_FORCE_N_CONTIG_WEIGHT": lambda: bool(
|
||||
int(os.getenv("VLLM_XPU_FORCE_N_CONTIG_WEIGHT", "0"))
|
||||
|
||||
@@ -336,16 +336,15 @@ class XPUPlatform(Platform):
|
||||
"XPU Graph is not supported in the current PyTorch version, "
|
||||
"disabling cudagraph_mode."
|
||||
)
|
||||
elif not envs.VLLM_XPU_ENABLE_XPU_GRAPH:
|
||||
|
||||
if (
|
||||
vllm_config.model_config is not None
|
||||
and vllm_config.model_config.enable_sleep_mode
|
||||
and compilation_config.cudagraph_mode != CUDAGraphMode.NONE
|
||||
):
|
||||
compilation_config.cudagraph_mode = CUDAGraphMode.NONE
|
||||
logger.warning_once(
|
||||
"XPU Graph is disabled by environment variable, "
|
||||
"please set VLLM_XPU_ENABLE_XPU_GRAPH=1 to enable it."
|
||||
)
|
||||
else:
|
||||
logger.warning_once(
|
||||
"XPU Graph support is experimental and currently only supports "
|
||||
"single-GPU execution."
|
||||
"XPU Graph is not compatible with sleep mode, disabling cudagraph_mode."
|
||||
)
|
||||
|
||||
# Disable fusion passes not yet supported on XPU.
|
||||
|
||||
@@ -616,12 +616,10 @@ class Worker(WorkerBase):
|
||||
# torch.accelerator.get_memory_info (reliable on ROCm, as used by
|
||||
# the AMD-CI mem tests), and graph_pool_handle resolves to the same
|
||||
# torch.cuda handle the live capture path already uses on ROCm.
|
||||
# XPU stays excluded (see #39977).
|
||||
cudagraph_memory_estimate = 0
|
||||
if (
|
||||
current_platform.is_cuda_alike()
|
||||
and self.vllm_config.compilation_config.cudagraph_mode != CUDAGraphMode.NONE
|
||||
):
|
||||
current_platform.is_cuda_alike() or current_platform.is_xpu()
|
||||
) and self.vllm_config.compilation_config.cudagraph_mode != CUDAGraphMode.NONE:
|
||||
cudagraph_memory_estimate = self.model_runner.profile_cudagraph_memory()
|
||||
|
||||
# Respect the opt-in flag as originally designed.
|
||||
|
||||
Reference in New Issue
Block a user