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 5, 23:30 UTC
[XPU] Disable xpu graph by default (#38193)
Signed-off-by: Kunshang Ji <kunshang.ji@intel.com>
Kunshang Ji committed
Mar 26, 2026 at 16:53 UTC
6ae8bbd0c2fa5b057f0c3066bc6519792f7048af
2 files changed
+12
vllm/envs.py
+5
@@ -247,6 +247,7 @@ if TYPE_CHECKING:
247
VLLM_ELASTIC_EP_DRAIN_REQUESTS: bool = False
248
VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS: bool = False
249
VLLM_NIXL_EP_MAX_NUM_RANKS: int = 32
250
+ VLLM_XPU_ENABLE_XPU_GRAPH: bool = False
251
252
253
def get_default_cache_root():
@@ -1648,6 +1649,10 @@ environment_variables: dict[str, Callable[[], Any]] = {
1649
"VLLM_NIXL_EP_MAX_NUM_RANKS": lambda: int(
1650
os.getenv("VLLM_NIXL_EP_MAX_NUM_RANKS", "32")
1651
),
1652
+ # Whether enable XPU graph on Intel GPU
1653
+ "VLLM_XPU_ENABLE_XPU_GRAPH": lambda: bool(
1654
+ int(os.getenv("VLLM_XPU_ENABLE_XPU_GRAPH", "0"))
1655
+ ),
1656
}
1657
1658
vllm/platforms/xpu.py
+7
@@ -12,6 +12,7 @@ import vllm_xpu_kernels._C # noqa
12
import vllm_xpu_kernels._moe_C # noqa
13
import vllm_xpu_kernels._xpu_C # noqa
14
15
+import vllm.envs as envs
16
from vllm.logger import init_logger
17
from vllm.utils.torch_utils import supports_xpu_graph
18
from vllm.v1.attention.backends.registry import AttentionBackendEnum
@@ -181,6 +182,12 @@ class XPUPlatform(Platform):
182
"XPU Graph is not supported in the current PyTorch version, "
183
"disabling cudagraph_mode."
184
)
185
+ elif not envs.VLLM_XPU_ENABLE_XPU_GRAPH:
186
+ compilation_config.cudagraph_mode = CUDAGraphMode.NONE
187
+ logger.warning(
188
+ "XPU Graph is disabled by environment variable, "
189
+ "please set VLLM_XPU_ENABLE_XPU_GRAPH=1 to enable it."
190
+ )
191
elif parallel_config.world_size_across_dp > 1:
192
compilation_config.cudagraph_mode = CUDAGraphMode.NONE
193
logger.warning(