-
Notifications
You must be signed in to change notification settings - Fork 83
fix: example restoration of CIFAR100 fedavg #251
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Zishan Ahmad <[email protected]>
Signed-off-by: Zishan Ahmad <[email protected]>
Signed-off-by: Zishan Ahmad <[email protected]>
Signed-off-by: Zishan Ahmad <[email protected]>
Signed-off-by: Zishan Ahmad <[email protected]>
Signed-off-by: Zishan Ahmad <[email protected]>
|
Welcome @Spiral-Memory! It looks like this is your first PR to kubeedge/ianvs 🎉 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Summary of Changes
Hello @Spiral-Memory, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request comprehensively addresses several critical issues within the federated_learning/fedavg example for CIFAR-100, making it fully functional and portable. It resolves problems stemming from hardcoded absolute paths, missing environmental requirements, a runtime bug, and a lack of clear documentation, ensuring new community members can easily use and reproduce the example.
Highlights
- Centralized Path Management: Introduced config.py to define and manage all file paths dynamically, eliminating hardcoded absolute paths across various configuration files.
- Enhanced Documentation: Added a README.md with clear, step-by-step instructions for setting up the environment, configuring paths, preparing the dataset, and running the example.
- Reproducible Environment: Included a requirements.txt file to specify necessary Python dependencies, ensuring a consistent and reproducible environment.
- Runtime Bug Fix: Corrected a critical bug in basemodel.py within the predict method, which previously prevented the example from running correctly.
- Path Standardization: Updated numerous YAML configuration files (algorithm.yaml, benchmarkingjob.yaml, testenv.yaml) to utilize placeholders managed by config.py for model, output, and dataset index paths.
- Utility Script Integration: Modified utils.py to leverage the new centralized path configurations for dataset processing and saving.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request is a great improvement for the federated_learning/fedavg example, making it portable and usable by removing hardcoded paths and adding necessary documentation and configuration. The introduction of config.py to manage paths and the fix in basemodel.py are excellent changes. I've found a critical issue in the new requirements.txt with an invalid package version, and a medium-severity issue in the new README.md where the instructions could be clearer. Addressing these will make the example fully functional as intended.
Signed-off-by: Zishan Ahmad <[email protected]>
Signed-off-by: Zishan Ahmad <[email protected]>
|
/assign |
|
@Spiral-Memory, have you tested out the changes? |
|
Can you please share screenshot of output? |
|
Hi @AryanNanda17, Yes, I've tested the changes when I made this change. I've attached a video in the PR description; please have a look at that. Thanks. |
|
Can you please run it for 2 epochs and then share? |
| You are now ready to run the FedAvg example. Ianvs is launched via its main entry point, taking the `benchmarkingjob.yaml` as input. From the project root, run: | ||
|
|
||
| ```bash | ||
| ianvs -f ./examples/cifar100/federated_learning/fedavg/benchmarkingjob.yaml |
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.
Please give sample output here.
What type of PR is this?
/kind bug
/kind cleanup
/kind documentation
What this PR does / why we need it:
This PR provides a comprehensive fix for the
federated_learning/fedavgexample, which was previously unusable for new community members. The example was plagued by a cascade of issues including hardcoded absolute paths, undocumented environmental requirements (Python 3.10), a runtime code bug, and a complete lack of documentation.This contribution restores the example to a fully functional and portable state. It introduces a centralized configuration system (
config.py) to dynamically handle file paths, adds aREADME.mdwith clear setup instructions, includes arequirements.txtfor a reproducible environment, and fixes the underlying code bug inbasemodel.py.Which issue(s) this PR fixes:
Fixes #252
2025-08-24.00-24-08.mp4