[DSV4] Guard V4.1 indexer SM100 check on non-CUDA devices (#42114)

Co-authored-by: Alex Nails <alex.nails@radixark.ai>
This commit is contained in:
hmalgewatta
2026-10-08 12:06:28 +08:00
committed by GitHub
co-authored by Alex Nails
parent b72da1b817
commit 7327fb225f
@@ -9,6 +9,8 @@ from typing import TYPE_CHECKING, Tuple
import torch
from sglang.srt.utils import is_cuda
from .full_topk import FullTopKIndexer
from .types import (
CandidateMetadata,
@@ -39,8 +41,9 @@ __all__ = [
@functools.cache
def is_sm100_or_newer() -> bool:
# DeepGEMM's fp8_fp4 mqa-logits kernels need SM100+; Hopper takes the torch indexer.
return torch.cuda.get_device_capability()[0] >= 10
# DeepGEMM's fp8_fp4 mqa-logits kernels need SM100+; Hopper and non-CUDA devices
# take the torch indexer.
return is_cuda() and torch.cuda.get_device_capability()[0] >= 10
@functools.cache