From 73b5f43622508c0a8c22d58f9e6253179e5b6b01 Mon Sep 17 00:00:00 2001 From: Ziliang Peng Date: Fri, 12 Sep 2025 20:36:03 -0700 Subject: [PATCH 1/2] simplify duplicative device check for cuda Signed-off-by: Ziliang Peng --- vllm/platforms/cuda.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vllm/platforms/cuda.py b/vllm/platforms/cuda.py index 42fff2f07a0a..95b5e6ddd2c2 100644 --- a/vllm/platforms/cuda.py +++ b/vllm/platforms/cuda.py @@ -64,8 +64,7 @@ def supported_dtypes(self) -> list[torch.dtype]: if self.has_device_capability(80): # Ampere and Hopper or later NVIDIA GPUs. return [torch.bfloat16, torch.float16, torch.float32] - elif (not self.has_device_capability(80) - ) and self.has_device_capability(60): + elif self.has_device_capability(60): # Pascal, Volta and Turing NVIDIA GPUs, BF16 is not supported return [torch.float16, torch.float32] # Kepler and Maxwell NVIDIA GPUs, only FP32 is supported, From fc9468500edb7b795a75d4ebb5ca6cbbccd06690 Mon Sep 17 00:00:00 2001 From: Ziliang Peng Date: Sat, 13 Sep 2025 01:27:18 -0700 Subject: [PATCH 2/2] just 'if' Signed-off-by: Ziliang Peng --- vllm/platforms/cuda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm/platforms/cuda.py b/vllm/platforms/cuda.py index 95b5e6ddd2c2..8e3436a9e73c 100644 --- a/vllm/platforms/cuda.py +++ b/vllm/platforms/cuda.py @@ -64,7 +64,7 @@ def supported_dtypes(self) -> list[torch.dtype]: if self.has_device_capability(80): # Ampere and Hopper or later NVIDIA GPUs. return [torch.bfloat16, torch.float16, torch.float32] - elif self.has_device_capability(60): + if self.has_device_capability(60): # Pascal, Volta and Turing NVIDIA GPUs, BF16 is not supported return [torch.float16, torch.float32] # Kepler and Maxwell NVIDIA GPUs, only FP32 is supported,