nvflare.app_opt.p2p.executors.base_dist_opt_executor module¶
- class BaseDistOptExecutor[source]¶
Bases:
Executor,ABCBase class for peer-to-peer distributed optimization algorithm executors.
This class provides the foundational structure for executors that run P2P distributed optimization algorithms. It handles the configuration of the local network, execution flow based on tasks, and interaction with neighboring clients.
- id¶
Unique identifier for the client.
- Type:
int
- client_name¶
Name of the client.
- Type:
str
- config¶
Local configuration containing neighbor information.
- Type:
LocalConfig
- _weight¶
Weight assigned to the client in the network topology.
- Type:
float
- neighbors¶
List of neighboring clients.
- Type:
list[Neighbor]
Init FLComponent.
The FLComponent is the base class of all FL Components. (executors, controllers, responders, filters, aggregators, and widgets are all FLComponents)
FLComponents have the capability to handle and fire events and contain various methods for logging.
- execute(task_name: str, shareable: Shareable, fl_ctx: FLContext, abort_signal: Signal)[source]¶
Executes a task.
- Parameters:
task_name (str) – task name.
shareable (Shareable) – input shareable.
fl_ctx (FLContext) – fl context.
abort_signal (Signal) – signal to check during execution to determine whether this task is aborted.
- Returns:
An output shareable.