Fix torch.__version__ for PEP440 (#15682)
This commit is contained in:
@@ -11,6 +11,7 @@ from sglang.srt.environ import envs
|
||||
from sglang.srt.layers import deep_gemm_wrapper
|
||||
from sglang.srt.layers.quantization.fp8_kernel import sglang_per_token_group_quant_fp8
|
||||
from sglang.srt.layers.quantization.mxfp4_tensor import MXFP4QuantizeUtil
|
||||
from sglang.srt.utils.common import torch_release
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from sglang.srt.server_args import ServerArgs
|
||||
@@ -80,17 +81,12 @@ TORCH_DEVICE_IDENTITY = None
|
||||
|
||||
|
||||
def use_rowwise_torch_scaled_mm():
|
||||
_TORCH_VERSION = torch.__version__.split("+")[0]
|
||||
try:
|
||||
_TORCH_VERSION_TUPLE = tuple(map(int, _TORCH_VERSION.split(".")[:3]))
|
||||
except ValueError:
|
||||
_TORCH_VERSION_TUPLE = (0, 0, 0)
|
||||
if _is_hip:
|
||||
# The condition to determine if it is on a platform that supports
|
||||
# torch._scaled_mm rowwise feature.
|
||||
# The condition is determined once as the operations
|
||||
# are time consuming.
|
||||
return get_device_capability() >= (9, 4) and _TORCH_VERSION_TUPLE >= (2, 7, 0)
|
||||
return get_device_capability() >= (9, 4) and torch_release >= (2, 7)
|
||||
return False
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user