Merge pull request #5193 from Ricardo-L-C/main

_is_bf16_available judgment supports npu
This commit is contained in:
hoshi-hiyouga 2024-08-19 23:40:59 +08:00 committed by GitHub
commit 5d5bfc83e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ from .logging import get_logger
_is_fp16_available = is_torch_npu_available() or is_torch_cuda_available()
try:
_is_bf16_available = is_torch_bf16_gpu_available()
_is_bf16_available = is_torch_bf16_gpu_available() or (is_torch_npu_available() and torch.npu.is_bf16_supported())
except Exception:
_is_bf16_available = False