nvflare.edge.executors.simple_edge_executor module

class SimpleEdgeExecutor(updater_id, update_timeout=60)[source]

Bases: EdgeTaskExecutor

A very simple edge executor that only does aggregation

Constructor of EdgeTaskExecutor.

Parameters:
  • updater_id – ID of the updater

  • update_timeout – timeout for update messages sent to parent

  • learner_id – ID of the learner component. Optional.

convert_result(result: dict, current_task: TaskInfo, fl_ctx: FLContext) Shareable[source]

Convert result from device to shareable

convert_task(task_data: Shareable, current_task: TaskInfo, fl_ctx: FLContext) dict[source]

Convert task_data to a plain dict

process_edge_result_report(report: ResultReport, current_task: TaskInfo, fl_ctx: FLContext) ResultResponse[source]

Handle result report from device The report task_id may be different from current task_id. Let HAM deal with it

process_edge_selection_request(request: SelectionRequest, current_task: TaskInfo, fl_ctx: FLContext) SelectionResponse | None[source]

This is called to process an edge selection request sent from the edge device.

Parameters:
  • request – the request from edge device

  • current_task – the current pending task

  • fl_ctx – FLContext object

Returns: reply to the edge device

process_edge_task_request(request: TaskRequest, current_task: TaskInfo, fl_ctx: FLContext) TaskResponse[source]

Handle task request from device

task_ended(task: TaskInfo, fl_ctx: FLContext)[source]

This method is called when the current task is ended. Subclass can implement this method to finish task processing.

Parameters:
  • task – info of the task that is ended

  • fl_ctx – FLContext object

Returns: None

task_started(task: TaskInfo, fl_ctx: FLContext)[source]

This method is called when a task assignment is received from the controller. Subclass can implement this method to prepare for task processing.

Parameters:
  • task – info of the received task

  • fl_ctx – FLContext object

Returns: None