Fix test for BF16 detection (#17803)

This commit is contained in:
Sylvain Gugger 2022-06-21 12:31:15 -04:00 committed by GitHub
parent 7cced021fa
commit ef23fae596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1042,7 +1042,7 @@ class TrainingArguments:
if self.no_cuda and not is_torch_bf16_cpu_available():
# cpu
raise ValueError("Your setup doesn't support bf16/cpu. You need torch>=1.10")
elif not is_torch_bf16_gpu_available():
elif not self.no_cuda and not is_torch_bf16_gpu_available():
# gpu
raise ValueError(
"Your setup doesn't support bf16/gpu. You need torch>=1.10, using Ampere GPU with cuda>=11.0"