Skip to content

Commit

Permalink
Change run_coordinator() to coordinate().
Browse files Browse the repository at this point in the history
  • Loading branch information
camille-004 committed Dec 5, 2024
1 parent cbae674 commit 59d3099
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/mnist/run_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
HTTPClient,
HTTPServer,
ModelManager,
run_coordinator,
coordinate,
)
from nanofed.data import load_mnist_data
from nanofed.models import MNISTModel
Expand Down Expand Up @@ -113,7 +113,7 @@ async def main():

# Run the coordinator and clients concurrently
await asyncio.gather(
run_coordinator(coordinator),
coordinate(coordinator),
run_client("client_1", "http://0.0.0.0:8080", data_dir),
run_client("client_2", "http://0.0.0.0:8080", data_dir),
run_client("client_3", "http://0.0.0.0:8080", data_dir),
Expand Down
4 changes: 2 additions & 2 deletions nanofed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from nanofed.orchestration import (
Coordinator,
CoordinatorConfig,
run_coordinator,
coordinate,
)
from nanofed.server import FedAvgAggregator, ModelManager
from nanofed.trainer import TorchTrainer
Expand All @@ -17,7 +17,7 @@
"CoordinatorConfig",
"FedAvgAggregator",
"ModelManager",
"run_coordinator",
"coordinate",
]


Expand Down
4 changes: 2 additions & 2 deletions nanofed/orchestration/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .coordinator import Coordinator, CoordinatorConfig
from .types import ClientInfo, RoundMetrics, RoundStatus, TrainingProgress
from .utils import run_coordinator
from .utils import coordinate

__all__ = [
"Coordinator",
Expand All @@ -9,5 +9,5 @@
"RoundMetrics",
"RoundStatus",
"TrainingProgress",
"run_coordinator",
"coordinate",
]
2 changes: 1 addition & 1 deletion nanofed/orchestration/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from nanofed.utils import Logger


async def run_coordinator(coordinator: Coordinator) -> None:
async def coordinate(coordinator: Coordinator) -> None:
"""Run the coordinator and consume training metrics.
This function continuously starts training rounds and processes
Expand Down

0 comments on commit 59d3099

Please sign in to comment.