From 6ec5e9fd37efc3634f509bc16e34f0d9a3cce528 Mon Sep 17 00:00:00 2001 From: SherryC41 <97450679+SherryC41@users.noreply.github.com> Date: Sat, 21 Mar 2026 01:54:08 +0800 Subject: [PATCH] refactor: abstract deepgemm support into platform (#37519) Co-authored-by: sherryC41 --- vllm/platforms/cuda.py | 5 +++++ vllm/platforms/interface.py | 7 +++++++ vllm/utils/deep_gemm.py | 5 +---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/vllm/platforms/cuda.py b/vllm/platforms/cuda.py index 7070fd0b6..50a79cbb0 100644 --- a/vllm/platforms/cuda.py +++ b/vllm/platforms/cuda.py @@ -511,6 +511,11 @@ class CudaPlatformBase(Platform): def support_static_graph_mode(cls) -> bool: return True + @classmethod + def support_deep_gemm(cls) -> bool: + """Currently, only Hopper and Blackwell GPUs are supported.""" + return cls.is_device_capability(90) or cls.is_device_capability_family(100) + @classmethod def num_compute_units(cls, device_id: int = 0) -> int: return torch.cuda.get_device_properties(device_id).multi_processor_count diff --git a/vllm/platforms/interface.py b/vllm/platforms/interface.py index 619b403ba..39688bb8b 100644 --- a/vllm/platforms/interface.py +++ b/vllm/platforms/interface.py @@ -712,6 +712,13 @@ class Platform: """ return False + @classmethod + def support_deep_gemm(cls) -> bool: + """ + Returns if DeepGEMM is supported by the current platform. + """ + return False + @classmethod def use_custom_op_collectives(cls) -> bool: """ diff --git a/vllm/utils/deep_gemm.py b/vllm/utils/deep_gemm.py index ee104a6cc..fb6208212 100644 --- a/vllm/utils/deep_gemm.py +++ b/vllm/utils/deep_gemm.py @@ -70,10 +70,7 @@ def is_deep_gemm_supported() -> bool: """Return `True` if DeepGEMM is supported on the current platform. Currently, only Hopper and Blackwell GPUs are supported. """ - is_supported_arch = current_platform.is_cuda() and ( - current_platform.is_device_capability(90) - or current_platform.is_device_capability_family(100) - ) + is_supported_arch = current_platform.support_deep_gemm() return envs.VLLM_USE_DEEP_GEMM and has_deep_gemm() and is_supported_arch