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 MOON baseline #2421

Merged
merged 58 commits into from
Oct 26, 2023
Merged

Add MOON baseline #2421

merged 58 commits into from
Oct 26, 2023

Conversation

QinbinLi
Copy link
Contributor

@QinbinLi QinbinLi commented Sep 26, 2023

Issue

Description

Related issues/PRs

Proposal

Explanation

Checklist

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

Any other comments?

@jafermarq jafermarq added the summer-of-reproducibility About a baseline for Summer of Reproducibility label Sep 26, 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 @QinbinLi,

I did a first pass through your MOON implementation using Flower. I was able to run the code, so that's great! I have left a few comments here and there. Mostly small things.

More critical is the way you are loading prev_model in the client's fit() method. It's not doing what I think you want to do (i.e. use the model the client sent back to the server in the previous round). Please take a look at my suggestion below on how to fix it.

Less critical, but also important:

  • Would it be possible to generate two plots showing fedprox vs moon? (as in Figures 6a,b in your paper)
  • Please rename the directory where the figures are added to _static (this is helpful to make your README to appear automatically in the documentation).

baselines/moon/README.md Outdated Show resolved Hide resolved
baselines/moon/README.md Outdated Show resolved Hide resolved
baselines/moon/README.md Outdated Show resolved Hide resolved
baselines/moon/README.md Outdated Show resolved Hide resolved
baselines/moon/README.md Show resolved Hide resolved
baselines/moon/moon/conf/cifar10.yaml Outdated Show resolved Hide resolved
baselines/moon/moon/client.py Outdated Show resolved Hide resolved
baselines/moon/moon/conf/cifar10.yaml Outdated Show resolved Hide resolved
baselines/moon/moon/conf/cifar100_100clients.yaml 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.

I few extra comments i forgot to add above

baselines/moon/pyproject.toml Show resolved Hide resolved
baselines/moon/pyproject.toml Outdated Show resolved Hide resolved
QinbinLi and others added 9 commits September 26, 2023 19:04
Co-authored-by: Javier <jafermarq@users.noreply.github.com>
Co-authored-by: Javier <jafermarq@users.noreply.github.com>
Co-authored-by: Javier <jafermarq@users.noreply.github.com>
Co-authored-by: Javier <jafermarq@users.noreply.github.com>
Co-authored-by: Javier <jafermarq@users.noreply.github.com>
@QinbinLi
Copy link
Contributor Author

Hi @jafermarq ,

I have updated the code according to your comments. I have added the results of Figure 8(a) (https://arxiv.org/pdf/2103.16257.pdf) using MOON. The experiment using FedProx failed multiple times due to insufficient memory (others are using the same machine) and I launched another machine to run it. I need about 2 days to finish it.

Is it necessary to run Figure 8(b)? Figure 8(b) is more time-consuming than Figure 8(a).

@jafermarq
Copy link
Contributor

Hi @QinbinLi, it's fine not including Fig 8(b). Ping me once the FedProx is added to your Fig8(a). If possible, could you make the figures to use larger font size (just so it's more readable in the README.md. Many thanks

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 @QinbinLi ,

You'll notice i pushed some changes (I did just some formatting). We can start merging your baseline once you have added the FedProx curve to your Fig8a below in the readme.

I think it would be great if you could add some comments to your models.train_moon() function (for instance state which line(s) doe each line in Algorithm 1 in your paper). This would be ideal for others trying to use (maybe even modify!) your MOON baseline. I left a comment below.

Also, I'm thinking is better to remove the log files in _static. They simply take too much space. If you are able to host these somewhere else, you are welcome to add a link to it in the README.md if you want.

Finally, I believe the client_states directory needs to be erased before running a new experiment, right? I see you remove it once the experiment is completed. But, what if the experiment crashes for some reason. We probably want to erase it before starting the simuilation again, right?

Please ping me when you managed to add the final result and go through my comments.

baselines/moon/README.md Outdated Show resolved Hide resolved
baselines/moon/moon/models.py Show resolved Hide resolved
baselines/moon/moon/client.py Show resolved Hide resolved
baselines/moon/moon/main.py Outdated Show resolved Hide resolved
baselines/moon/moon/main.py Outdated Show resolved Hide resolved
baselines/moon/_static/cifar100_moon_fedprox.png Outdated Show resolved Hide resolved
@QinbinLi
Copy link
Contributor Author

Hi @jafermarq ,

I have addressed your comments and pushed the new results. Thanks!

@jafermarq jafermarq changed the title MOON baseline Add MOON baseline Oct 22, 2023
jafermarq
jafermarq previously approved these changes Oct 22, 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.

@QinbinLi, great! thanks for the update. This is ready to be merged. I'll do this early in the week.

@danieljanes danieljanes enabled auto-merge (squash) October 26, 2023 14:39
@danieljanes danieljanes merged commit 262d5f7 into adap:main Oct 26, 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