Skip to main content

DevManager

_class _DevManager(devices : Union[List[int], int], backend_name ='')

Describes the device set on which the target model runs. For multi-device models, initialization must be performed using DevManager.

The DevManager class provides device management functionalities, including creating device manager instances and retrieving the number of devices. During initialization, it checks the status of the device manager, and if initialization fails, an exception will be raised.

Initializes a DevManager instance.

Parameters:

  • devices -- Device ID or a list of device IDs. Can be a single device ID (int) or a list of device IDs (List[int]).

  • backend_name -- The backend name, default is an empty string.

Raises:

RuntimeError -- If the device manager fails to initialize, a runtime error is raised.

Methods

__init__Initializes a DevManager instance.
dev_countRetrieve the number of available devices.
verifyVerify the accuracy of the device id.