Add supports_float64() to OmniPlatform and clean up MPS (#2488)
Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
This commit is contained in:
1 parent
368de99f08
commit
7a72f34ce4
7 files changed
+16
-12
No files matched your search
@@ -117,6 +117,10 @@ class OmniPlatform(Platform):
|
||||
def supports_cpu_offload(cls) -> bool:
|
||||
return True
|
||||
|
||||
@classmethod
|
||||
def supports_float64(cls) -> bool:
|
||||
return True
|
||||
|
||||
@classmethod
|
||||
def set_device_control_env_var(cls, devices: str | int | None) -> None:
|
||||
import os
|
||||
|
||||
@@ -81,6 +81,11 @@ class MUSAOmniPlatform(OmniPlatform, MUSAPlatformBase):
|
||||
"""MUSA supports torch.compile with inductor backend."""
|
||||
return True
|
||||
|
||||
@classmethod
|
||||
def supports_float64(cls) -> bool:
|
||||
"""MUSA does not support float64 yet."""
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def get_torch_device(cls, local_rank: int | None = None) -> torch.device:
|
||||
"""Get the torch device for MUSA platform.
|
||||
|
||||
Reference in new issue
Block a user