Fix MUSA detection under torch.compile fullgraph (#41065)
Co-authored-by: Xiaoyu Zhang <1182563586@qq.com>
This commit is contained in:
co-authored by
Xiaoyu Zhang
parent
0e586fd12d
commit
f731e82f09
@@ -222,11 +222,13 @@ def is_cpu() -> bool:
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def is_musa() -> bool:
|
||||
if not hasattr(torch.version, "musa") or torch.version.musa is None:
|
||||
return False
|
||||
try:
|
||||
import torchada # noqa: F401
|
||||
except ImportError:
|
||||
return False
|
||||
return hasattr(torch.version, "musa") and torch.version.musa is not None
|
||||
return True
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
|
||||
Reference in New Issue
Block a user