From 940978800d23dbe4e905efe9b1b526bf938b55da Mon Sep 17 00:00:00 2001 From: Shailesh Tanwar <135304487+tanwarsh@users.noreply.github.com> Date: Sun, 2 Feb 2025 21:54:14 +0530 Subject: [PATCH] Nested Workspaces template (#1322) * code changes Signed-off-by: yes * code changes Signed-off-by: yes * code changes Signed-off-by: yes * code changes Signed-off-by: yes * code changes Signed-off-by: yes * code changes Signed-off-by: yes * code changes Signed-off-by: yes * code changes Signed-off-by: yes * code changes Signed-off-by: yes * code change Signed-off-by: yes * code change Signed-off-by: yes * model name change Signed-off-by: yes * model name change Signed-off-by: yes * model name change Signed-off-by: yes * code changes Signed-off-by: yes --------- Signed-off-by: yes --- .github/workflows/straggler-handling.yml | 2 +- .github/workflows/task_runner_basic_e2e.yml | 22 +++++++++---------- .../task_runner_dockerized_ws_e2e.yml | 8 +++---- .../workflows/task_runner_fedeval_dws_e2e.yml | 6 ++--- .github/workflows/task_runner_fedeval_e2e.yml | 12 +++++----- .github/workflows/taskrunner.yml | 2 +- .../workflows/taskrunner_eden_pipeline.yml | 2 +- .../workflows/tr_docker_gramine_direct.yml | 2 +- .github/workflows/tr_docker_native.yml | 2 +- .github/workflows/ubuntu.yml | 2 +- .github/workflows/windows.yml | 2 +- Jenkinsfile | 19 +++++++--------- docs/about/features_index/fed_eval.rst | 8 +++---- docs/about/features_index/taskrunner.rst | 14 ++++++------ .../advanced_topics/log_metric_callback.rst | 2 +- .../straggler_handling_algorithms.rst | 2 +- docs/releases.md | 6 ++--- docs/tutorials/taskrunner.ipynb | 2 +- .../.workspace | 0 .../2dunet}/.workspace | 0 .../{keras_2dunet => keras/2dunet}/README.md | 0 .../2dunet}/plan/cols.yaml | 0 .../2dunet}/plan/data.yaml | 0 .../2dunet}/plan/defaults | 0 .../2dunet}/plan/plan.yaml | 0 .../2dunet}/requirements.txt | 0 .../2dunet}/src/__init__.py | 0 .../2dunet}/src/brats_utils.py | 0 .../2dunet}/src/dataloader.py | 0 .../2dunet}/src/nii_reader.py | 0 .../2dunet}/src/taskrunner.py | 0 .../{keras_nlp => keras/mnist}/.workspace | 0 .../mnist}/plan/cols.yaml | 0 .../mnist}/plan/data.yaml | 0 .../mnist}/plan/defaults | 0 .../mnist}/plan/plan.yaml | 0 .../mnist}/requirements.txt | 0 .../mnist}/src/__init__.py | 0 .../mnist}/src/dataloader.py | 0 .../mnist}/src/mnist_utils.py | 0 .../mnist}/src/taskrunner.py | 0 .../nlp}/.workspace | 0 .../{keras_nlp => keras/nlp}/plan/cols.yaml | 0 .../{keras_nlp => keras/nlp}/plan/data.yaml | 0 .../{keras_nlp => keras/nlp}/plan/plan.yaml | 0 .../{keras_nlp => keras/nlp}/requirements.txt | 0 .../{keras_nlp => keras/nlp}/src/__init__.py | 0 .../nlp}/src/dataloader.py | 0 .../nlp}/src/dataloader_utils.py | 0 .../nlp}/src/taskrunner.py | 0 .../histology}/.workspace | 0 .../histology}/plan/cols.yaml | 0 .../histology}/plan/data.yaml | 0 .../histology}/plan/plan.yaml | 0 .../histology}/requirements.txt | 0 .../histology}/src/__init__.py | 0 .../histology}/src/dataloader.py | 0 .../histology}/src/taskrunner.py | 0 .../histology_fedcurv}/.workspace | 0 .../histology_fedcurv}/README.md | 4 ++-- .../histology_fedcurv}/plan/cols.yaml | 0 .../histology_fedcurv}/plan/data.yaml | 0 .../histology_fedcurv}/plan/plan.yaml | 0 .../histology_fedcurv}/requirements.txt | 0 .../histology_fedcurv}/src/__init__.py | 0 .../histology_fedcurv}/src/dataloader.py | 0 .../histology_fedcurv}/src/taskrunner.py | 0 .../horovod}/.workspace | 0 .../horovod}/LLM_Horovod.MD | 6 ++--- .../horovod}/plan/cols.yaml | 0 .../horovod}/plan/data.yaml | 0 .../horovod}/plan/defaults | 0 .../horovod}/plan/plan.yaml | 0 .../horovod}/requirements.txt | 0 .../horovod}/setup_env.sh | 2 +- .../horovod}/src/InHorovodLLMTrainer.py | 0 .../horovod}/src/InHorovodrun.py | 0 .../horovod}/src/__init__.py | 0 .../horovod}/src/emotion_utils.py | 0 .../horovod}/src/model_utils.py | 0 .../horovod}/src/pt_model.py | 0 .../horovod}/src/ptemotion_inmemory.py | 0 .../mnist}/.workspace | 0 .../mnist}/README.md | 4 ++-- .../mnist}/plan/cols.yaml | 0 .../mnist}/plan/data.yaml | 0 .../mnist}/plan/defaults | 0 .../mnist}/plan/plan.yaml | 0 .../mnist}/requirements.txt | 0 .../mnist}/src/__init__.py | 0 .../mnist}/src/cnn_model.py | 0 .../mnist}/src/dataloader.py | 0 .../mnist}/src/taskrunner.py | 0 .../torch/mnist_eden_compression/.workspace | 2 ++ .../mnist_eden_compression}/plan/cols.yaml | 0 .../mnist_eden_compression}/plan/data.yaml | 0 .../mnist_eden_compression}/plan/defaults | 0 .../mnist_eden_compression}/plan/plan.yaml | 0 .../mnist_eden_compression}/requirements.txt | 0 .../mnist_eden_compression}/src/__init__.py | 0 .../src/mnist_utils.py | 0 .../mnist_eden_compression}/src/pt_cnn.py | 0 .../src/ptmnist_inmemory.py | 0 .../torch/mnist_fed_eval/.workspace | 2 ++ .../mnist_fed_eval}/plan/cols.yaml | 0 .../mnist_fed_eval}/plan/data.yaml | 0 .../mnist_fed_eval}/plan/defaults | 0 .../mnist_fed_eval}/plan/plan.yaml | 0 .../mnist_fed_eval}/requirements.txt | 0 .../mnist_fed_eval}/src/__init__.py | 0 .../mnist_fed_eval}/src/mnist_utils.py | 0 .../mnist_fed_eval}/src/pt_cnn.py | 0 .../mnist_fed_eval}/src/ptmnist_inmemory.py | 0 .../torch/mnist_straggler_check/.workspace | 2 ++ .../mnist_straggler_check}/plan/cols.yaml | 0 .../mnist_straggler_check}/plan/data.yaml | 0 .../mnist_straggler_check}/plan/defaults | 0 .../mnist_straggler_check}/plan/plan.yaml | 0 .../mnist_straggler_check}/requirements.txt | 0 .../mnist_straggler_check}/src/__init__.py | 0 .../mnist_straggler_check}/src/mnist_utils.py | 0 .../mnist_straggler_check}/src/pt_cnn.py | 0 .../src/ptmnist_inmemory.py | 0 .../template}/.workspace | 0 .../template}/plan/cols.yaml | 0 .../template}/plan/data.yaml | 0 .../template}/plan/defaults | 0 .../template}/plan/plan.yaml | 0 .../template}/requirements.txt | 0 .../template}/src/__init__.py | 0 .../template}/src/dataloader.py | 0 .../template}/src/taskrunner.py | 0 openfl-workspace/torch/unet_kvasir/.workspace | 2 ++ .../unet_kvasir}/plan/cols.yaml | 0 .../unet_kvasir}/plan/data.yaml | 0 .../unet_kvasir}/plan/defaults | 0 .../unet_kvasir}/plan/plan.yaml | 0 .../unet_kvasir}/requirements.txt | 0 .../unet_kvasir}/src/__init__.py | 0 .../unet_kvasir}/src/dataloader.py | 0 .../unet_kvasir}/src/pt_unet_parts.py | 0 .../unet_kvasir}/src/taskrunner.py | 0 openfl-workspace/xgb_higgs/.workspace | 2 ++ openfl/interface/workspace.py | 14 +++++++----- openfl/native/native.py | 3 +-- tests/end_to_end/README.md | 8 +++---- tests/end_to_end/utils/conftest_helper.py | 2 +- tests/end_to_end/utils/constants.py | 8 +++---- tests/end_to_end/utils/federation_helper.py | 4 ++-- tests/end_to_end/utils/summary_helper.py | 2 +- tests/github/test_double_ws_export.py | 2 +- tests/github/test_gandlf.py | 2 +- tests/github/test_hello_federation.py | 13 ++++++----- 153 files changed, 106 insertions(+), 93 deletions(-) rename openfl-workspace/{keras_2dunet => gandlf_seg_test}/.workspace (100%) rename openfl-workspace/{keras_cnn_mnist => keras/2dunet}/.workspace (100%) rename openfl-workspace/{keras_2dunet => keras/2dunet}/README.md (100%) rename openfl-workspace/{keras_2dunet => keras/2dunet}/plan/cols.yaml (100%) rename openfl-workspace/{keras_2dunet => keras/2dunet}/plan/data.yaml (100%) rename openfl-workspace/{keras_2dunet => keras/2dunet}/plan/defaults (100%) rename openfl-workspace/{keras_2dunet => keras/2dunet}/plan/plan.yaml (100%) rename openfl-workspace/{keras_2dunet => keras/2dunet}/requirements.txt (100%) rename openfl-workspace/{keras_2dunet => keras/2dunet}/src/__init__.py (100%) rename openfl-workspace/{keras_2dunet => keras/2dunet}/src/brats_utils.py (100%) rename openfl-workspace/{keras_2dunet => keras/2dunet}/src/dataloader.py (100%) rename openfl-workspace/{keras_2dunet => keras/2dunet}/src/nii_reader.py (100%) rename openfl-workspace/{keras_2dunet => keras/2dunet}/src/taskrunner.py (100%) rename openfl-workspace/{keras_nlp => keras/mnist}/.workspace (100%) rename openfl-workspace/{keras_cnn_mnist => keras/mnist}/plan/cols.yaml (100%) rename openfl-workspace/{keras_cnn_mnist => keras/mnist}/plan/data.yaml (100%) rename openfl-workspace/{keras_cnn_mnist => keras/mnist}/plan/defaults (100%) rename openfl-workspace/{keras_cnn_mnist => keras/mnist}/plan/plan.yaml (100%) rename openfl-workspace/{keras_cnn_mnist => keras/mnist}/requirements.txt (100%) rename openfl-workspace/{keras_cnn_mnist => keras/mnist}/src/__init__.py (100%) rename openfl-workspace/{keras_cnn_mnist => keras/mnist}/src/dataloader.py (100%) rename openfl-workspace/{keras_cnn_mnist => keras/mnist}/src/mnist_utils.py (100%) rename openfl-workspace/{keras_cnn_mnist => keras/mnist}/src/taskrunner.py (100%) rename openfl-workspace/{torch_cnn_mnist_eden_compression => keras/nlp}/.workspace (100%) rename openfl-workspace/{keras_nlp => keras/nlp}/plan/cols.yaml (100%) rename openfl-workspace/{keras_nlp => keras/nlp}/plan/data.yaml (100%) rename openfl-workspace/{keras_nlp => keras/nlp}/plan/plan.yaml (100%) rename openfl-workspace/{keras_nlp => keras/nlp}/requirements.txt (100%) rename openfl-workspace/{keras_nlp => keras/nlp}/src/__init__.py (100%) rename openfl-workspace/{keras_nlp => keras/nlp}/src/dataloader.py (100%) rename openfl-workspace/{keras_nlp => keras/nlp}/src/dataloader_utils.py (100%) rename openfl-workspace/{keras_nlp => keras/nlp}/src/taskrunner.py (100%) rename openfl-workspace/{torch_cnn_mnist_fed_eval => torch/histology}/.workspace (100%) rename openfl-workspace/{torch_cnn_histology => torch/histology}/plan/cols.yaml (100%) rename openfl-workspace/{torch_cnn_histology => torch/histology}/plan/data.yaml (100%) rename openfl-workspace/{torch_cnn_histology => torch/histology}/plan/plan.yaml (100%) rename openfl-workspace/{torch_cnn_histology => torch/histology}/requirements.txt (100%) rename openfl-workspace/{torch_cnn_histology => torch/histology}/src/__init__.py (100%) rename openfl-workspace/{torch_cnn_histology => torch/histology}/src/dataloader.py (100%) rename openfl-workspace/{torch_cnn_histology => torch/histology}/src/taskrunner.py (100%) rename openfl-workspace/{torch_cnn_mnist_straggler_check => torch/histology_fedcurv}/.workspace (100%) rename openfl-workspace/{torch_cnn_histology_fedcurv => torch/histology_fedcurv}/README.md (86%) rename openfl-workspace/{torch_cnn_histology_fedcurv => torch/histology_fedcurv}/plan/cols.yaml (100%) rename openfl-workspace/{torch_cnn_histology_fedcurv => torch/histology_fedcurv}/plan/data.yaml (100%) rename openfl-workspace/{torch_cnn_histology_fedcurv => torch/histology_fedcurv}/plan/plan.yaml (100%) rename openfl-workspace/{torch_cnn_histology_fedcurv => torch/histology_fedcurv}/requirements.txt (100%) rename openfl-workspace/{torch_cnn_histology_fedcurv => torch/histology_fedcurv}/src/__init__.py (100%) rename openfl-workspace/{torch_cnn_histology_fedcurv => torch/histology_fedcurv}/src/dataloader.py (100%) rename openfl-workspace/{torch_cnn_histology_fedcurv => torch/histology_fedcurv}/src/taskrunner.py (100%) rename openfl-workspace/{torch_llm_horovod => torch/horovod}/.workspace (100%) rename openfl-workspace/{torch_llm_horovod => torch/horovod}/LLM_Horovod.MD (92%) rename openfl-workspace/{torch_cnn_mnist_eden_compression => torch/horovod}/plan/cols.yaml (100%) rename openfl-workspace/{torch_cnn_mnist_eden_compression => torch/horovod}/plan/data.yaml (100%) rename openfl-workspace/{torch_cnn_mnist_eden_compression => torch/horovod}/plan/defaults (100%) rename openfl-workspace/{torch_llm_horovod => torch/horovod}/plan/plan.yaml (100%) rename openfl-workspace/{torch_llm_horovod => torch/horovod}/requirements.txt (100%) rename openfl-workspace/{torch_llm_horovod => torch/horovod}/setup_env.sh (72%) rename openfl-workspace/{torch_llm_horovod => torch/horovod}/src/InHorovodLLMTrainer.py (100%) rename openfl-workspace/{torch_llm_horovod => torch/horovod}/src/InHorovodrun.py (100%) rename openfl-workspace/{torch_cnn_mnist_eden_compression => torch/horovod}/src/__init__.py (100%) rename openfl-workspace/{torch_llm_horovod => torch/horovod}/src/emotion_utils.py (100%) rename openfl-workspace/{torch_llm_horovod => torch/horovod}/src/model_utils.py (100%) rename openfl-workspace/{torch_llm_horovod => torch/horovod}/src/pt_model.py (100%) rename openfl-workspace/{torch_llm_horovod => torch/horovod}/src/ptemotion_inmemory.py (100%) rename openfl-workspace/{torch_unet_kvasir => torch/mnist}/.workspace (100%) rename openfl-workspace/{torch_cnn_mnist => torch/mnist}/README.md (97%) rename openfl-workspace/{torch_cnn_mnist => torch/mnist}/plan/cols.yaml (100%) rename openfl-workspace/{torch_cnn_mnist => torch/mnist}/plan/data.yaml (100%) rename openfl-workspace/{torch_cnn_mnist => torch/mnist}/plan/defaults (100%) rename openfl-workspace/{torch_cnn_mnist => torch/mnist}/plan/plan.yaml (100%) rename openfl-workspace/{torch_cnn_mnist => torch/mnist}/requirements.txt (100%) rename openfl-workspace/{torch_cnn_mnist => torch/mnist}/src/__init__.py (100%) rename openfl-workspace/{torch_cnn_mnist => torch/mnist}/src/cnn_model.py (100%) rename openfl-workspace/{torch_cnn_mnist => torch/mnist}/src/dataloader.py (100%) rename openfl-workspace/{torch_cnn_mnist => torch/mnist}/src/taskrunner.py (100%) create mode 100644 openfl-workspace/torch/mnist_eden_compression/.workspace rename openfl-workspace/{torch_cnn_mnist_fed_eval => torch/mnist_eden_compression}/plan/cols.yaml (100%) rename openfl-workspace/{torch_cnn_mnist_fed_eval => torch/mnist_eden_compression}/plan/data.yaml (100%) rename openfl-workspace/{torch_cnn_mnist_fed_eval => torch/mnist_eden_compression}/plan/defaults (100%) rename openfl-workspace/{torch_cnn_mnist_eden_compression => torch/mnist_eden_compression}/plan/plan.yaml (100%) rename openfl-workspace/{torch_cnn_mnist_eden_compression => torch/mnist_eden_compression}/requirements.txt (100%) rename openfl-workspace/{torch_cnn_mnist_fed_eval => torch/mnist_eden_compression}/src/__init__.py (100%) rename openfl-workspace/{torch_cnn_mnist_eden_compression => torch/mnist_eden_compression}/src/mnist_utils.py (100%) rename openfl-workspace/{torch_cnn_mnist_eden_compression => torch/mnist_eden_compression}/src/pt_cnn.py (100%) rename openfl-workspace/{torch_cnn_mnist_eden_compression => torch/mnist_eden_compression}/src/ptmnist_inmemory.py (100%) create mode 100644 openfl-workspace/torch/mnist_fed_eval/.workspace rename openfl-workspace/{torch_cnn_mnist_straggler_check => torch/mnist_fed_eval}/plan/cols.yaml (100%) rename openfl-workspace/{torch_cnn_mnist_straggler_check => torch/mnist_fed_eval}/plan/data.yaml (100%) rename openfl-workspace/{torch_cnn_mnist_straggler_check => torch/mnist_fed_eval}/plan/defaults (100%) rename openfl-workspace/{torch_cnn_mnist_fed_eval => torch/mnist_fed_eval}/plan/plan.yaml (100%) rename openfl-workspace/{torch_cnn_mnist_fed_eval => torch/mnist_fed_eval}/requirements.txt (100%) rename openfl-workspace/{torch_cnn_mnist_straggler_check => torch/mnist_fed_eval}/src/__init__.py (100%) rename openfl-workspace/{torch_cnn_mnist_fed_eval => torch/mnist_fed_eval}/src/mnist_utils.py (100%) rename openfl-workspace/{torch_cnn_mnist_fed_eval => torch/mnist_fed_eval}/src/pt_cnn.py (100%) rename openfl-workspace/{torch_cnn_mnist_fed_eval => torch/mnist_fed_eval}/src/ptmnist_inmemory.py (100%) create mode 100644 openfl-workspace/torch/mnist_straggler_check/.workspace rename openfl-workspace/{torch_llm_horovod => torch/mnist_straggler_check}/plan/cols.yaml (100%) rename openfl-workspace/{torch_llm_horovod => torch/mnist_straggler_check}/plan/data.yaml (100%) rename openfl-workspace/{torch_llm_horovod => torch/mnist_straggler_check}/plan/defaults (100%) rename openfl-workspace/{torch_cnn_mnist_straggler_check => torch/mnist_straggler_check}/plan/plan.yaml (100%) rename openfl-workspace/{torch_cnn_mnist_straggler_check => torch/mnist_straggler_check}/requirements.txt (100%) rename openfl-workspace/{torch_llm_horovod => torch/mnist_straggler_check}/src/__init__.py (100%) rename openfl-workspace/{torch_cnn_mnist_straggler_check => torch/mnist_straggler_check}/src/mnist_utils.py (100%) rename openfl-workspace/{torch_cnn_mnist_straggler_check => torch/mnist_straggler_check}/src/pt_cnn.py (100%) rename openfl-workspace/{torch_cnn_mnist_straggler_check => torch/mnist_straggler_check}/src/ptmnist_inmemory.py (100%) rename openfl-workspace/{torch_template => torch/template}/.workspace (100%) rename openfl-workspace/{torch_template => torch/template}/plan/cols.yaml (100%) rename openfl-workspace/{torch_template => torch/template}/plan/data.yaml (100%) rename openfl-workspace/{torch_template => torch/template}/plan/defaults (100%) rename openfl-workspace/{torch_template => torch/template}/plan/plan.yaml (100%) rename openfl-workspace/{torch_template => torch/template}/requirements.txt (100%) rename openfl-workspace/{torch_template => torch/template}/src/__init__.py (100%) rename openfl-workspace/{torch_template => torch/template}/src/dataloader.py (100%) rename openfl-workspace/{torch_template => torch/template}/src/taskrunner.py (100%) create mode 100644 openfl-workspace/torch/unet_kvasir/.workspace rename openfl-workspace/{torch_unet_kvasir => torch/unet_kvasir}/plan/cols.yaml (100%) rename openfl-workspace/{torch_unet_kvasir => torch/unet_kvasir}/plan/data.yaml (100%) rename openfl-workspace/{torch_unet_kvasir => torch/unet_kvasir}/plan/defaults (100%) rename openfl-workspace/{torch_unet_kvasir => torch/unet_kvasir}/plan/plan.yaml (100%) rename openfl-workspace/{torch_unet_kvasir => torch/unet_kvasir}/requirements.txt (100%) rename openfl-workspace/{torch_unet_kvasir => torch/unet_kvasir}/src/__init__.py (100%) rename openfl-workspace/{torch_unet_kvasir => torch/unet_kvasir}/src/dataloader.py (100%) rename openfl-workspace/{torch_unet_kvasir => torch/unet_kvasir}/src/pt_unet_parts.py (100%) rename openfl-workspace/{torch_unet_kvasir => torch/unet_kvasir}/src/taskrunner.py (100%) create mode 100644 openfl-workspace/xgb_higgs/.workspace diff --git a/.github/workflows/straggler-handling.yml b/.github/workflows/straggler-handling.yml index b5bb6996ce..5dba77278e 100644 --- a/.github/workflows/straggler-handling.yml +++ b/.github/workflows/straggler-handling.yml @@ -35,4 +35,4 @@ jobs: pip install . - name: Test Straggler Handling Interface run: | - python -m tests.github.test_hello_federation --template torch_cnn_mnist_straggler_check --fed_workspace aggregator --col1 col1 --col2 col2 --rounds-to-train 3 + python -m tests.github.test_hello_federation --template torch/mnist_straggler_check --fed_workspace aggregator --col1 col1 --col2 col2 --rounds-to-train 3 diff --git a/.github/workflows/task_runner_basic_e2e.yml b/.github/workflows/task_runner_basic_e2e.yml index 5b64de09df..5430c5695c 100644 --- a/.github/workflows/task_runner_basic_e2e.yml +++ b/.github/workflows/task_runner_basic_e2e.yml @@ -25,8 +25,8 @@ on: type: choice options: - all - - torch_cnn_mnist - - keras_cnn_mnist + - torch/mnist + - keras/mnist python_version: description: "Python version" required: false @@ -85,21 +85,21 @@ jobs: id: input_selection run: | # --------------------------------------------------------------- - # Models like XGBoost (xgb_higgs) and torch_cnn_histology require runners with higher memory and CPU to run. + # Models like XGBoost (xgb_higgs) and torch/histology require runners with higher memory and CPU to run. # Thus these models are excluded from the matrix for now. # Default combination if no input is provided (i.e. 'all' is selected). - # * TLS - models [torch_cnn_mnist, keras_cnn_mnist] and python versions [3.10, 3.11, 3.12] - # * Non-TLS - models [torch_cnn_mnist] and python version [3.10] - # * No client auth - models [keras_cnn_mnist] and python version [3.10] - # * Memory logs - models [torch_cnn_mnist] and python version [3.10] + # * TLS - models [torch/mnist, keras/mnist] and python versions [3.10, 3.11, 3.12] + # * Non-TLS - models [torch/mnist] and python version [3.10] + # * No client auth - models [keras/mnist] and python version [3.10] + # * Memory logs - models [torch/mnist] and python version [3.10] # --------------------------------------------------------------- echo "jobs_to_run=${{ env.JOBS_TO_RUN }}" >> "$GITHUB_OUTPUT" if [ "${{ env.MODEL_NAME }}" == "all" ]; then - echo "models_for_tls=[\"torch_cnn_mnist\", \"keras_cnn_mnist\"]" >> "$GITHUB_OUTPUT" - echo "models_for_non_tls=[\"torch_cnn_mnist\"]" >> "$GITHUB_OUTPUT" - echo "models_for_no_client_auth=[\"keras_cnn_mnist\"]" >> "$GITHUB_OUTPUT" - echo "models_for_memory_logs=[\"torch_cnn_mnist\"]" >> "$GITHUB_OUTPUT" + echo "models_for_tls=[\"torch/mnist\", \"keras/mnist\"]" >> "$GITHUB_OUTPUT" + echo "models_for_non_tls=[\"torch/mnist\"]" >> "$GITHUB_OUTPUT" + echo "models_for_no_client_auth=[\"keras/mnist\"]" >> "$GITHUB_OUTPUT" + echo "models_for_memory_logs=[\"torch/mnist\"]" >> "$GITHUB_OUTPUT" else echo "models_for_tls=[\"${{env.MODEL_NAME}}\"]" >> "$GITHUB_OUTPUT" echo "models_for_non_tls=[\"${{env.MODEL_NAME}}\"]" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/task_runner_dockerized_ws_e2e.yml b/.github/workflows/task_runner_dockerized_ws_e2e.yml index ce677c5789..23febe3e64 100644 --- a/.github/workflows/task_runner_dockerized_ws_e2e.yml +++ b/.github/workflows/task_runner_dockerized_ws_e2e.yml @@ -32,7 +32,7 @@ jobs: timeout-minutes: 15 strategy: matrix: - model_name: ["keras_cnn_mnist"] + model_name: ["keras/mnist"] python_version: ["3.10", "3.11", "3.12"] fail-fast: false # do not immediately fail if one of the combinations fail @@ -73,7 +73,7 @@ jobs: timeout-minutes: 15 strategy: matrix: - model_name: ["keras_cnn_mnist"] + model_name: ["keras/mnist"] python_version: ["3.10"] fail-fast: false # do not immediately fail if one of the combinations fail @@ -114,7 +114,7 @@ jobs: timeout-minutes: 15 strategy: matrix: - model_name: ["keras_cnn_mnist"] + model_name: ["keras/mnist"] python_version: ["3.10"] fail-fast: false # do not immediately fail if one of the combinations fail @@ -155,7 +155,7 @@ jobs: timeout-minutes: 15 strategy: matrix: - model_name: ["keras_cnn_mnist"] + model_name: ["keras/mnist"] python_version: ["3.10"] fail-fast: false # do not immediately fail if one of the combinations fail diff --git a/.github/workflows/task_runner_fedeval_dws_e2e.yml b/.github/workflows/task_runner_fedeval_dws_e2e.yml index 85e26a4443..f0d62ae278 100644 --- a/.github/workflows/task_runner_fedeval_dws_e2e.yml +++ b/.github/workflows/task_runner_fedeval_dws_e2e.yml @@ -59,7 +59,7 @@ jobs: if: needs.input_selection.outputs.selected_jobs == 'tls' || needs.input_selection.outputs.selected_jobs == 'all' strategy: matrix: - model_name: ["keras_cnn_mnist"] + model_name: ["keras/mnist"] python_version: ["3.10"] fail-fast: false # do not immediately fail if one of the combinations fail @@ -102,7 +102,7 @@ jobs: if: needs.input_selection.outputs.selected_jobs == 'non_tls' || needs.input_selection.outputs.selected_jobs == 'all' strategy: matrix: - model_name: ["keras_cnn_mnist"] + model_name: ["keras/mnist"] python_version: ["3.10"] fail-fast: false # do not immediately fail if one of the combinations fail @@ -145,7 +145,7 @@ jobs: if: needs.input_selection.outputs.selected_jobs == 'no_client_auth' || needs.input_selection.outputs.selected_jobs == 'all' strategy: matrix: - model_name: ["keras_cnn_mnist"] + model_name: ["keras/mnist"] python_version: ["3.10"] fail-fast: false # do not immediately fail if one of the combinations fail diff --git a/.github/workflows/task_runner_fedeval_e2e.yml b/.github/workflows/task_runner_fedeval_e2e.yml index fce6408686..21841c3527 100644 --- a/.github/workflows/task_runner_fedeval_e2e.yml +++ b/.github/workflows/task_runner_fedeval_e2e.yml @@ -34,9 +34,9 @@ jobs: timeout-minutes: 30 strategy: matrix: - # Models like XGBoost (xgb_higgs) and torch_cnn_histology require runners with higher memory and CPU to run. + # Models like XGBoost (xgb_higgs) and torch/histology require runners with higher memory and CPU to run. # Thus these models are excluded from the matrix for now. - model_name: ["torch_cnn_mnist", "keras_cnn_mnist"] + model_name: ["torch.mnist", "keras/mnist"] python_version: ["3.10"] fail-fast: false # do not immediately fail if one of the combinations fail @@ -77,9 +77,9 @@ jobs: timeout-minutes: 30 strategy: matrix: - # Testing this scenario only for torch_cnn_mnist model and python 3.10 + # Testing this scenario only for torch/mnist model and python 3.10 # If required, this can be extended to other models and python versions - model_name: ["torch_cnn_mnist"] + model_name: ["torch/mnist"] python_version: ["3.10"] fail-fast: false # do not immediately fail if one of the combinations fail @@ -120,9 +120,9 @@ jobs: timeout-minutes: 30 strategy: matrix: - # Testing this scenario for keras_cnn_mnist model and python 3.10 + # Testing this scenario for keras/mnist model and python 3.10 # If required, this can be extended to other models and python versions - model_name: ["keras_cnn_mnist"] + model_name: ["keras/mnist"] python_version: ["3.10"] fail-fast: false # do not immediately fail if one of the combinations fail diff --git a/.github/workflows/taskrunner.yml b/.github/workflows/taskrunner.yml index 11692a4b5c..1df43888eb 100644 --- a/.github/workflows/taskrunner.yml +++ b/.github/workflows/taskrunner.yml @@ -32,4 +32,4 @@ jobs: pip install . - name: Task Runner API run: | - python -m tests.github.test_hello_federation --template torch_cnn_mnist --fed_workspace aggregator --col1 collaborator1 --col2 collaborator2 --rounds-to-train 3 --save-model output_model \ No newline at end of file + python -m tests.github.test_hello_federation --template torch/mnist --fed_workspace aggregator --col1 collaborator1 --col2 collaborator2 --rounds-to-train 3 --save-model output_model \ No newline at end of file diff --git a/.github/workflows/taskrunner_eden_pipeline.yml b/.github/workflows/taskrunner_eden_pipeline.yml index 02eea0e2dc..bfacb7a61d 100644 --- a/.github/workflows/taskrunner_eden_pipeline.yml +++ b/.github/workflows/taskrunner_eden_pipeline.yml @@ -31,4 +31,4 @@ jobs: pip install . - name: Test TaskRunner API with Eden Compression run: | - python -m tests.github.test_hello_federation --template torch_cnn_mnist_eden_compression --fed_workspace aggregator --col1 col1 --col2 col2 --rounds-to-train 3 + python -m tests.github.test_hello_federation --template torch/mnist_eden_compression --fed_workspace aggregator --col1 col1 --col2 col2 --rounds-to-train 3 diff --git a/.github/workflows/tr_docker_gramine_direct.yml b/.github/workflows/tr_docker_gramine_direct.yml index 169189a42d..ca9155a647 100644 --- a/.github/workflows/tr_docker_gramine_direct.yml +++ b/.github/workflows/tr_docker_gramine_direct.yml @@ -27,7 +27,7 @@ jobs: - name: Create workspace image run: | - fx workspace create --prefix example_workspace --template keras_cnn_mnist + fx workspace create --prefix example_workspace --template keras/mnist cd example_workspace fx plan initialize -a localhost diff --git a/.github/workflows/tr_docker_native.yml b/.github/workflows/tr_docker_native.yml index 9fcb9b8759..7824897e03 100644 --- a/.github/workflows/tr_docker_native.yml +++ b/.github/workflows/tr_docker_native.yml @@ -27,7 +27,7 @@ jobs: - name: Create workspace image run: | - fx workspace create --prefix example_workspace --template keras_cnn_mnist + fx workspace create --prefix example_workspace --template keras/mnist cd example_workspace fx plan initialize -a localhost fx workspace dockerize --save --revision https://github.com/${GITHUB_REPOSITORY}.git@${{ github.event.pull_request.head.sha }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 617c004751..f82193a433 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -53,4 +53,4 @@ jobs: pip install . - name: Test TaskRunner API run: | - python -m tests.github.test_hello_federation --template keras_cnn_mnist --fed_workspace aggregator --col1 col1 --col2 col2 --rounds-to-train 3 --save-model output_model + python -m tests.github.test_hello_federation --template keras/mnist --fed_workspace aggregator --col1 col1 --col2 col2 --rounds-to-train 3 --save-model output_model diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5f3ffa1220..e33ca1e09c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -52,4 +52,4 @@ jobs: pip install . - name: Test TaskRunner API run: | - python -m tests.github.test_hello_federation --template keras_cnn_mnist --fed_workspace aggregator --col1 col1 --col2 col2 --rounds-to-train 3 --save-model output_model \ No newline at end of file + python -m tests.github.test_hello_federation --template keras/mnist --fed_workspace aggregator --col1 col1 --col2 col2 --rounds-to-train 3 --save-model output_model \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 73f919c844..ddd2ea3e2c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,18 +1,15 @@ def snykData = [ 'openfl-docker': 'openfl-docker/Dockerfile.base', 'openfl': 'setup.py', - 'openfl-workspace_tf_2dunet': 'openfl-workspace/tf_2dunet/requirements.txt', - 'openfl-workspace_torch_cnn_mnist_straggler_check': 'openfl-workspace/torch_cnn_mnist_straggler_check/requirements.txt', + 'openfl-workspace_keras_2dunet': 'openfl-workspace/keras/2dunet/requirements.txt', + 'openfl-workspace_torch_cnn_mnist_straggler_check': 'openfl-workspace/torch/mnist_straggler_check/requirements.txt', // CN-14619 snyk test CLI does not support -f in requirements.txt file - // 'openfl-workspace_torch_cnn_histology': 'openfl-workspace/torch_cnn_histology/requirements.txt', - 'openfl-workspace_torch_cnn_histology_src': 'openfl-workspace/torch_cnn_histology/src/requirements.txt', - 'openfl-workspace_keras_nlp': 'openfl-workspace/keras_nlp/requirements.txt', - 'openfl-workspace_torch_cnn_mnist': 'openfl-workspace/torch_cnn_mnist/requirements.txt', - 'openfl-workspace_torch_unet_kvasir': 'openfl-workspace/torch_unet_kvasir/requirements.txt', - 'openfl-workspace_tf_cnn_histology': 'openfl-workspace/tf_cnn_histology/requirements.txt', - 'openfl-workspace_tf_3dunet_brats': 'openfl-workspace/tf_3dunet_brats/requirements.txt', - 'openfl-workspace_keras_cnn_with_compression': 'openfl-workspace/keras_cnn_with_compression/requirements.txt', - 'openfl-workspace_keras_cnn_mnist': 'openfl-workspace/keras_cnn_mnist/requirements.txt', + // 'openfl-workspace_keras/histology': 'openfl-workspace/torch/histology/requirements.txt', + 'openfl-workspace_keras/histology_src': 'openfl-workspace/torch/histology/src/requirements.txt', + 'openfl-workspace_keras/nlp': 'openfl-workspace/keras/nlp/requirements.txt', + 'openfl-workspace_torch_cnn_mnist': 'openfl-workspace/torch/mnist/requirements.txt', + 'openfl-workspace_torch_unet_kvasir': 'openfl-workspace/torch/unet_kvasir/requirements.txt', + 'openfl-workspace_keras_cnn_mnist': 'openfl-workspace/keras/mnist/requirements.txt', 'openfl-tutorials_interactive_api_pytorch_medmnist_2d_envoy': 'openfl-tutorials/interactive_api/PyTorch_MedMNIST_2D/envoy/requirements.txt', 'openfl-tutorials_interactive_api_pytorch_dogscats_vit_workspace': 'openfl-tutorials/interactive_api/PyTorch_DogsCats_ViT/workspace/requirements.txt', 'openfl-tutorials_interactive_api_pytorch_histology_envoy': 'openfl-tutorials/interactive_api/PyTorch_Histology/envoy/requirements.txt', diff --git a/docs/about/features_index/fed_eval.rst b/docs/about/features_index/fed_eval.rst index 3f8e6b8637..01dca906ba 100644 --- a/docs/about/features_index/fed_eval.rst +++ b/docs/about/features_index/fed_eval.rst @@ -26,7 +26,7 @@ Example Using the Task Runner API (Aggregator-based Workflow) The following steps can be leveraged to achieve practical e2e usage of FedEval -*N.B*: We will be using torch_cnn_mnist plan itself for both training and with some minor changes for evaluation as well +*N.B*: We will be using torch/mnist plan itself for both training and with some minor changes for evaluation as well *Prerequisites*: Please ensure that OpenFL version==1.7 is installed or you can also choose to install latest from source. @@ -48,13 +48,13 @@ With OpenFL version==1.7 aggregator start command is enhanced to have an optiona --help Show this message and exit. 1. **Setup** -We will use the `torch_cnn_mnist` workspace for training +We will use the `torch/mnist` workspace for training Let's first configure a workspace with all necesary certificates .. code-block:: shell - fx workspace create --prefix ./cnn_train_eval --template torch_cnn_mnist + fx workspace create --prefix ./cnn_train_eval --template torch/mnist cd cnn_train_eval fx workspace certify fx aggregator generate-cert-request @@ -416,7 +416,7 @@ The updated plan post initialization with edits to make it ready for evaluation metrics: - loss -We have done following changes to the initialized torch_cnn_mnist plan in the new workspace: +We have done following changes to the initialized torch/mnist plan in the new workspace: - Set the rounds_to_train to 1 as evaluation needs just one round of federation run across the collaborators - Removed all other training related tasks from assigner settings except "aggregated_model_validation" Now let's replace the ``init.pbuf`` with the previously saved ``trained_model.pbuf`` diff --git a/docs/about/features_index/taskrunner.rst b/docs/about/features_index/taskrunner.rst index e51ac50be4..9deaa18add 100644 --- a/docs/about/features_index/taskrunner.rst +++ b/docs/about/features_index/taskrunner.rst @@ -88,7 +88,7 @@ Each YAML top-level section contains the following subsections: The following is an example of a **plan.yaml**: -.. literalinclude:: ../../../openfl-workspace/torch_cnn_mnist/plan/plan.yaml +.. literalinclude:: ../../../openfl-workspace/torch/mnist/plan/plan.yaml :language: yaml @@ -150,22 +150,22 @@ STEP 1: Create a Workspace $ fx -2. This example uses the :code:`keras_cnn_mnist` template. +2. This example uses the :code:`keras/mnist` template. - Set the environment variables to use the :code:`keras_cnn_mnist` as the template and :code:`${HOME}/my_federation` as the path to the workspace directory. + Set the environment variables to use the :code:`keras/mnist` as the template and :code:`${HOME}/my_federation` as the path to the workspace directory. .. code-block:: shell - $ export WORKSPACE_TEMPLATE=keras_cnn_mnist + $ export WORKSPACE_TEMPLATE=keras/mnist $ export WORKSPACE_PATH=${HOME}/my_federation 3. Decide a workspace template, which are end-to-end federated learning training demonstrations. The following is a sample of available templates: - - :code:`keras_cnn_mnist`: a workspace with a simple `Keras `__ CNN model that will download the `MNIST `_ dataset and train in a federation. + - :code:`keras/mnist`: a workspace with a simple `Keras `__ CNN model that will download the `MNIST `_ dataset and train in a federation. - :code:`tf_2dunet`: a workspace with a simple `TensorFlow `__ CNN model that will use the `BraTS `_ dataset and train in a federation. - :code:`tf_cnn_histology`: a workspace with a simple `TensorFlow `__ CNN model that will download the `Colorectal Histology `_ dataset and train in a federation. - - :code:`torch_cnn_histology`: a workspace with a simple `PyTorch `__ CNN model that will download the `Colorectal Histology `_ dataset and train in a federation. - - :code:`torch_cnn_mnist`: a workspace with a simple `PyTorch `__ CNN model that will download the `MNIST `_ dataset and train in a federation. + - :code:`keras/histology`: a workspace with a simple `PyTorch `__ CNN model that will download the `Colorectal Histology `_ dataset and train in a federation. + - :code:`torch/mnist`: a workspace with a simple `PyTorch `__ CNN model that will download the `MNIST `_ dataset and train in a federation. See the complete list of available templates. diff --git a/docs/developer_guide/advanced_topics/log_metric_callback.rst b/docs/developer_guide/advanced_topics/log_metric_callback.rst index a449feba61..35256da30f 100644 --- a/docs/developer_guide/advanced_topics/log_metric_callback.rst +++ b/docs/developer_guide/advanced_topics/log_metric_callback.rst @@ -83,7 +83,7 @@ For logging through Tensorboard, enable the parameter :code:`write_logs : true` settings : write_logs : true -Follow the steps below to write your custom callback function instead. As an example, a full implementation can be found at `Federated_Pytorch_MNIST_Tutorial.ipynb `_ and in the **torch_cnn_mnist** workspace. +Follow the steps below to write your custom callback function instead. As an example, a full implementation can be found at `Federated_Pytorch_MNIST_Tutorial.ipynb `_ and in the **torch/mnist** workspace. 1. Define the callback function, like how you defined in Python API, in the **src** directory in your workspace. diff --git a/docs/developer_guide/advanced_topics/straggler_handling_algorithms.rst b/docs/developer_guide/advanced_topics/straggler_handling_algorithms.rst index 88579bde57..2cc8b42d17 100644 --- a/docs/developer_guide/advanced_topics/straggler_handling_algorithms.rst +++ b/docs/developer_guide/advanced_topics/straggler_handling_algorithms.rst @@ -29,7 +29,7 @@ The following are the straggler handling algorithms supported in OpenFL: Demonstration of adding the straggler handling interface ========================================================= -The example template, **torch_cnn_mnist_straggler_check**, uses the ``PercentagePolicy``. To gain a better understanding of how experiments perform, you can modify the **percent_collaborators_needed** or **minimum_reporting** parameter in the template **plan.yaml** or even choose **CutoffTimePolicy** function instead: +The example template, **torch/mnist_straggler_check***, uses the ``PercentagePolicy``. To gain a better understanding of how experiments perform, you can modify the **percent_collaborators_needed** or **minimum_reporting** parameter in the template **plan.yaml** or even choose **CutoffTimePolicy** function instead: .. code-block:: yaml diff --git a/docs/releases.md b/docs/releases.md index 30ed029ea6..bcd0f19a39 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -15,7 +15,7 @@ - **FL Workspace Dockerization**: Revised Task Runner API workspace dockerization process, with TEE-ready containers (using Gramine and Intel® Software Guard Extensions). Follow the [updated instructions](https://github.com/securefederatedai/openfl/blob/develop/openfl-docker/README.md) to enhance the privacy and security of your FL experiments. -- **Federated Evaluation via TaskRunner API**: OpenFL 1.7 further simplifies the creation of Federated Evaluation experiments via the TaskRunner API (see the example [FedEval workspace](https://github.com/securefederatedai/openfl/tree/develop/openfl-workspace/torch_cnn_mnist_fed_eval)). +- **Federated Evaluation via TaskRunner API**: OpenFL 1.7 further simplifies the creation of Federated Evaluation experiments via the TaskRunner API (see the example [FedEval workspace](https://github.com/securefederatedai/openfl/tree/develop/openfl-workspace/torch/mnist_fed_eval)). - **Keras 3 API**: Upgrading the base TaskRunner classes and example workspaces to Keras 3 for building state-of-the-art FL experiments with TensorFlow (more backends to be included in the upcoming OpenFL releases). @@ -28,7 +28,7 @@ ### New Features and APIs: - **Federated LLM fine-tuning**: - - [**Horovod**](https://github.com/securefederatedai/openfl/tree/develop/openfl-workspace/torch_llm_horovod): Use horovod to efficiently train LLMs across multiple private clusters + - [**Horovod**](https://github.com/securefederatedai/openfl/tree/develop/openfl-workspace/torch/llm_horovod): Use horovod to efficiently train LLMs across multiple private clusters - **Neuralchat-7b fine-tuning**: Learn how to fine-tune [neuralchat-7b](https://github.com/securefederatedai/openfl/tree/develop/openfl-tutorials/experimental/workflow/LLM/neuralchat) using the Intel® Extension for Transformers and the workflow interface. - **Workflow API enhancements**: Introducing an experimental [Workspace Export](https://github.com/securefederatedai/openfl/blob/develop/openfl-tutorials/experimental/workflow/1001_Workspace_Creation_from_JupyterNotebook.ipynb) feature that can be used to transform a Workflow API-based FL experiment into the TaskRunner API format for running in a distributed deployment. There is also groundwork laid for a future FederatedRuntime implementation for Workflow API, in addition to the currently supported LocalRuntime. @@ -133,7 +133,7 @@ The OpenFL v1.2 release contains the following updates: - New [Interactive Python API](https://github.com/securefederatedai/openfl/tree/main/openfl-tutorials/deprecated/interactive_api) (experimental) - Example FedProx algorithm implementation for PyTorch and Tensorflow - `AggregationFunctionInterface` for custom aggregation functions -- Adds a [Keras-based NLP Example](https://github.com/intel/openfl/tree/develop/openfl-workspace/keras_nlp) +- Adds a [Keras-based NLP Example](https://github.com/intel/openfl/tree/develop/openfl-workspace/keras/nlp) - Fixed lossy compression pipelines and added an [example](https://github.com/intel/openfl/tree/develop/openfl-workspace/keras_cnn_with_compression) for usage - Bug fixes and documentation improvements diff --git a/docs/tutorials/taskrunner.ipynb b/docs/tutorials/taskrunner.ipynb index d19fcdc6d0..a1874eaf5a 100644 --- a/docs/tutorials/taskrunner.ipynb +++ b/docs/tutorials/taskrunner.ipynb @@ -36,7 +36,7 @@ "metadata": {}, "outputs": [], "source": [ - "!fx workspace create --prefix ./mnist_example --template keras_cnn_mnist\n", + "!fx workspace create --prefix ./mnist_example --template keras/mnist\n", "%cd ./mnist_example" ] }, diff --git a/openfl-workspace/keras_2dunet/.workspace b/openfl-workspace/gandlf_seg_test/.workspace similarity index 100% rename from openfl-workspace/keras_2dunet/.workspace rename to openfl-workspace/gandlf_seg_test/.workspace diff --git a/openfl-workspace/keras_cnn_mnist/.workspace b/openfl-workspace/keras/2dunet/.workspace similarity index 100% rename from openfl-workspace/keras_cnn_mnist/.workspace rename to openfl-workspace/keras/2dunet/.workspace diff --git a/openfl-workspace/keras_2dunet/README.md b/openfl-workspace/keras/2dunet/README.md similarity index 100% rename from openfl-workspace/keras_2dunet/README.md rename to openfl-workspace/keras/2dunet/README.md diff --git a/openfl-workspace/keras_2dunet/plan/cols.yaml b/openfl-workspace/keras/2dunet/plan/cols.yaml similarity index 100% rename from openfl-workspace/keras_2dunet/plan/cols.yaml rename to openfl-workspace/keras/2dunet/plan/cols.yaml diff --git a/openfl-workspace/keras_2dunet/plan/data.yaml b/openfl-workspace/keras/2dunet/plan/data.yaml similarity index 100% rename from openfl-workspace/keras_2dunet/plan/data.yaml rename to openfl-workspace/keras/2dunet/plan/data.yaml diff --git a/openfl-workspace/keras_2dunet/plan/defaults b/openfl-workspace/keras/2dunet/plan/defaults similarity index 100% rename from openfl-workspace/keras_2dunet/plan/defaults rename to openfl-workspace/keras/2dunet/plan/defaults diff --git a/openfl-workspace/keras_2dunet/plan/plan.yaml b/openfl-workspace/keras/2dunet/plan/plan.yaml similarity index 100% rename from openfl-workspace/keras_2dunet/plan/plan.yaml rename to openfl-workspace/keras/2dunet/plan/plan.yaml diff --git a/openfl-workspace/keras_2dunet/requirements.txt b/openfl-workspace/keras/2dunet/requirements.txt similarity index 100% rename from openfl-workspace/keras_2dunet/requirements.txt rename to openfl-workspace/keras/2dunet/requirements.txt diff --git a/openfl-workspace/keras_2dunet/src/__init__.py b/openfl-workspace/keras/2dunet/src/__init__.py similarity index 100% rename from openfl-workspace/keras_2dunet/src/__init__.py rename to openfl-workspace/keras/2dunet/src/__init__.py diff --git a/openfl-workspace/keras_2dunet/src/brats_utils.py b/openfl-workspace/keras/2dunet/src/brats_utils.py similarity index 100% rename from openfl-workspace/keras_2dunet/src/brats_utils.py rename to openfl-workspace/keras/2dunet/src/brats_utils.py diff --git a/openfl-workspace/keras_2dunet/src/dataloader.py b/openfl-workspace/keras/2dunet/src/dataloader.py similarity index 100% rename from openfl-workspace/keras_2dunet/src/dataloader.py rename to openfl-workspace/keras/2dunet/src/dataloader.py diff --git a/openfl-workspace/keras_2dunet/src/nii_reader.py b/openfl-workspace/keras/2dunet/src/nii_reader.py similarity index 100% rename from openfl-workspace/keras_2dunet/src/nii_reader.py rename to openfl-workspace/keras/2dunet/src/nii_reader.py diff --git a/openfl-workspace/keras_2dunet/src/taskrunner.py b/openfl-workspace/keras/2dunet/src/taskrunner.py similarity index 100% rename from openfl-workspace/keras_2dunet/src/taskrunner.py rename to openfl-workspace/keras/2dunet/src/taskrunner.py diff --git a/openfl-workspace/keras_nlp/.workspace b/openfl-workspace/keras/mnist/.workspace similarity index 100% rename from openfl-workspace/keras_nlp/.workspace rename to openfl-workspace/keras/mnist/.workspace diff --git a/openfl-workspace/keras_cnn_mnist/plan/cols.yaml b/openfl-workspace/keras/mnist/plan/cols.yaml similarity index 100% rename from openfl-workspace/keras_cnn_mnist/plan/cols.yaml rename to openfl-workspace/keras/mnist/plan/cols.yaml diff --git a/openfl-workspace/keras_cnn_mnist/plan/data.yaml b/openfl-workspace/keras/mnist/plan/data.yaml similarity index 100% rename from openfl-workspace/keras_cnn_mnist/plan/data.yaml rename to openfl-workspace/keras/mnist/plan/data.yaml diff --git a/openfl-workspace/keras_cnn_mnist/plan/defaults b/openfl-workspace/keras/mnist/plan/defaults similarity index 100% rename from openfl-workspace/keras_cnn_mnist/plan/defaults rename to openfl-workspace/keras/mnist/plan/defaults diff --git a/openfl-workspace/keras_cnn_mnist/plan/plan.yaml b/openfl-workspace/keras/mnist/plan/plan.yaml similarity index 100% rename from openfl-workspace/keras_cnn_mnist/plan/plan.yaml rename to openfl-workspace/keras/mnist/plan/plan.yaml diff --git a/openfl-workspace/keras_cnn_mnist/requirements.txt b/openfl-workspace/keras/mnist/requirements.txt similarity index 100% rename from openfl-workspace/keras_cnn_mnist/requirements.txt rename to openfl-workspace/keras/mnist/requirements.txt diff --git a/openfl-workspace/keras_cnn_mnist/src/__init__.py b/openfl-workspace/keras/mnist/src/__init__.py similarity index 100% rename from openfl-workspace/keras_cnn_mnist/src/__init__.py rename to openfl-workspace/keras/mnist/src/__init__.py diff --git a/openfl-workspace/keras_cnn_mnist/src/dataloader.py b/openfl-workspace/keras/mnist/src/dataloader.py similarity index 100% rename from openfl-workspace/keras_cnn_mnist/src/dataloader.py rename to openfl-workspace/keras/mnist/src/dataloader.py diff --git a/openfl-workspace/keras_cnn_mnist/src/mnist_utils.py b/openfl-workspace/keras/mnist/src/mnist_utils.py similarity index 100% rename from openfl-workspace/keras_cnn_mnist/src/mnist_utils.py rename to openfl-workspace/keras/mnist/src/mnist_utils.py diff --git a/openfl-workspace/keras_cnn_mnist/src/taskrunner.py b/openfl-workspace/keras/mnist/src/taskrunner.py similarity index 100% rename from openfl-workspace/keras_cnn_mnist/src/taskrunner.py rename to openfl-workspace/keras/mnist/src/taskrunner.py diff --git a/openfl-workspace/torch_cnn_mnist_eden_compression/.workspace b/openfl-workspace/keras/nlp/.workspace similarity index 100% rename from openfl-workspace/torch_cnn_mnist_eden_compression/.workspace rename to openfl-workspace/keras/nlp/.workspace diff --git a/openfl-workspace/keras_nlp/plan/cols.yaml b/openfl-workspace/keras/nlp/plan/cols.yaml similarity index 100% rename from openfl-workspace/keras_nlp/plan/cols.yaml rename to openfl-workspace/keras/nlp/plan/cols.yaml diff --git a/openfl-workspace/keras_nlp/plan/data.yaml b/openfl-workspace/keras/nlp/plan/data.yaml similarity index 100% rename from openfl-workspace/keras_nlp/plan/data.yaml rename to openfl-workspace/keras/nlp/plan/data.yaml diff --git a/openfl-workspace/keras_nlp/plan/plan.yaml b/openfl-workspace/keras/nlp/plan/plan.yaml similarity index 100% rename from openfl-workspace/keras_nlp/plan/plan.yaml rename to openfl-workspace/keras/nlp/plan/plan.yaml diff --git a/openfl-workspace/keras_nlp/requirements.txt b/openfl-workspace/keras/nlp/requirements.txt similarity index 100% rename from openfl-workspace/keras_nlp/requirements.txt rename to openfl-workspace/keras/nlp/requirements.txt diff --git a/openfl-workspace/keras_nlp/src/__init__.py b/openfl-workspace/keras/nlp/src/__init__.py similarity index 100% rename from openfl-workspace/keras_nlp/src/__init__.py rename to openfl-workspace/keras/nlp/src/__init__.py diff --git a/openfl-workspace/keras_nlp/src/dataloader.py b/openfl-workspace/keras/nlp/src/dataloader.py similarity index 100% rename from openfl-workspace/keras_nlp/src/dataloader.py rename to openfl-workspace/keras/nlp/src/dataloader.py diff --git a/openfl-workspace/keras_nlp/src/dataloader_utils.py b/openfl-workspace/keras/nlp/src/dataloader_utils.py similarity index 100% rename from openfl-workspace/keras_nlp/src/dataloader_utils.py rename to openfl-workspace/keras/nlp/src/dataloader_utils.py diff --git a/openfl-workspace/keras_nlp/src/taskrunner.py b/openfl-workspace/keras/nlp/src/taskrunner.py similarity index 100% rename from openfl-workspace/keras_nlp/src/taskrunner.py rename to openfl-workspace/keras/nlp/src/taskrunner.py diff --git a/openfl-workspace/torch_cnn_mnist_fed_eval/.workspace b/openfl-workspace/torch/histology/.workspace similarity index 100% rename from openfl-workspace/torch_cnn_mnist_fed_eval/.workspace rename to openfl-workspace/torch/histology/.workspace diff --git a/openfl-workspace/torch_cnn_histology/plan/cols.yaml b/openfl-workspace/torch/histology/plan/cols.yaml similarity index 100% rename from openfl-workspace/torch_cnn_histology/plan/cols.yaml rename to openfl-workspace/torch/histology/plan/cols.yaml diff --git a/openfl-workspace/torch_cnn_histology/plan/data.yaml b/openfl-workspace/torch/histology/plan/data.yaml similarity index 100% rename from openfl-workspace/torch_cnn_histology/plan/data.yaml rename to openfl-workspace/torch/histology/plan/data.yaml diff --git a/openfl-workspace/torch_cnn_histology/plan/plan.yaml b/openfl-workspace/torch/histology/plan/plan.yaml similarity index 100% rename from openfl-workspace/torch_cnn_histology/plan/plan.yaml rename to openfl-workspace/torch/histology/plan/plan.yaml diff --git a/openfl-workspace/torch_cnn_histology/requirements.txt b/openfl-workspace/torch/histology/requirements.txt similarity index 100% rename from openfl-workspace/torch_cnn_histology/requirements.txt rename to openfl-workspace/torch/histology/requirements.txt diff --git a/openfl-workspace/torch_cnn_histology/src/__init__.py b/openfl-workspace/torch/histology/src/__init__.py similarity index 100% rename from openfl-workspace/torch_cnn_histology/src/__init__.py rename to openfl-workspace/torch/histology/src/__init__.py diff --git a/openfl-workspace/torch_cnn_histology/src/dataloader.py b/openfl-workspace/torch/histology/src/dataloader.py similarity index 100% rename from openfl-workspace/torch_cnn_histology/src/dataloader.py rename to openfl-workspace/torch/histology/src/dataloader.py diff --git a/openfl-workspace/torch_cnn_histology/src/taskrunner.py b/openfl-workspace/torch/histology/src/taskrunner.py similarity index 100% rename from openfl-workspace/torch_cnn_histology/src/taskrunner.py rename to openfl-workspace/torch/histology/src/taskrunner.py diff --git a/openfl-workspace/torch_cnn_mnist_straggler_check/.workspace b/openfl-workspace/torch/histology_fedcurv/.workspace similarity index 100% rename from openfl-workspace/torch_cnn_mnist_straggler_check/.workspace rename to openfl-workspace/torch/histology_fedcurv/.workspace diff --git a/openfl-workspace/torch_cnn_histology_fedcurv/README.md b/openfl-workspace/torch/histology_fedcurv/README.md similarity index 86% rename from openfl-workspace/torch_cnn_histology_fedcurv/README.md rename to openfl-workspace/torch/histology_fedcurv/README.md index de6f18e42d..d4b375a859 100644 --- a/openfl-workspace/torch_cnn_histology_fedcurv/README.md +++ b/openfl-workspace/torch/histology_fedcurv/README.md @@ -4,7 +4,7 @@ It uses the Pytorch framework and OpenFL's TaskTunner API. The federation aggregates intermediate models using the [Fedcurv](https://arxiv.org/pdf/1910.07796) aggregation algorithm, which performs well (Compared to [FedAvg](https://arxiv.org/abs/2104.11375)) when the datasets are not independent and identically distributed (IID) among collaborators. -Note that this example is similar to the one present in the `torch_cnn_histology` directory and is here to demonstrate the usage of a different aggregation algorithm using OpenFL's Taskrunner API. +Note that this example is similar to the one present in the `keras/histology` directory and is here to demonstrate the usage of a different aggregation algorithm using OpenFL's Taskrunner API. The differenece between the two examples lies both in the `PyTorchCNNWithFedCurv` class which is used to define a stateful training method which uses an existing `FedCurv` object, and in the `plan.yaml` file in which the training task is explicitly defined with a non-default aggregation method - `FedCurvWeightedAverage`. @@ -13,7 +13,7 @@ and in the `plan.yaml` file in which the training task is explicitly defined wit The following instructions can be used to run the federation: ``` # Copy the workspace template, create collaborators and aggregator -fx workspace create --template torch_cnn_histology_fedcurv --prefix fedcurv +fx workspace create --template torch/histology_fedcurv --prefix fedcurv cd fedcurv fx workspace certify fx aggregator generate-cert-request fx aggregator certify --silent diff --git a/openfl-workspace/torch_cnn_histology_fedcurv/plan/cols.yaml b/openfl-workspace/torch/histology_fedcurv/plan/cols.yaml similarity index 100% rename from openfl-workspace/torch_cnn_histology_fedcurv/plan/cols.yaml rename to openfl-workspace/torch/histology_fedcurv/plan/cols.yaml diff --git a/openfl-workspace/torch_cnn_histology_fedcurv/plan/data.yaml b/openfl-workspace/torch/histology_fedcurv/plan/data.yaml similarity index 100% rename from openfl-workspace/torch_cnn_histology_fedcurv/plan/data.yaml rename to openfl-workspace/torch/histology_fedcurv/plan/data.yaml diff --git a/openfl-workspace/torch_cnn_histology_fedcurv/plan/plan.yaml b/openfl-workspace/torch/histology_fedcurv/plan/plan.yaml similarity index 100% rename from openfl-workspace/torch_cnn_histology_fedcurv/plan/plan.yaml rename to openfl-workspace/torch/histology_fedcurv/plan/plan.yaml diff --git a/openfl-workspace/torch_cnn_histology_fedcurv/requirements.txt b/openfl-workspace/torch/histology_fedcurv/requirements.txt similarity index 100% rename from openfl-workspace/torch_cnn_histology_fedcurv/requirements.txt rename to openfl-workspace/torch/histology_fedcurv/requirements.txt diff --git a/openfl-workspace/torch_cnn_histology_fedcurv/src/__init__.py b/openfl-workspace/torch/histology_fedcurv/src/__init__.py similarity index 100% rename from openfl-workspace/torch_cnn_histology_fedcurv/src/__init__.py rename to openfl-workspace/torch/histology_fedcurv/src/__init__.py diff --git a/openfl-workspace/torch_cnn_histology_fedcurv/src/dataloader.py b/openfl-workspace/torch/histology_fedcurv/src/dataloader.py similarity index 100% rename from openfl-workspace/torch_cnn_histology_fedcurv/src/dataloader.py rename to openfl-workspace/torch/histology_fedcurv/src/dataloader.py diff --git a/openfl-workspace/torch_cnn_histology_fedcurv/src/taskrunner.py b/openfl-workspace/torch/histology_fedcurv/src/taskrunner.py similarity index 100% rename from openfl-workspace/torch_cnn_histology_fedcurv/src/taskrunner.py rename to openfl-workspace/torch/histology_fedcurv/src/taskrunner.py diff --git a/openfl-workspace/torch_llm_horovod/.workspace b/openfl-workspace/torch/horovod/.workspace similarity index 100% rename from openfl-workspace/torch_llm_horovod/.workspace rename to openfl-workspace/torch/horovod/.workspace diff --git a/openfl-workspace/torch_llm_horovod/LLM_Horovod.MD b/openfl-workspace/torch/horovod/LLM_Horovod.MD similarity index 92% rename from openfl-workspace/torch_llm_horovod/LLM_Horovod.MD rename to openfl-workspace/torch/horovod/LLM_Horovod.MD index 71b6d05165..63060de6f5 100644 --- a/openfl-workspace/torch_llm_horovod/LLM_Horovod.MD +++ b/openfl-workspace/torch/horovod/LLM_Horovod.MD @@ -9,7 +9,7 @@ Before running the Horovod example, ensure that the following prerequisites are ## Setting up Horovod Dependencies To set up the Horovod dependencies, follow these steps: -1. Run the `setup_env.sh` script located in `openfl-workspace/torch_llm_horovod/setup_env.sh` within your virtual environment (venv). +1. Run the `setup_env.sh` script located in `openfl-workspace/torch/llm_horovod/setup_env.sh` within your virtual environment (venv). 2. Create aggregator and collaborator workspaces. See [Running the experiment](#running-the-experiment) 3. Ensure that the collaborator workspace is present in each node with the same file structure. 4. Make sure the dataset is available in each node. @@ -28,13 +28,13 @@ Set the following environmental variables for Horovod: ## Customizing Data and Models To use your own data and models, follow these steps: -1. Copy the `openfl/openfl-workspace/torch_llm_horovod` directory to `openfl/openfl-workspace/name_of_your_template`. +1. Copy the `openfl/openfl-workspace/torch/llm_horovod` directory to `openfl/openfl-workspace/name_of_your_template`. 2. In the `src/InHorovodrun` file, make the following changes: - Replace `EmotionDataLoader` with your own dataloader. - Replace `LLMTrainer` with your own training/validation scripts. ## Running the Experiment -To run the experiment, follow the instructions provided in the [OpenFL documentation](https://openfl.readthedocs.io/en/latest/running_the_federation.html#bare-metal-approach) using either the `torch_llm_horovod` template or your own template. +To run the experiment, follow the instructions provided in the [OpenFL documentation](https://openfl.readthedocs.io/en/latest/running_the_federation.html#bare-metal-approach) using either the `torch/llm_horovod` template or your own template. That's it! You're now ready to use the Horovod example with your own data and models. Enjoy! diff --git a/openfl-workspace/torch_cnn_mnist_eden_compression/plan/cols.yaml b/openfl-workspace/torch/horovod/plan/cols.yaml similarity index 100% rename from openfl-workspace/torch_cnn_mnist_eden_compression/plan/cols.yaml rename to openfl-workspace/torch/horovod/plan/cols.yaml diff --git a/openfl-workspace/torch_cnn_mnist_eden_compression/plan/data.yaml b/openfl-workspace/torch/horovod/plan/data.yaml similarity index 100% rename from openfl-workspace/torch_cnn_mnist_eden_compression/plan/data.yaml rename to openfl-workspace/torch/horovod/plan/data.yaml diff --git a/openfl-workspace/torch_cnn_mnist_eden_compression/plan/defaults b/openfl-workspace/torch/horovod/plan/defaults similarity index 100% rename from openfl-workspace/torch_cnn_mnist_eden_compression/plan/defaults rename to openfl-workspace/torch/horovod/plan/defaults diff --git a/openfl-workspace/torch_llm_horovod/plan/plan.yaml b/openfl-workspace/torch/horovod/plan/plan.yaml similarity index 100% rename from openfl-workspace/torch_llm_horovod/plan/plan.yaml rename to openfl-workspace/torch/horovod/plan/plan.yaml diff --git a/openfl-workspace/torch_llm_horovod/requirements.txt b/openfl-workspace/torch/horovod/requirements.txt similarity index 100% rename from openfl-workspace/torch_llm_horovod/requirements.txt rename to openfl-workspace/torch/horovod/requirements.txt diff --git a/openfl-workspace/torch_llm_horovod/setup_env.sh b/openfl-workspace/torch/horovod/setup_env.sh similarity index 72% rename from openfl-workspace/torch_llm_horovod/setup_env.sh rename to openfl-workspace/torch/horovod/setup_env.sh index bb014dbe83..96f2d02133 100755 --- a/openfl-workspace/torch_llm_horovod/setup_env.sh +++ b/openfl-workspace/torch/horovod/setup_env.sh @@ -3,6 +3,6 @@ pip install -U pip --no-cache pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 export HOROVOD_WITH_PYTORCH=1 export HOROVOD_WITHOUT_MPI=1 -pip install -r openfl-workspace/torch_llm_horovod/requirements.txt --no-cache +pip install -r openfl-workspace/torch/llm_horovod/requirements.txt --no-cache diff --git a/openfl-workspace/torch_llm_horovod/src/InHorovodLLMTrainer.py b/openfl-workspace/torch/horovod/src/InHorovodLLMTrainer.py similarity index 100% rename from openfl-workspace/torch_llm_horovod/src/InHorovodLLMTrainer.py rename to openfl-workspace/torch/horovod/src/InHorovodLLMTrainer.py diff --git a/openfl-workspace/torch_llm_horovod/src/InHorovodrun.py b/openfl-workspace/torch/horovod/src/InHorovodrun.py similarity index 100% rename from openfl-workspace/torch_llm_horovod/src/InHorovodrun.py rename to openfl-workspace/torch/horovod/src/InHorovodrun.py diff --git a/openfl-workspace/torch_cnn_mnist_eden_compression/src/__init__.py b/openfl-workspace/torch/horovod/src/__init__.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist_eden_compression/src/__init__.py rename to openfl-workspace/torch/horovod/src/__init__.py diff --git a/openfl-workspace/torch_llm_horovod/src/emotion_utils.py b/openfl-workspace/torch/horovod/src/emotion_utils.py similarity index 100% rename from openfl-workspace/torch_llm_horovod/src/emotion_utils.py rename to openfl-workspace/torch/horovod/src/emotion_utils.py diff --git a/openfl-workspace/torch_llm_horovod/src/model_utils.py b/openfl-workspace/torch/horovod/src/model_utils.py similarity index 100% rename from openfl-workspace/torch_llm_horovod/src/model_utils.py rename to openfl-workspace/torch/horovod/src/model_utils.py diff --git a/openfl-workspace/torch_llm_horovod/src/pt_model.py b/openfl-workspace/torch/horovod/src/pt_model.py similarity index 100% rename from openfl-workspace/torch_llm_horovod/src/pt_model.py rename to openfl-workspace/torch/horovod/src/pt_model.py diff --git a/openfl-workspace/torch_llm_horovod/src/ptemotion_inmemory.py b/openfl-workspace/torch/horovod/src/ptemotion_inmemory.py similarity index 100% rename from openfl-workspace/torch_llm_horovod/src/ptemotion_inmemory.py rename to openfl-workspace/torch/horovod/src/ptemotion_inmemory.py diff --git a/openfl-workspace/torch_unet_kvasir/.workspace b/openfl-workspace/torch/mnist/.workspace similarity index 100% rename from openfl-workspace/torch_unet_kvasir/.workspace rename to openfl-workspace/torch/mnist/.workspace diff --git a/openfl-workspace/torch_cnn_mnist/README.md b/openfl-workspace/torch/mnist/README.md similarity index 97% rename from openfl-workspace/torch_cnn_mnist/README.md rename to openfl-workspace/torch/mnist/README.md index 17019afa1b..e3666c1763 100644 --- a/openfl-workspace/torch_cnn_mnist/README.md +++ b/openfl-workspace/torch/mnist/README.md @@ -1,5 +1,5 @@ ## Instantiating a Workspace from Torch Template -To instantiate a workspace from the torch_cnn_mnist template, you can use the fx workspace create command. This allows you to quickly set up a new workspace based on a predefined configuration and template. +To instantiate a workspace from the torch/mnist template, you can use the fx workspace create command. This allows you to quickly set up a new workspace based on a predefined configuration and template. 1. Ensure the necessary dependencies are installed. ``` @@ -13,7 +13,7 @@ pip install openfl ``` cd ~/openfl-quickstart -fx workspace create --template torch_cnn_mnist --prefix fl_workspace +fx workspace create --template torch/mnist --prefix fl_workspace cd ~/openfl-quickstart/fl_workspace ``` diff --git a/openfl-workspace/torch_cnn_mnist/plan/cols.yaml b/openfl-workspace/torch/mnist/plan/cols.yaml similarity index 100% rename from openfl-workspace/torch_cnn_mnist/plan/cols.yaml rename to openfl-workspace/torch/mnist/plan/cols.yaml diff --git a/openfl-workspace/torch_cnn_mnist/plan/data.yaml b/openfl-workspace/torch/mnist/plan/data.yaml similarity index 100% rename from openfl-workspace/torch_cnn_mnist/plan/data.yaml rename to openfl-workspace/torch/mnist/plan/data.yaml diff --git a/openfl-workspace/torch_cnn_mnist/plan/defaults b/openfl-workspace/torch/mnist/plan/defaults similarity index 100% rename from openfl-workspace/torch_cnn_mnist/plan/defaults rename to openfl-workspace/torch/mnist/plan/defaults diff --git a/openfl-workspace/torch_cnn_mnist/plan/plan.yaml b/openfl-workspace/torch/mnist/plan/plan.yaml similarity index 100% rename from openfl-workspace/torch_cnn_mnist/plan/plan.yaml rename to openfl-workspace/torch/mnist/plan/plan.yaml diff --git a/openfl-workspace/torch_cnn_mnist/requirements.txt b/openfl-workspace/torch/mnist/requirements.txt similarity index 100% rename from openfl-workspace/torch_cnn_mnist/requirements.txt rename to openfl-workspace/torch/mnist/requirements.txt diff --git a/openfl-workspace/torch_cnn_mnist/src/__init__.py b/openfl-workspace/torch/mnist/src/__init__.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist/src/__init__.py rename to openfl-workspace/torch/mnist/src/__init__.py diff --git a/openfl-workspace/torch_cnn_mnist/src/cnn_model.py b/openfl-workspace/torch/mnist/src/cnn_model.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist/src/cnn_model.py rename to openfl-workspace/torch/mnist/src/cnn_model.py diff --git a/openfl-workspace/torch_cnn_mnist/src/dataloader.py b/openfl-workspace/torch/mnist/src/dataloader.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist/src/dataloader.py rename to openfl-workspace/torch/mnist/src/dataloader.py diff --git a/openfl-workspace/torch_cnn_mnist/src/taskrunner.py b/openfl-workspace/torch/mnist/src/taskrunner.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist/src/taskrunner.py rename to openfl-workspace/torch/mnist/src/taskrunner.py diff --git a/openfl-workspace/torch/mnist_eden_compression/.workspace b/openfl-workspace/torch/mnist_eden_compression/.workspace new file mode 100644 index 0000000000..3c2c5d08b4 --- /dev/null +++ b/openfl-workspace/torch/mnist_eden_compression/.workspace @@ -0,0 +1,2 @@ +current_plan_name: default + diff --git a/openfl-workspace/torch_cnn_mnist_fed_eval/plan/cols.yaml b/openfl-workspace/torch/mnist_eden_compression/plan/cols.yaml similarity index 100% rename from openfl-workspace/torch_cnn_mnist_fed_eval/plan/cols.yaml rename to openfl-workspace/torch/mnist_eden_compression/plan/cols.yaml diff --git a/openfl-workspace/torch_cnn_mnist_fed_eval/plan/data.yaml b/openfl-workspace/torch/mnist_eden_compression/plan/data.yaml similarity index 100% rename from openfl-workspace/torch_cnn_mnist_fed_eval/plan/data.yaml rename to openfl-workspace/torch/mnist_eden_compression/plan/data.yaml diff --git a/openfl-workspace/torch_cnn_mnist_fed_eval/plan/defaults b/openfl-workspace/torch/mnist_eden_compression/plan/defaults similarity index 100% rename from openfl-workspace/torch_cnn_mnist_fed_eval/plan/defaults rename to openfl-workspace/torch/mnist_eden_compression/plan/defaults diff --git a/openfl-workspace/torch_cnn_mnist_eden_compression/plan/plan.yaml b/openfl-workspace/torch/mnist_eden_compression/plan/plan.yaml similarity index 100% rename from openfl-workspace/torch_cnn_mnist_eden_compression/plan/plan.yaml rename to openfl-workspace/torch/mnist_eden_compression/plan/plan.yaml diff --git a/openfl-workspace/torch_cnn_mnist_eden_compression/requirements.txt b/openfl-workspace/torch/mnist_eden_compression/requirements.txt similarity index 100% rename from openfl-workspace/torch_cnn_mnist_eden_compression/requirements.txt rename to openfl-workspace/torch/mnist_eden_compression/requirements.txt diff --git a/openfl-workspace/torch_cnn_mnist_fed_eval/src/__init__.py b/openfl-workspace/torch/mnist_eden_compression/src/__init__.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist_fed_eval/src/__init__.py rename to openfl-workspace/torch/mnist_eden_compression/src/__init__.py diff --git a/openfl-workspace/torch_cnn_mnist_eden_compression/src/mnist_utils.py b/openfl-workspace/torch/mnist_eden_compression/src/mnist_utils.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist_eden_compression/src/mnist_utils.py rename to openfl-workspace/torch/mnist_eden_compression/src/mnist_utils.py diff --git a/openfl-workspace/torch_cnn_mnist_eden_compression/src/pt_cnn.py b/openfl-workspace/torch/mnist_eden_compression/src/pt_cnn.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist_eden_compression/src/pt_cnn.py rename to openfl-workspace/torch/mnist_eden_compression/src/pt_cnn.py diff --git a/openfl-workspace/torch_cnn_mnist_eden_compression/src/ptmnist_inmemory.py b/openfl-workspace/torch/mnist_eden_compression/src/ptmnist_inmemory.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist_eden_compression/src/ptmnist_inmemory.py rename to openfl-workspace/torch/mnist_eden_compression/src/ptmnist_inmemory.py diff --git a/openfl-workspace/torch/mnist_fed_eval/.workspace b/openfl-workspace/torch/mnist_fed_eval/.workspace new file mode 100644 index 0000000000..3c2c5d08b4 --- /dev/null +++ b/openfl-workspace/torch/mnist_fed_eval/.workspace @@ -0,0 +1,2 @@ +current_plan_name: default + diff --git a/openfl-workspace/torch_cnn_mnist_straggler_check/plan/cols.yaml b/openfl-workspace/torch/mnist_fed_eval/plan/cols.yaml similarity index 100% rename from openfl-workspace/torch_cnn_mnist_straggler_check/plan/cols.yaml rename to openfl-workspace/torch/mnist_fed_eval/plan/cols.yaml diff --git a/openfl-workspace/torch_cnn_mnist_straggler_check/plan/data.yaml b/openfl-workspace/torch/mnist_fed_eval/plan/data.yaml similarity index 100% rename from openfl-workspace/torch_cnn_mnist_straggler_check/plan/data.yaml rename to openfl-workspace/torch/mnist_fed_eval/plan/data.yaml diff --git a/openfl-workspace/torch_cnn_mnist_straggler_check/plan/defaults b/openfl-workspace/torch/mnist_fed_eval/plan/defaults similarity index 100% rename from openfl-workspace/torch_cnn_mnist_straggler_check/plan/defaults rename to openfl-workspace/torch/mnist_fed_eval/plan/defaults diff --git a/openfl-workspace/torch_cnn_mnist_fed_eval/plan/plan.yaml b/openfl-workspace/torch/mnist_fed_eval/plan/plan.yaml similarity index 100% rename from openfl-workspace/torch_cnn_mnist_fed_eval/plan/plan.yaml rename to openfl-workspace/torch/mnist_fed_eval/plan/plan.yaml diff --git a/openfl-workspace/torch_cnn_mnist_fed_eval/requirements.txt b/openfl-workspace/torch/mnist_fed_eval/requirements.txt similarity index 100% rename from openfl-workspace/torch_cnn_mnist_fed_eval/requirements.txt rename to openfl-workspace/torch/mnist_fed_eval/requirements.txt diff --git a/openfl-workspace/torch_cnn_mnist_straggler_check/src/__init__.py b/openfl-workspace/torch/mnist_fed_eval/src/__init__.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist_straggler_check/src/__init__.py rename to openfl-workspace/torch/mnist_fed_eval/src/__init__.py diff --git a/openfl-workspace/torch_cnn_mnist_fed_eval/src/mnist_utils.py b/openfl-workspace/torch/mnist_fed_eval/src/mnist_utils.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist_fed_eval/src/mnist_utils.py rename to openfl-workspace/torch/mnist_fed_eval/src/mnist_utils.py diff --git a/openfl-workspace/torch_cnn_mnist_fed_eval/src/pt_cnn.py b/openfl-workspace/torch/mnist_fed_eval/src/pt_cnn.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist_fed_eval/src/pt_cnn.py rename to openfl-workspace/torch/mnist_fed_eval/src/pt_cnn.py diff --git a/openfl-workspace/torch_cnn_mnist_fed_eval/src/ptmnist_inmemory.py b/openfl-workspace/torch/mnist_fed_eval/src/ptmnist_inmemory.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist_fed_eval/src/ptmnist_inmemory.py rename to openfl-workspace/torch/mnist_fed_eval/src/ptmnist_inmemory.py diff --git a/openfl-workspace/torch/mnist_straggler_check/.workspace b/openfl-workspace/torch/mnist_straggler_check/.workspace new file mode 100644 index 0000000000..3c2c5d08b4 --- /dev/null +++ b/openfl-workspace/torch/mnist_straggler_check/.workspace @@ -0,0 +1,2 @@ +current_plan_name: default + diff --git a/openfl-workspace/torch_llm_horovod/plan/cols.yaml b/openfl-workspace/torch/mnist_straggler_check/plan/cols.yaml similarity index 100% rename from openfl-workspace/torch_llm_horovod/plan/cols.yaml rename to openfl-workspace/torch/mnist_straggler_check/plan/cols.yaml diff --git a/openfl-workspace/torch_llm_horovod/plan/data.yaml b/openfl-workspace/torch/mnist_straggler_check/plan/data.yaml similarity index 100% rename from openfl-workspace/torch_llm_horovod/plan/data.yaml rename to openfl-workspace/torch/mnist_straggler_check/plan/data.yaml diff --git a/openfl-workspace/torch_llm_horovod/plan/defaults b/openfl-workspace/torch/mnist_straggler_check/plan/defaults similarity index 100% rename from openfl-workspace/torch_llm_horovod/plan/defaults rename to openfl-workspace/torch/mnist_straggler_check/plan/defaults diff --git a/openfl-workspace/torch_cnn_mnist_straggler_check/plan/plan.yaml b/openfl-workspace/torch/mnist_straggler_check/plan/plan.yaml similarity index 100% rename from openfl-workspace/torch_cnn_mnist_straggler_check/plan/plan.yaml rename to openfl-workspace/torch/mnist_straggler_check/plan/plan.yaml diff --git a/openfl-workspace/torch_cnn_mnist_straggler_check/requirements.txt b/openfl-workspace/torch/mnist_straggler_check/requirements.txt similarity index 100% rename from openfl-workspace/torch_cnn_mnist_straggler_check/requirements.txt rename to openfl-workspace/torch/mnist_straggler_check/requirements.txt diff --git a/openfl-workspace/torch_llm_horovod/src/__init__.py b/openfl-workspace/torch/mnist_straggler_check/src/__init__.py similarity index 100% rename from openfl-workspace/torch_llm_horovod/src/__init__.py rename to openfl-workspace/torch/mnist_straggler_check/src/__init__.py diff --git a/openfl-workspace/torch_cnn_mnist_straggler_check/src/mnist_utils.py b/openfl-workspace/torch/mnist_straggler_check/src/mnist_utils.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist_straggler_check/src/mnist_utils.py rename to openfl-workspace/torch/mnist_straggler_check/src/mnist_utils.py diff --git a/openfl-workspace/torch_cnn_mnist_straggler_check/src/pt_cnn.py b/openfl-workspace/torch/mnist_straggler_check/src/pt_cnn.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist_straggler_check/src/pt_cnn.py rename to openfl-workspace/torch/mnist_straggler_check/src/pt_cnn.py diff --git a/openfl-workspace/torch_cnn_mnist_straggler_check/src/ptmnist_inmemory.py b/openfl-workspace/torch/mnist_straggler_check/src/ptmnist_inmemory.py similarity index 100% rename from openfl-workspace/torch_cnn_mnist_straggler_check/src/ptmnist_inmemory.py rename to openfl-workspace/torch/mnist_straggler_check/src/ptmnist_inmemory.py diff --git a/openfl-workspace/torch_template/.workspace b/openfl-workspace/torch/template/.workspace similarity index 100% rename from openfl-workspace/torch_template/.workspace rename to openfl-workspace/torch/template/.workspace diff --git a/openfl-workspace/torch_template/plan/cols.yaml b/openfl-workspace/torch/template/plan/cols.yaml similarity index 100% rename from openfl-workspace/torch_template/plan/cols.yaml rename to openfl-workspace/torch/template/plan/cols.yaml diff --git a/openfl-workspace/torch_template/plan/data.yaml b/openfl-workspace/torch/template/plan/data.yaml similarity index 100% rename from openfl-workspace/torch_template/plan/data.yaml rename to openfl-workspace/torch/template/plan/data.yaml diff --git a/openfl-workspace/torch_template/plan/defaults b/openfl-workspace/torch/template/plan/defaults similarity index 100% rename from openfl-workspace/torch_template/plan/defaults rename to openfl-workspace/torch/template/plan/defaults diff --git a/openfl-workspace/torch_template/plan/plan.yaml b/openfl-workspace/torch/template/plan/plan.yaml similarity index 100% rename from openfl-workspace/torch_template/plan/plan.yaml rename to openfl-workspace/torch/template/plan/plan.yaml diff --git a/openfl-workspace/torch_template/requirements.txt b/openfl-workspace/torch/template/requirements.txt similarity index 100% rename from openfl-workspace/torch_template/requirements.txt rename to openfl-workspace/torch/template/requirements.txt diff --git a/openfl-workspace/torch_template/src/__init__.py b/openfl-workspace/torch/template/src/__init__.py similarity index 100% rename from openfl-workspace/torch_template/src/__init__.py rename to openfl-workspace/torch/template/src/__init__.py diff --git a/openfl-workspace/torch_template/src/dataloader.py b/openfl-workspace/torch/template/src/dataloader.py similarity index 100% rename from openfl-workspace/torch_template/src/dataloader.py rename to openfl-workspace/torch/template/src/dataloader.py diff --git a/openfl-workspace/torch_template/src/taskrunner.py b/openfl-workspace/torch/template/src/taskrunner.py similarity index 100% rename from openfl-workspace/torch_template/src/taskrunner.py rename to openfl-workspace/torch/template/src/taskrunner.py diff --git a/openfl-workspace/torch/unet_kvasir/.workspace b/openfl-workspace/torch/unet_kvasir/.workspace new file mode 100644 index 0000000000..3c2c5d08b4 --- /dev/null +++ b/openfl-workspace/torch/unet_kvasir/.workspace @@ -0,0 +1,2 @@ +current_plan_name: default + diff --git a/openfl-workspace/torch_unet_kvasir/plan/cols.yaml b/openfl-workspace/torch/unet_kvasir/plan/cols.yaml similarity index 100% rename from openfl-workspace/torch_unet_kvasir/plan/cols.yaml rename to openfl-workspace/torch/unet_kvasir/plan/cols.yaml diff --git a/openfl-workspace/torch_unet_kvasir/plan/data.yaml b/openfl-workspace/torch/unet_kvasir/plan/data.yaml similarity index 100% rename from openfl-workspace/torch_unet_kvasir/plan/data.yaml rename to openfl-workspace/torch/unet_kvasir/plan/data.yaml diff --git a/openfl-workspace/torch_unet_kvasir/plan/defaults b/openfl-workspace/torch/unet_kvasir/plan/defaults similarity index 100% rename from openfl-workspace/torch_unet_kvasir/plan/defaults rename to openfl-workspace/torch/unet_kvasir/plan/defaults diff --git a/openfl-workspace/torch_unet_kvasir/plan/plan.yaml b/openfl-workspace/torch/unet_kvasir/plan/plan.yaml similarity index 100% rename from openfl-workspace/torch_unet_kvasir/plan/plan.yaml rename to openfl-workspace/torch/unet_kvasir/plan/plan.yaml diff --git a/openfl-workspace/torch_unet_kvasir/requirements.txt b/openfl-workspace/torch/unet_kvasir/requirements.txt similarity index 100% rename from openfl-workspace/torch_unet_kvasir/requirements.txt rename to openfl-workspace/torch/unet_kvasir/requirements.txt diff --git a/openfl-workspace/torch_unet_kvasir/src/__init__.py b/openfl-workspace/torch/unet_kvasir/src/__init__.py similarity index 100% rename from openfl-workspace/torch_unet_kvasir/src/__init__.py rename to openfl-workspace/torch/unet_kvasir/src/__init__.py diff --git a/openfl-workspace/torch_unet_kvasir/src/dataloader.py b/openfl-workspace/torch/unet_kvasir/src/dataloader.py similarity index 100% rename from openfl-workspace/torch_unet_kvasir/src/dataloader.py rename to openfl-workspace/torch/unet_kvasir/src/dataloader.py diff --git a/openfl-workspace/torch_unet_kvasir/src/pt_unet_parts.py b/openfl-workspace/torch/unet_kvasir/src/pt_unet_parts.py similarity index 100% rename from openfl-workspace/torch_unet_kvasir/src/pt_unet_parts.py rename to openfl-workspace/torch/unet_kvasir/src/pt_unet_parts.py diff --git a/openfl-workspace/torch_unet_kvasir/src/taskrunner.py b/openfl-workspace/torch/unet_kvasir/src/taskrunner.py similarity index 100% rename from openfl-workspace/torch_unet_kvasir/src/taskrunner.py rename to openfl-workspace/torch/unet_kvasir/src/taskrunner.py diff --git a/openfl-workspace/xgb_higgs/.workspace b/openfl-workspace/xgb_higgs/.workspace new file mode 100644 index 0000000000..3c2c5d08b4 --- /dev/null +++ b/openfl-workspace/xgb_higgs/.workspace @@ -0,0 +1,2 @@ +current_plan_name: default + diff --git a/openfl/interface/workspace.py b/openfl/interface/workspace.py index 522ff99b5f..8881ec9d8f 100644 --- a/openfl/interface/workspace.py +++ b/openfl/interface/workspace.py @@ -97,11 +97,15 @@ def get_templates(): list: A list of default templates. """ - return [ - d.name - for d in WORKSPACE.glob("*") - if d.is_dir() and d.name not in ["__pycache__", "workspace", "experimental"] - ] + templates = [] + excluded_dirs = ["workspace", "experimental"] + for root, _, files in os.walk(WORKSPACE): + if any(file.endswith(".workspace") for file in files): + dir_path = os.path.relpath(root, WORKSPACE) + dir_path = dir_path.replace(os.sep, "/") + if dir_path and not any(dir_path.startswith(prefix) for prefix in excluded_dirs): + templates.append(dir_path) + return templates @workspace.command(name="create") diff --git a/openfl/native/native.py b/openfl/native/native.py index 117058abbb..f0ed3f3071 100644 --- a/openfl/native/native.py +++ b/openfl/native/native.py @@ -216,8 +216,7 @@ def init( workspace_template (str): The template that should be used as the basis for the experiment. Defaults to 'default'. Other options include are any of the template names - [keras_cnn_mnist, tf_2dunet, tf_cnn_histology, - mtorch_cnn_histology, torch_cnn_mnist]. + [keras/mnist, torch/histology, torch/mnist]. log_level (str): Log level for logging. METRIC level is available. Defaults to 'INFO'. log_file (str): Name of the file in which the log will be duplicated. diff --git a/tests/end_to_end/README.md b/tests/end_to_end/README.md index 191cfd0db4..cd6ada7227 100644 --- a/tests/end_to_end/README.md +++ b/tests/end_to_end/README.md @@ -49,16 +49,16 @@ Below parameters are available for modification: 4. --disable_tls - to disable TLS communication (by default it is enabled) 5. --disable_client_auth - to disable the client authentication (by default it is enabled) -For example, to run Task runner (bare metal approach) with - torch_cnn_mnist model, 3 collaborators, 5 rounds and non-TLS scenario: +For example, to run Task runner (bare metal approach) with - torch/mnist model, 3 collaborators, 5 rounds and non-TLS scenario: ```sh -python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py -m task_runner_basic --num_rounds 5 --num_collaborators 3 --model_name torch_cnn_mnist --disable_tls +python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py -m task_runner_basic --num_rounds 5 --num_collaborators 3 --model_name torch/mnist --disable_tls ``` -And, to run Task runner (via dockerized workspace) with keras_cnn_mnist, 2 collaborators, 3 rounds: +And, to run Task runner (via dockerized workspace) with keras/mnist, 2 collaborators, 3 rounds: ```sh -python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py -m task_runner_dockerized_ws --num_rounds 3 --num_collaborators 2 --model_name keras_cnn_mnist +python -m pytest -s tests/end_to_end/test_suites/task_runner_tests.py -m task_runner_dockerized_ws --num_rounds 3 --num_collaborators 2 --model_name keras/mnist ``` ### Fixture and marker mapping: diff --git a/tests/end_to_end/utils/conftest_helper.py b/tests/end_to_end/utils/conftest_helper.py index d623c21201..af912dd2c6 100644 --- a/tests/end_to_end/utils/conftest_helper.py +++ b/tests/end_to_end/utils/conftest_helper.py @@ -17,7 +17,7 @@ def parse_arguments(): - results_dir (str, optional): Directory to store the results - num_collaborators (int, default=2): Number of collaborators - num_rounds (int, default=5): Number of rounds to train - - model_name (str, default="torch_cnn_mnist"): Model name + - model_name (str, default="torch/mnist"): Model name - disable_client_auth (bool): Disable client authentication - disable_tls (bool): Disable TLS for communication - log_memory_usage (bool): Enable Memory leak logs diff --git a/tests/end_to_end/utils/constants.py b/tests/end_to_end/utils/constants.py index a9f66e47ef..94cf4d1999 100644 --- a/tests/end_to_end/utils/constants.py +++ b/tests/end_to_end/utils/constants.py @@ -10,15 +10,15 @@ class ModelName(Enum): """ # IMP - The model name must be same (and in uppercase) as the model value. # This is used to identify the model in the tests. - TORCH_CNN_MNIST = "torch_cnn_mnist" - KERAS_CNN_MNIST = "keras_cnn_mnist" - TORCH_CNN_HISTOLOGY = "torch_cnn_histology" + TORCH_MNIST = "torch/mnist" + KERAS_MNIST = "keras/mnist" + TORCH_HISTOLOGY = "torch/histology" XGB_HIGGS = "xgb_higgs" NUM_COLLABORATORS = 2 NUM_ROUNDS = 5 WORKSPACE_NAME = "my_federation" -DEFAULT_MODEL_NAME = "torch_cnn_mnist" +DEFAULT_MODEL_NAME = "torch/mnist" SUCCESS_MARKER = "✔️ OK" # Docker specific constants diff --git a/tests/end_to_end/utils/federation_helper.py b/tests/end_to_end/utils/federation_helper.py index 067d95918d..ff37f2430c 100644 --- a/tests/end_to_end/utils/federation_helper.py +++ b/tests/end_to_end/utils/federation_helper.py @@ -462,13 +462,13 @@ def federation_env_setup_and_validate(request, eval_scope=False): test_env = request.config.test_env # Validate the model name and create the workspace name - if not request.config.model_name.upper() in constants.ModelName._member_names_: + if not request.config.model_name.replace("/", "_").upper() in constants.ModelName._member_names_: raise ValueError(f"Invalid model name: {request.config.model_name}") # Set the workspace path home_dir = Path().home() local_bind_path = os.path.join( - home_dir, request.config.results_dir, request.config.model_name + home_dir, request.config.results_dir, request.config.model_name.replace("/", "_") ) num_rounds = request.config.num_rounds diff --git a/tests/end_to_end/utils/summary_helper.py b/tests/end_to_end/utils/summary_helper.py index 15b267ee6b..dec525070a 100644 --- a/tests/end_to_end/utils/summary_helper.py +++ b/tests/end_to_end/utils/summary_helper.py @@ -140,7 +140,7 @@ def print_task_runner_score(): num_cols = os.getenv("NUM_COLLABORATORS") num_rounds = os.getenv("NUM_ROUNDS") - model_name = os.getenv("MODEL_NAME") + model_name = os.getenv("MODEL_NAME").replace("/", "_") summary_file = _get_summary_file() # Validate the model name and create the workspace name diff --git a/tests/github/test_double_ws_export.py b/tests/github/test_double_ws_export.py index 95c9440b31..07d2714ce8 100644 --- a/tests/github/test_double_ws_export.py +++ b/tests/github/test_double_ws_export.py @@ -22,7 +22,7 @@ def main(): for entry in iterator: if entry.name not in ['__init__.py', 'workspace', 'default']: workspace_choice.append(entry.name) - parser.add_argument('--template', default='keras_cnn_mnist', choices=workspace_choice) + parser.add_argument('--template', default='keras/mnist', choices=workspace_choice) parser.add_argument('--fed_workspace', default='fed_work12345alpha81671') parser.add_argument('--col1', default='one123dragons') parser.add_argument('--col2', default='beta34unicorns') diff --git a/tests/github/test_gandlf.py b/tests/github/test_gandlf.py index a57f9f53a0..a8696be541 100644 --- a/tests/github/test_gandlf.py +++ b/tests/github/test_gandlf.py @@ -21,7 +21,7 @@ def exec(command, directory): def main(): parser = argparse.ArgumentParser() - parser.add_argument('--template', default='keras_cnn_mnist') + parser.add_argument('--template', default='keras/mnist') parser.add_argument('--fed_workspace', default='fed_work12345alpha81671') parser.add_argument('--col1', default='one') parser.add_argument('--col2', default='two') diff --git a/tests/github/test_hello_federation.py b/tests/github/test_hello_federation.py index e6b84b8de2..a769ffcb58 100644 --- a/tests/github/test_hello_federation.py +++ b/tests/github/test_hello_federation.py @@ -17,11 +17,14 @@ def main(): # Test the pipeline parser = argparse.ArgumentParser() workspace_choice = [] - with os.scandir('openfl-workspace') as iterator: - for entry in iterator: - if entry.name not in ['__init__.py', 'workspace', 'default']: - workspace_choice.append(entry.name) - parser.add_argument('--template', default='keras_cnn_mnist', choices=workspace_choice) + excluded_dirs = ['workspace', 'default', "experimental"] + for root, _, files in os.walk('openfl-workspace'): + if any(file.endswith(".workspace") for file in files): + dir_path = os.path.relpath(root, 'openfl-workspace') + dir_path = dir_path.replace(os.sep, '/') + if dir_path and not any(dir_path.startswith(prefix) for prefix in excluded_dirs): + workspace_choice.append(dir_path) + parser.add_argument('--template', default='keras/mnist', choices=workspace_choice) parser.add_argument('--fed_workspace', default='fed_work12345alpha81671') parser.add_argument('--col1', default='one123dragons') parser.add_argument('--col2', default='beta34unicorns')