Use specific exception types in CUDA version parse
Per AGENTS.md: prefer specific exception types in new code. AttributeError covers torch.version.cuda being None, ValueError covers an unparseable version string.
This commit is contained in:
parent
868c29cff3
commit
8f4e58d29f
|
|
@ -1966,7 +1966,7 @@ def supports_nvfp4_compute(device=None):
|
||||||
# cuBLAS FP4 matmul kernels require CUDA 13+, see #11864
|
# cuBLAS FP4 matmul kernels require CUDA 13+, see #11864
|
||||||
try:
|
try:
|
||||||
cuda_version_major = int(torch.version.cuda.split(".")[0])
|
cuda_version_major = int(torch.version.cuda.split(".")[0])
|
||||||
except:
|
except (AttributeError, ValueError):
|
||||||
return False
|
return False
|
||||||
if cuda_version_major < 13:
|
if cuda_version_major < 13:
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue