-
Notifications
You must be signed in to change notification settings - Fork 214
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
[Feature] Refactor FedRunner, optimize trainer module and optimize CI #415
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
75dd470
merge action and refactor
rayrayraykk c023a95
rm codecov for now
rayrayraykk 0377791
update docstring
rayrayraykk 574a3ff
update API ref for xxbuidler
rayrayraykk ab4ccb6
fix minor bugs in test
rayrayraykk 1056b40
update docstring for builders
rayrayraykk f6a8ca0
fix minor bugs
rayrayraykk b85aa7b
fix minor bugs
rayrayraykk e1a0a32
roll back optimizer
rayrayraykk ba9d313
roll back for scheduler
rayrayraykk 782549a
update docstring for workers
rayrayraykk 6156ae2
update docstring for workers
rayrayraykk 4e76009
add docstring for data
rayrayraykk a761e28
fix typo
rayrayraykk 2e7ee2d
fix typo
rayrayraykk 68cd6d0
add doc string for monitor
rayrayraykk ab345a5
fix docstring in app
rayrayraykk 3303734
Add ut for trainer and fix some typos
rayrayraykk ac641e1
Merge branch 'master' into refactor_new
rayrayraykk b03d720
fix typo
rayrayraykk bc3a850
fix bug caused by merge
rayrayraykk 6a5ea83
fix utils
rayrayraykk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: CodeQL (Code Scanning) | ||
|
||
on: | ||
pull_request: | ||
branches: [ "master" ] | ||
schedule: | ||
- cron: '0 8 * * *' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'python' ] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:${{matrix.language}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: UnitTests for Distributed Mode | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
run: | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ['3.9'] | ||
torch-version: ['1.10.1'] | ||
torchvision-version: ['0.11.2'] | ||
torchaudio-version: ['0.10.1'] | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: '3.9' | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@master | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install PyTorch ${{ matrix.torch-version }}+cpu | ||
run: | | ||
pip install numpy typing-extensions dataclasses | ||
pip install torch==${{ matrix.torch-version}}+cpu torchvision==${{matrix.torchvision-version}}+cpu torchaudio==${{matrix.torchaudio-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html | ||
- name: Install FS | ||
run: | | ||
pip install -e .[test] | ||
- name: Test Distributed (LR on toy) | ||
run: | | ||
python scripts/distributed_scripts/gen_data.py | ||
python federatedscope/main.py --cfg scripts/distributed_scripts/distributed_configs/distributed_server.yaml & | ||
sleep 2 | ||
python federatedscope/main.py --cfg scripts/distributed_scripts/distributed_configs/distributed_client_1.yaml & | ||
sleep 2 | ||
python federatedscope/main.py --cfg scripts/distributed_scripts/distributed_configs/distributed_client_2.yaml & | ||
sleep 2 | ||
python federatedscope/main.py --cfg scripts/distributed_scripts/distributed_configs/distributed_client_3.yaml | ||
[ $? -eq 1 ] && exit 1 || echo "Passed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,91 @@ | ||
Core Module References | ||
======================= | ||
|
||
federatedscope.core.configs | ||
federatedscope.core.fed_runner | ||
----------------------- | ||
|
||
.. automodule:: federatedscope.core.configs | ||
.. automodule:: federatedscope.core.fed_runner | ||
:members: | ||
:private-members: | ||
|
||
federatedscope.core.workers | ||
----------------------- | ||
|
||
federatedscope.core.monitors | ||
.. automodule:: federatedscope.core.workers | ||
:members: | ||
:private-members: | ||
|
||
federatedscope.core.trainers | ||
----------------------- | ||
|
||
.. automodule:: federatedscope.core.monitors | ||
.. automodule:: federatedscope.core.trainers | ||
:members: | ||
:private-members: | ||
|
||
federatedscope.core.fed_runner | ||
federatedscope.core.data | ||
----------------------- | ||
|
||
.. automodule:: federatedscope.core.fed_runner | ||
.. automodule:: federatedscope.core.data.base_data | ||
:members: | ||
:private-members: | ||
.. automodule:: federatedscope.core.data.base_translator | ||
:members: | ||
:private-members: | ||
.. automodule:: federatedscope.core.data.dummy_translator | ||
:members: | ||
:private-members: | ||
.. automodule:: federatedscope.core.data.utils | ||
:members: | ||
|
||
federatedscope.core.worker | ||
federatedscope.core.splitters | ||
----------------------- | ||
.. automodule:: federatedscope.core.splitters | ||
:members: | ||
:private-members: | ||
.. automodule:: federatedscope.core.splitters.generic | ||
:members: | ||
:private-members: | ||
.. automodule:: federatedscope.core.splitters.graph | ||
:members: | ||
:private-members: | ||
|
||
.. automodule:: federatedscope.core.worker | ||
federatedscope.core.configs | ||
----------------------- | ||
|
||
.. automodule:: federatedscope.core.configs | ||
:members: | ||
:private-members: | ||
|
||
federatedscope.core.trainers | ||
|
||
federatedscope.core.monitors | ||
----------------------- | ||
|
||
.. automodule:: federatedscope.core.trainers | ||
.. automodule:: federatedscope.core.monitors | ||
:members: | ||
:private-members: | ||
|
||
federatedscope.core.aggregators | ||
----------------------- | ||
|
||
.. automodule:: federatedscope.core.aggregators | ||
:members: | ||
|
||
federatedscope.core.auxiliaries | ||
----------------------- | ||
|
||
.. autofunction:: federatedscope.core.auxiliaries.aggregator_builder.get_aggregator() | ||
.. autofunction:: federatedscope.core.auxiliaries.criterion_builder.get_criterion() | ||
.. autofunction:: federatedscope.core.auxiliaries.data_builder.get_data() | ||
.. autofunction:: federatedscope.core.auxiliaries.dataloader_builder.get_dataloader() | ||
.. autofunction:: federatedscope.core.auxiliaries.metric_builder.get_metric() | ||
.. autofunction:: federatedscope.core.auxiliaries.model_builder.get_model() | ||
.. autofunction:: federatedscope.core.auxiliaries.optimizer_builder.get_optimizer() | ||
.. autofunction:: federatedscope.core.auxiliaries.regularizer_builder.get_regularizer() | ||
.. autofunction:: federatedscope.core.auxiliaries.runner_builder.get_runner() | ||
.. autofunction:: federatedscope.core.auxiliaries.sampler_builder.get_sampler() | ||
.. autofunction:: federatedscope.core.auxiliaries.scheduler_builder.get_scheduler() | ||
.. autofunction:: federatedscope.core.auxiliaries.splitter_builder.get_splitter() | ||
.. autofunction:: federatedscope.core.auxiliaries.trainer_builder.get_trainer() | ||
.. autofunction:: federatedscope.core.auxiliaries.transform_builder.get_transform() | ||
.. autofunction:: federatedscope.core.auxiliaries.worker_builder.get_client_cls() | ||
.. autofunction:: federatedscope.core.auxiliaries.worker_builder.get_server_cls() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I am very appreciate for the work on providing unit test for distributed mode