FedML-AI / FedML

FEDML - The unified and scalable ML library for large-scale distributed training, model serving, and federated learning. FEDML Launch, a cross-cloud scheduler, further enables running any AI jobs on any GPU cloud or on-premise cluster. Built on this library, TensorOpera AI (https://TensorOpera.ai) is your generative AI platform at scale.
https://TensorOpera.ai
Apache License 2.0
4.19k stars 786 forks source link

How do different algorithms work? #660

Open caozhantao opened 1 year ago

caozhantao commented 1 year ago

Hello,I want to ask for a help: In the "main_fedml_image_segmentation. py" file of the fedcv module, "SegmentationTrainer. py" and "SegmentationAggregator. py" under the "image_segmentation/trainer" module are imported during training. Suppose I modify different algorithms in "fedml_config. yaml", such as FedAvg, FedOpt, FedProx, but still use the same SegmentationTrainer and SegmentationAggregator, without any difference? How should different algorithms be implemented? In fedcv/segmentation, how do the algorithms in fedml/simulation/mpi work? They are all the same?

Adeelbek commented 1 year ago

First of all look at these files and make sure your code is actually going into the right path as you change the algorithm.

1) python/fedml/cross_silo/fedml_server.py 2) python/fedml/ml/aggregator/agg_operator.py

In the second file, you may see various algorithms which may take action once you change the algorithm in a config file. In the first file, you might wanna create additional conditions to activate your new algorithm hence this file only has conditions for two algorithms (FedAvg and LSA).

P.S. I don;t know what LSA is actually :-)

fedml-dimitris commented 1 year ago

@caozhantao Were you able to resolve your issue based on @Adeelbek's suggestion?