Skip to content

Commit

Permalink
change federeated learning paradigm into planb mode
Browse files Browse the repository at this point in the history
Signed-off-by: Marchons <[email protected]>
  • Loading branch information
Marchons committed Sep 8, 2024
1 parent 2477a8b commit 3ef8cc1
Show file tree
Hide file tree
Showing 30 changed files with 771 additions and 328 deletions.
144 changes: 144 additions & 0 deletions EGG-INFO/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
Metadata-Version: 2.1
Name: ianvs
Version: 0.1.0
Summary: The ianvs package is designed to help algorithm developers better do algorithm test.
Home-page: https://github.com/kubeedge/ianvs
Author: MooreZheng
Maintainer: MooreZheng
Maintainer-email:
License: Apache License 2.0
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# Ianvs

[![CI](https://github.com/kubeedge/ianvs/workflows/CI/badge.svg?branch=main)](https://github.com/sedna/ianvs/actions)
[![LICENSE SCAN](https://app.fossa.com/api/projects/custom%2B32178%2Fgithub.com%2Fkubeedge%2Fianvs.svg?type=shield)](https://app.fossa.com/projects/custom%2B32178%2Fgithub.com%2Fkubeedge%2Fianvs?ref=badge_shield)
[![LICENSE](https://img.shields.io/github/license/kubeedge-sedna/ianvs.svg)](/LICENSE)

Ianvs is a distributed synergy AI benchmarking project incubated in KubeEdge SIG AI. Ianvs aims to test the performance of distributed synergy AI solutions following recognized standards, in order to facilitate more efficient and effective development. More detailedly, Ianvs prepares not only test cases with datasets and corresponding algorithms, but also benchmarking tools including simulation and hyper-parameter searching. Ianvs also reveals best practices for developers and end users with presentation tools including leaderboards and test reports.

## Scope

The distributed synergy AI benchmarking Ianvs aims to test the performance of distributed synergy AI solutions following recognized standards, in order to facilitate more efficient and effective development.

The scope of Ianvs includes

- Providing end-to-end benchmark toolkits across devices, edge nodes, and cloud nodes based on typical distributed-synergy AI paradigms and applications.
- Tools to manage test environment. For example, it would be necessary to support the CRUD (Create, Read, Update, and Delete) actions in test environments. Elements of such test environments include algorithm-wise and system-wise configuration.
- Tools to control test cases. Typical examples include paradigm templates, simulation tools, and hyper-parameter-based assistant tools.
- Tools to manage benchmark presentation, e.g., leaderboard and test report generation.
- Cooperation with other organizations or communities, e.g., in KubeEdge SIG AI, to establish comprehensive benchmarks and developed related applications, which can include but are not limited to
- Dataset collection, re-organization, and publication
- Formalized specifications, e.g., standards
- Holding competitions or coding events, e.g., open source promotion plan
- Maintaining solution leaderboards or certifications for commercial usage

## Architecture

The architectures and related concepts are shown in the below figure. The ianvs is designed to run **within a single node**. Critical components include

- Test Environment Manager: the CRUD of test environments serving for global usage
- Test Case Controller: control the runtime behavior of test cases like instance generation and vanish
- Generation Assistant: assist users to generate test cases based on certain rules or constraints, e.g., the range of parameters
- Simulation Controller: control the simulation process of edge-cloud synergy AI, including the instance generation and vanishment of simulation containers
- Story Manager: the output management and presentation of the test case, e.g., leaderboards

![](docs/guides/images/ianvs_arch.png)

More details on Ianvs components:

1. Test-Environment Manager supports the CRUD of Test environments, which basically includes
- Algorithm-wise configuration
- Public datasets
- Pre-processing algorithms
- Feature engineering algorithms
- Post-processing algorithms like metric computation
- System-wise configuration
- Overall architecture
- System constraints or budgets
- End-to-end cross-node
- Per node
2. Test-case Controller, which includes but is not limited to the following components
- Templates of common distributed-synergy-AI paradigms, which can help the developer to prepare their test case without too much effort. Such paradigms include edge-cloud synergy joint inference, incremental learning, federated learning, and lifelong learning.
- Simulation tools. Develop simulated test environments for test cases
- Other tools to assist test-case generation. For instance, prepare test cases based on a given range of hyper-parameters.
3. Story Manager, which includes but is not limited to the following components
- Leaderboard generation
- Test report generation

## Guides

### Documents

Documentation is located on [readthedoc.io](https://ianvs.readthedocs.io/). The documents include the quick start, guides, dataset descriptions, algorithms, user interfaces, stories, and roadmap.

### Installation

Follow the [Ianvs installation document](docs/guides/how-to-install-ianvs.md) to install Ianvs.

### Examples

- Scenario PCB-AoI:[Industrial Defect Detection on the PCB-AoI Dataset](docs/proposals/scenarios/industrial-defect-detection/pcb-aoi.md).

- Example PCB-AoI-1:[Testing single task learning in industrial defect detection](docs/proposals/test-reports/testing-single-task-learning-in-industrial-defect-detection-with-pcb-aoi.md).

- Example PCB-AoI-2:[Testing incremental learning in industrial defect detection](docs/proposals/test-reports/testing-incremental-learning-in-industrial-defect-detection-with-pcb-aoi.md).

- Scenario Cityscapes-Synthia: [Curb Detetion on Cityscapes-Synthia Dataset](docs/proposals/algorithms/lifelong-learning/Additional-documentation/curb_detetion_datasets.md)

- Example Cityscapes-Synthia-1: [Lifelong learning in semantic segmentation](examples/cityscapes-synthia/lifelong_learning_bench/semantic-segmentation/README.md)

- Example Cityscapes-Synthia-2: [Lifelong learning in curb detetion](examples/cityscapes-synthia/lifelong_learning_bench/curb-detection/README.md)

- Example Cityscapes-Synthia-3: [Scene based unknown task recognition in curb detetion](examples/cityscapes-synthia/scene-based-unknown-task-recognition/curb-detection/README.md)

- Example Cityscapes-Synthia-4: [Integrating GAN and Self-taught Learning into Ianvs Lifelong Learning](examples/cityscapes/lifelong_learning_bench/unseen_task_processing-GANwithSelfTaughtLearning/README.md)

- Scenario Cloud-Robotics: [Semantic Segmentation on Cloud-Robotics Dataset](docs/proposals/scenarios/Cloud-Robotics/Cloud-Robotics_zh.md)

- Example Cloud-Robotics-1: [Lifelong learning in semantic segmentation](examples/robot/lifelong_learning_bench/semantic-segmentation/README.md)

- Example Cloud-Robotics-2: [Class increment learning in semantic segmentation](examples/robot-cityscapes-synthia/lifelong_learning_bench/semantic-segmentation/README.md)

- Example Cloud-Robotics-3: [Lifelong learning in sam annotation](examples/robot/lifelong_learning_bench/sam_annotation/tutorial.md)

## Roadmap

- [2022 H2 Roadmap](docs/roadmap.md)

## Meeting

Routine Community Meeting for KubeEdge SIG AI runs weekly:

- Europe Time: **Thursdays at 16:30-17:30 Beijing Time**.
([Convert to your timezone.](https://www.thetimezoneconverter.com/?t=16%3A30&tz=GMT%2B8&))

Resources:

- [Meeting notes and agenda](https://docs.google.com/document/d/12n3kGUWTkAH4q2Wv5iCVGPTA_KRWav_eakbFrF9iAww/edit)
- [Meeting recordings](https://www.youtube.com/playlist?list=PLQtlO1kVWGXkRGkjSrLGEPJODoPb8s5FM)
- [Meeting link](https://zoom.us/j/4167237304)
- [Meeting Calendar](https://calendar.google.com/calendar/u/0/r?cid=Y19nODluOXAwOG05MzFiYWM3NmZsajgwZzEwOEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t) | [Subscribe](https://calendar.google.com/calendar/u/0/r?cid=OHJqazhvNTE2dmZ0ZTIxcWlidmxhZTNsajRAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ)

## Contact

<!--
If you need support, start with the [troubleshooting guide](./docs/troubleshooting.md), and work your way through the process that we've outlined.
-->

If you have questions, feel free to reach out to us in the following ways:

- [slack channel](https://kubeedge.io/docs/community/slack/)

## Contributing

If you're interested in being a contributor and want to get involved in developing the Ianvs code, please see [CONTRIBUTING](CONTRIBUTING.md) for details on submitting patches and the contribution workflow.

## License

Ianvs is under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.
61 changes: 61 additions & 0 deletions EGG-INFO/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
LICENSE
README.md
setup.py
core/__init__.py
core/__version__.py
core/cmd/__init__.py
core/cmd/benchmarking.py
core/cmd/obj/__init__.py
core/cmd/obj/benchmarkingjob.py
core/common/__init__.py
core/common/constant.py
core/common/log.py
core/common/utils.py
core/storymanager/__init__.py
core/storymanager/rank/__init__.py
core/storymanager/rank/rank.py
core/storymanager/visualization/__init__.py
core/storymanager/visualization/visualization.py
core/testcasecontroller/__init__.py
core/testcasecontroller/testcasecontroller.py
core/testcasecontroller/algorithm/__init__.py
core/testcasecontroller/algorithm/algorithm.py
core/testcasecontroller/algorithm/module/__init__.py
core/testcasecontroller/algorithm/module/module.py
core/testcasecontroller/algorithm/paradigm/__init__.py
core/testcasecontroller/algorithm/paradigm/base.py
core/testcasecontroller/algorithm/paradigm/sedna_federated_learning.py
core/testcasecontroller/algorithm/paradigm/federated_learning/__init__.py
core/testcasecontroller/algorithm/paradigm/federated_learning/federated_class_incremental_learning.py
core/testcasecontroller/algorithm/paradigm/federated_learning/federated_learning.py
core/testcasecontroller/algorithm/paradigm/incremental_learning/__init__.py
core/testcasecontroller/algorithm/paradigm/incremental_learning/incremental_learning.py
core/testcasecontroller/algorithm/paradigm/lifelong_learning/__init__.py
core/testcasecontroller/algorithm/paradigm/lifelong_learning/lifelong_learning.py
core/testcasecontroller/algorithm/paradigm/multiedge_inference/__init__.py
core/testcasecontroller/algorithm/paradigm/multiedge_inference/multiedge_inference.py
core/testcasecontroller/algorithm/paradigm/singletask_learning/__init__.py
core/testcasecontroller/algorithm/paradigm/singletask_learning/singletask_learning.py
core/testcasecontroller/algorithm/paradigm/singletask_learning/singletask_learning_active_boost.py
core/testcasecontroller/algorithm/paradigm/singletask_learning/singletask_learning_tta.py
core/testcasecontroller/generation_assistant/__init__.py
core/testcasecontroller/generation_assistant/generation_assistant.py
core/testcasecontroller/metrics/__init__.py
core/testcasecontroller/metrics/metrics.py
core/testcasecontroller/simulation/__init__.py
core/testcasecontroller/simulation/simulation.py
core/testcasecontroller/simulation_system_admin/__init__.py
core/testcasecontroller/simulation_system_admin/simulation_system_admin.py
core/testcasecontroller/testcase/__init__.py
core/testcasecontroller/testcase/testcase.py
core/testenvmanager/__init__.py
core/testenvmanager/dataset/__init__.py
core/testenvmanager/dataset/dataset.py
core/testenvmanager/dataset/utils.py
core/testenvmanager/testenv/__init__.py
core/testenvmanager/testenv/testenv.py
ianvs.egg-info/PKG-INFO
ianvs.egg-info/SOURCES.txt
ianvs.egg-info/dependency_links.txt
ianvs.egg-info/entry_points.txt
ianvs.egg-info/top_level.txt
1 change: 1 addition & 0 deletions EGG-INFO/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions EGG-INFO/entry_points.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[console_scripts]
ianvs = core.cmd.benchmarking:main
1 change: 1 addition & 0 deletions EGG-INFO/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
core
1 change: 1 addition & 0 deletions EGG-INFO/zip-safe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 2 additions & 1 deletion core/testcasecontroller/algorithm/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def __init__(self, name, config):
'non_iid_ratio': 0.6,
"label_data_ratio": 1.0
}

self.initial_model_url: str = ""
self.modules: list = []
self.modules_list = None
Expand All @@ -97,10 +98,10 @@ def paradigm(self, workspace: str, **kwargs):
"""

config = kwargs

# pylint: disable=C0103
for k, v in self.__dict__.items():
config.update({k: v})

if self.paradigm_type == ParadigmType.SINGLE_TASK_LEARNING.value:
return SingleTaskLearning(workspace, **config)

Expand Down
1 change: 1 addition & 0 deletions core/testcasecontroller/algorithm/module/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def get_module_instance(self, module_type):
function
"""
print(f'hyperparameters_list: {self.hyperparameters_list}')
class_factory_type = ClassType.GENERAL
if module_type in [ModuleType.HARD_EXAMPLE_MINING.value]:
class_factory_type = ClassType.HEM
Expand Down
14 changes: 4 additions & 10 deletions core/testcasecontroller/algorithm/paradigm/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@

from sedna.core.incremental_learning import IncrementalLearning
from sedna.core.lifelong_learning import LifelongLearning
from sedna.core.federated_learning import FederatedLearning
from core.common.constant import ModuleType, ParadigmType

from .sedna_federated_learning import FederatedLearning

class ParadigmBase:
"""
Expand Down Expand Up @@ -126,14 +125,9 @@ def build_paradigm_job(self, paradigm_type):
if paradigm_type == ParadigmType.MULTIEDGE_INFERENCE.value:
return self.modules_funcs.get(ModuleType.BASEMODEL.value)()

if paradigm_type == ParadigmType.FEDERATED_LEARNING.value:
agg_name, agg = self.module_instances.get(ModuleType.AGGREGATION.value)
if paradigm_type == ParadigmType.FEDERATED_LEARNING.value or paradigm_type == ParadigmType.FEDERATED_CLASS_INCREMENTAL_LEARNING.value:
return FederatedLearning(
estimator=self.module_instances.get(ModuleType.BASEMODEL.value),
aggregation= agg_name

estimator=self.module_instances.get(ModuleType.BASEMODEL.value)
)
# return self.module_instances.get(ModuleType.BASEMODEL.value)
if paradigm_type == ParadigmType.FEDERATED_CLASS_INCREMENTAL_LEARNING.value:
return self.module_instances.get(ModuleType.BASEMODEL.value)

return None
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.

# pylint: disable=missing-module-docstring
from .federeated_learning import FederatedLearning
from .federated_learning import FederatedLearning
from .federated_class_incremental_learning import FederatedClassIncrementalLearning
Loading

0 comments on commit 3ef8cc1

Please sign in to comment.