TaskD Agent APIs
The user-side code calls this function to initialize TaskD Agent.
Table 1 Parameter description
| Parameter | Type | Description |
|---|---|---|
| config | dict:{str : str} | Agent configuration information, including Agent configuration and network configuration. The keys include:
|
| cls | Specific instance type | This input parameter is used under the PyTorch framework and is a SimpleElasticAgent instance. It is not required for other frameworks. |
Table 2 Return value description
| Return Value Type | Description |
|---|---|
| bool | Indicates whether the initialization is successful.
|
The user-side code calls this function to start TaskD Agent.
None
Table 1 Return value description
| Return Value Type | Description |
|---|---|
| Varies | The return result is determined by the main execution logic of the Agent under the framework. Agents under different frameworks will have different return results after startup. For example, under the PyTorch framework, SimpleElasticAgent run() will return the training result. |
The user-side code calls this function to register a TaskD Agent callback function.
Table 1 Parameters
| Parameter | Type | Description |
|---|---|---|
| operator | str | Key for registering the callback function, such as START_ALL_WORKER. |
| func | callable | The corresponding callback function. |
Table 2 Return value description
| Return Value Type | Description |
|---|---|
| bool | Indicates whether the registration is successful.
|