@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 38658ec6f3
Fork 0

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 12, 11:00 UTC

[Bugfix][MM encoder] Fix ViT attention backend resolving for Turing GPU (#29614)

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

Isotr0py committed Nov 28, 2025 at 03:17 UTC 38658ec6f3b3a09a6cd205bab23a550b3d3f8c0e
1 file changed +9 -8
vllm/platforms/cuda.py
+9 -8
@@ -264,14 +264,15 @@ class CudaPlatformBase(Platform):
264 cls, head_size: int, dtype: torch.dtype
265 ) -> "AttentionBackendEnum":
266 # Try FlashAttention first
267 - try:
268 - backend_class = AttentionBackendEnum.FLASH_ATTN.get_class()
269 - if backend_class.supports_head_size(
270 - head_size
271 - ) and backend_class.supports_dtype(dtype):
272 - return AttentionBackendEnum.FLASH_ATTN
273 - except ImportError:
274 - pass
267 + if (cc := cls.get_device_capability()) and cc.major >= 8:
268 + try:
269 + backend_class = AttentionBackendEnum.FLASH_ATTN.get_class()
270 + if backend_class.supports_head_size(
271 + head_size
272 + ) and backend_class.supports_dtype(dtype):
273 + return AttentionBackendEnum.FLASH_ATTN
274 + except ImportError:
275 + pass
276
277 return AttentionBackendEnum.TORCH_SDPA
278