TaskD Worker APIs

def init_taskd_worker(rank_id: int, upper_limit_of_disk_in_mb: int = 5000, framework: str = "pt") -> bool

Function Description

The user-side code calls this function to initialize TaskD Worker.

Parameters

Table 1 Input parameters

ParameterTypeDescription
rank_idintGlobal rank ID of the current training process.
upper_limit_of_disk_in_mbintUpper limit of storage space in the profiling folder that all training processes can use. The actual size fluctuates around this threshold, in MB. A non-negative value, defaulted to 5000.
frameworkstrAI framework used by the job.

Return Value

Return Value TypeDescription
boolIndicates whether the initialization is successful.
  • True: Initialization succeed.
  • False: Initialization failed.

def start_taskd_worker() -> bool

Function Description

The user-side code calls this function to start TaskD Worker.

Parameters

No input parameters.

Return Value

ParameterDescription
boolIndicates whether the initialization is successful.
  • True: Initialization succeed.
  • False: Initialization failed.

def destroy_taskd_worker() -> bool:

Function Description

The user-side code calls this function to destroy the TaskD Worker communication resources. This function must be used after init_taskd_worker is called.

Parameters

None

Return Value

Table 1 Return value

Return Value TypeDescription
boolIndicates whether the destruction was successful.
  • True: Destruction succeeded.
  • False: Destruction failed.