[Minor] Simplify duplicative device check for cuda (#24793)

Signed-off-by: Ziliang Peng <ziliangdotme@gmail.com>
This commit is contained in:
Victor Ziliang Peng 2025-09-13 11:28:38 -07:00 committed by GitHub
parent 15b8fef453
commit 973c9d01da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,8 +64,7 @@ class CudaPlatformBase(Platform):
if self.has_device_capability(80): if self.has_device_capability(80):
# Ampere and Hopper or later NVIDIA GPUs. # Ampere and Hopper or later NVIDIA GPUs.
return [torch.bfloat16, torch.float16, torch.float32] return [torch.bfloat16, torch.float16, torch.float32]
elif (not self.has_device_capability(80) if self.has_device_capability(60):
) and self.has_device_capability(60):
# Pascal, Volta and Turing NVIDIA GPUs, BF16 is not supported # Pascal, Volta and Turing NVIDIA GPUs, BF16 is not supported
return [torch.float16, torch.float32] return [torch.float16, torch.float32]
# Kepler and Maxwell NVIDIA GPUs, only FP32 is supported, # Kepler and Maxwell NVIDIA GPUs, only FP32 is supported,