Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FedPer #2266

Merged
merged 152 commits into from
Nov 1, 2023
Merged

Add FedPer #2266

merged 152 commits into from
Nov 1, 2023

Conversation

WilliamLindskog
Copy link
Contributor

@WilliamLindskog WilliamLindskog commented Aug 30, 2023

@jafermarq I think I've set the PR to ready for review now. Let me know if something is missing.

Issue

"Ready for review implementation for FedPer (Federated Learning using Personalization Layers) for summer of reproducibility.

Description

Federated Learning with Personalization Layers has been implemented using ResNet34 and MobileNet-v1 for CIFAR10 and FLICKR-AES. The basics of this model is to only transfer local body layers to the server and not the head layers (basically the n layers at the end of a neural network).

Related issues/PRs

Proposal

I suggest a model manager and model split class that can manage the split between head and body layers, and process data accordingly. Moreover, an AggregateBodyPipeline serves FedPer accordingly and only aggregates body layers.

Explanation

The models.py file includes classes (1) ModelManager and (2) ModelSplit. These are called when creating new models in the folder /implemented_models. Since client states are destroyed after fit and evaluate functions, I store the client head layer values to reach them in the next round so that these are not initialized randomly every time.

Checklist

  • Implement proposed change
  • Write tests
  • Update documentation
  • Update changelog
  • Make CI checks pass
  • Ping maintainers on Slack (channel #contributions)

Any other comments?

@WilliamLindskog
Copy link
Contributor Author

Hi @jafermarq ,

Just did some minor updates to the code (mainly README from your comments). Please proceed as you pleases.

Best regards,
W

Copy link
Contributor

@jafermarq jafermarq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @WilliamLindskog,

I left some minor comments about the readme and pyproject.toml, also some suggestions for your run_figures.sh script.

I also took a closer look at the results for CIFAR-10. I think some revisiting to the training loop (including dataset augmentation and hyperparameters used) is needed because some results are some ~10% or more off from those in the paper. Is there some parts of your code you are less certain about ? or maybe some decisions you had to take because something wasn't fully described in the paper.

Happy to iterate further. Ping me if you want to discuss things.

baselines/fedper/README.md Outdated Show resolved Hide resolved
baselines/fedper/pyproject.toml Outdated Show resolved Hide resolved
baselines/fedper/fedper/run_figures.sh Outdated Show resolved Hide resolved
baselines/fedper/_static/mobile_plot_figure_2.png Outdated Show resolved Hide resolved
baselines/fedper/_static/resnet_plot_figure_2.png Outdated Show resolved Hide resolved
baselines/fedper/fedper/run_figures.sh Show resolved Hide resolved
@jafermarq jafermarq changed the title Implementation of FedPer - Summer of Reproducibility Add FedPer Oct 16, 2023
Copy link
Contributor

@jafermarq jafermarq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @WilliamLindskog ,

Just a minor comment. I spotted an issue in your run_figures.sh script when running the Flickr experiments.

baselines/fedper/fedper/run_figures.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@jafermarq jafermarq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilliamLindskog, this looks ready to be merged! Amazing work!

@jafermarq jafermarq enabled auto-merge (squash) October 31, 2023 20:40
@jafermarq jafermarq merged commit 3718f80 into adap:main Nov 1, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
summer-of-reproducibility About a baseline for Summer of Reproducibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants