nvflare.client.task_registry module¶
- class TaskRegistry(config: ClientConfig, rank: str | None = None, flare_agent: FlareAgent | None = None)[source]¶
Bases:
objectThis class is used to remember attributes that need to be shared for a user code.
For multi-process scenarios: - Only rank 0 process communicates with the FL server - Other ranks get task information through their training framework - Each rank maintains its own task state
- get_sys_info() Dict[source]¶
Gets NVFlare system information.
- Returns:
A dict of system information.
- get_task(timeout: float | None = None) Task | None[source]¶
Gets the cached received task.
- Parameters:
timeout (float, optional) – If specified, this call is blocked only for the specified amount of time. If not specified, this call is blocked forever until a task has been received or agent has been closed.
- Returns:
None if flare agent is None; or a Task object if task is available within timeout.
- property is_rank0: bool¶
Whether this is the rank 0 process.