p2pfl.management.cli module

CLI for the p2pfl platform.

class p2pfl.management.cli.ExampleInfo[source]

Bases: TypedDict

Information about an example.

description: str
path: str
p2pfl.management.cli.list_examples()[source]

List available examples.

Return type:

None

p2pfl.management.cli.login(url=None, token=None)[source]

Authenticate with the P2PFL Web Services platform.

This command will set the necessary environment variables for web logging.

Parameters:
  • url (str | None) – The P2PFL Web Services URL.

  • token (str | None) – Your API token.

Return type:

None

p2pfl.management.cli.remote()[source]

Interact with a remote node in the p2pfl network.

Return type:

None

p2pfl.management.cli.run(file_or_example)[source]

Run an experiment from a YAML configuration file or a predefined example name.

Parameters:

file_or_example (str)

Return type:

None

p2pfl.management.cli.run_variations(yaml_path, aggregators=None, seeds=None, nodes=None, rounds=None, epochs=None, topologies=None, partitioning=None, models=None, batch_sizes=None, param=None, output_dir=None, skip_existing=True, force=False, full_param_names=False)[source]

Run experiments with parameter variations for grid search and hyperparameter optimization.

Examples

# Run with different aggregators and seeds p2pfl run-variations config.yaml –aggregators FedAvg FedMedian –seeds 42 123

# Run with different network configurations p2pfl run-variations config.yaml –nodes 5 10 20 –topologies star ring full

# Run with custom parameters using dot notation p2pfl run-variations config.yaml –param experiment.dataset.batch_size=32,64,128

Parameters:
  • yaml_path (str)

  • aggregators (list[str] | None)

  • seeds (list[int] | None)

  • nodes (list[int] | None)

  • rounds (list[int] | None)

  • epochs (list[int] | None)

  • topologies (list[str] | None)

  • partitioning (list[str] | None)

  • models (list[str] | None)

  • batch_sizes (list[int] | None)

  • param (list[str] | None)

  • output_dir (str | None)

  • skip_existing (bool)

  • force (bool)

  • full_param_names (bool)

Return type:

None