[Bugfix] Fix the fp8 kv_cache check error that occurs when failing to obtain the CUDA version. (#4173)

Signed-off-by: AnyISalIn <anyisalin@gmail.com>
This commit is contained in:
AnyISalIn 2024-05-02 00:11:03 +08:00 committed by GitHub
parent 6f1df80436
commit a88bb9b032
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -353,7 +353,8 @@ class CacheConfig:
elif self.cache_dtype == "fp8":
if not is_hip():
nvcc_cuda_version = get_nvcc_cuda_version()
if nvcc_cuda_version < Version("11.8"):
if nvcc_cuda_version is not None \
and nvcc_cuda_version < Version("11.8"):
raise ValueError(
"FP8 is not supported when cuda version is"
"lower than 11.8.")