-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Refactor FedRunner, optimize trainer module and optimize CI (…
- Loading branch information
1 parent
67406a6
commit 1001d54
Showing
144 changed files
with
3,837 additions
and
1,313 deletions.
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.