From ae2c4f3db713242b173548bc46f1b74b4dbb4c08 Mon Sep 17 00:00:00 2001 From: Yejing Lai Date: Tue, 30 Jun 2026 12:13:44 +0800 Subject: [PATCH] [XPU][UT]Fix xpu pass_config.fuse_norm_quant assert issue (#46804) Signed-off-by: Lai, Yejing Co-authored-by: Kunshang Ji --- tests/test_config.py | 4 +++- vllm/config/compilation.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index eb9b11535b..7c668a2a9d 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1292,7 +1292,9 @@ def test_vllm_config_explicit_overrides(): compilation_config=compilation_config, ) assert config.compilation_config.cudagraph_mode == CUDAGraphMode.NONE - assert config.compilation_config.pass_config.enable_qk_norm_rope_fusion is True + assert config.compilation_config.pass_config.enable_qk_norm_rope_fusion is ( + current_platform.is_cuda_alike() or current_platform.is_xpu() + ) # Mode should still use default for O2 assert config.compilation_config.mode == CompilationMode.VLLM_COMPILE diff --git a/vllm/config/compilation.py b/vllm/config/compilation.py index 4a392a7e3b..d65c3cf6f7 100644 --- a/vllm/config/compilation.py +++ b/vllm/config/compilation.py @@ -262,10 +262,12 @@ class PassConfig: "Fusion enabled but reshape elimination disabled. " "RMSNorm + padding fusion might not work" ) - if self.enable_qk_norm_rope_fusion and not current_platform.is_cuda_alike(): + if self.enable_qk_norm_rope_fusion and not ( + current_platform.is_cuda_alike() or current_platform.is_xpu() + ): logger.warning_once( "QK Norm + RoPE fusion enabled but the current platform is not " - "CUDA or ROCm. The fusion will be disabled." + "CUDA, ROCm or XPU. The fusion will be disabled." ) self.enable_qk_norm_rope_fusion = False if self.fuse_act_padding and not current_platform.is_rocm():