mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-06 19:40:28 +00:00
[feat] refactored extension module (#5298)
* [feat] refactored extension module * polish * polish * polish * polish * polish * polish * polish * polish * polish * polish
This commit is contained in:
@@ -48,6 +48,12 @@ class BaseAccelerator(ABC):
|
||||
# =======================
|
||||
# device APIs
|
||||
# =======================
|
||||
@abstractmethod
|
||||
def get_version(self) -> str:
|
||||
"""
|
||||
Return the version of the accelerator which torch is built against.
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def get_current_device(self) -> torch.device:
|
||||
"""
|
||||
@@ -66,6 +72,7 @@ class BaseAccelerator(ABC):
|
||||
Bind the current process to a device.
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def get_device_name(self, device: Union[torch.device, int]) -> str:
|
||||
"""
|
||||
Return the name of the device.
|
||||
|
Reference in New Issue
Block a user