未验证 提交 3540ce74 编写于 作者: A Alex Hedges 提交者: GitHub

Check for bf16 support only if CUDA is available (#2049)

Co-authored-by: NMichael Wyatt <michaelwyatt@microsoft.com>
上级 559fb8e5
......@@ -235,7 +235,7 @@ if torch_available and torch.version.cuda is not None:
nccl_version = ".".join(str(torch.cuda.nccl.version())[:2])
else:
nccl_version = ".".join(map(str, torch.cuda.nccl.version()[:2]))
if hasattr(torch.cuda, 'is_bf16_supported'):
if hasattr(torch.cuda, 'is_bf16_supported') and torch.cuda.is_available():
bf16_support = torch.cuda.is_bf16_supported()
if torch_available and hasattr(torch.version, 'hip') and torch.version.hip is not None:
hip_version = ".".join(torch.version.hip.split('.')[:2])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册