-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adding FedProx as another model example #161
Conversation
for more information, see https://pre-commit.ci
@@ -1,37 +0,0 @@ | |||
"""Common functions and definitions for servers.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module has been renamed to models.py
, not sure why it's not showing as renamed here.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #161 +/- ##
==========================================
+ Coverage 94.29% 94.65% +0.35%
==========================================
Files 25 24 -1
Lines 2647 2711 +64
Branches 149 149
==========================================
+ Hits 2496 2566 +70
+ Misses 151 145 -6 ☔ View full report in Codecov by Sentry. |
@@ -0,0 +1,213 @@ | |||
"""Functions and definitions for server models.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the old common.py
but with a lot of added functionality like the ServerFactory
definition and the functions to construct the servers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are really thorough and I like the refactors you made. However, I worry that we're too tightly coupling model, dataset, server, and clients with the factories such that for every new combination of these, we'll have to add in a new enum entry etc?
@@ -45,13 +49,36 @@ def parse(cls, config_json_str: str) -> Dict[str, Any]: | |||
return config | |||
|
|||
|
|||
class FedProxConfigParser(BasicConfigParser): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice. It feels like a user should specify an over-arching approach in the configuration that dictates what parser to use some how.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on our conversations about next steps in the refactors and flexibility with the various components required to designate a full set of client/server definitions, I think we're good to merge this in and move to those ideas. 🙂
PR Type
Feature
Short Description
Clickup Ticket(s): https://app.clickup.com/t/868caa1b3
Adding
MNIST with FedProx
as another option for a model in order to have a more compelling demo.Some refactorings were necessary to make it work because we were hardcoding the
FedAvg
strategy and theFlServer
. Both of those are different for FedProx, so some things had to be moved around and made more flexible. Here is a summary of changes:florist.api.servers.common
module toflorist.api.servers.models
MNIST
model toMNIST with FedAvg
ServerFactory
class that will provide a way to instantiate the "server constructor" for each one of the models.get_fedavg_server
, and created aget_fedprox_server
function which will make FedProx's strategy and serverFedProxConfigParser
with the required config attributes for FedProxTests Added
Fully unit and integration tested