-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbeee50
commit b989d24
Showing
9 changed files
with
1,222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Hello PyTorch with MLFlow Experimental Tracking | ||
|
||
This example, show that one can using the existing tracker code written for Tensorboard, | ||
but change the metrics tracking with both Tensorflow and MLFLow | ||
|
||
The only change compare with hello-pt-tb example is adding the following component in fed_server_config.json | ||
|
||
```json | ||
{ | ||
"id": "mlflow_receiver", | ||
"path": "nvflare.app_opt.tracking.mlflow.mlflow_receiver.MLFlowReceiver", | ||
"args": { | ||
"kwargs": {"experiment_name": "hello-pt-experiments"}, | ||
"artifact_location": "artifacts" | ||
} | ||
} | ||
|
||
``` |
640 changes: 640 additions & 0 deletions
640
examples/tutorial/hello-pt-tb-mlflow/experiment_tracking.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
...les/tutorial/hello-pt-tb-mlflow/hello-pt-tb-mlflow-job1/app/config/config_fed_client.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"format_version": 2, | ||
|
||
"executors": [ | ||
{ | ||
"tasks": [ | ||
"train", | ||
"submit_model", | ||
"validate" | ||
], | ||
"executor": { | ||
"id": "Executor", | ||
"path": "nvflare.app_common.executors.learner_executor.LearnerExecutor", | ||
"args": { | ||
"learner_id": "pt_learner" | ||
} | ||
} | ||
} | ||
], | ||
"task_result_filters": [ | ||
], | ||
"task_data_filters": [ | ||
], | ||
"components": [ | ||
{ | ||
"id": "pt_learner", | ||
"path": "pt_learner.PTLearner", | ||
"args": { | ||
"lr": 0.01, | ||
"epochs": 5, | ||
"analytic_sender_id": "analytic_sender" | ||
} | ||
}, | ||
{ | ||
"id": "analytic_sender", | ||
"name": "AnalyticsSender", | ||
"args": {"event_type": "analytix_log_stats"} | ||
}, | ||
{ | ||
"id": "event_to_fed", | ||
"name": "ConvertToFedEvent", | ||
"args": {"events_to_convert": ["analytix_log_stats"], "fed_event_prefix": "fed."} | ||
} | ||
] | ||
} |
81 changes: 81 additions & 0 deletions
81
...les/tutorial/hello-pt-tb-mlflow/hello-pt-tb-mlflow-job1/app/config/config_fed_server.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"format_version": 2, | ||
|
||
"server": { | ||
"heart_beat_timeout": 600 | ||
}, | ||
"task_data_filters": [], | ||
"task_result_filters": [], | ||
"components": [ | ||
{ | ||
"id": "persistor", | ||
"path": "nvflare.app_opt.pt.file_model_persistor.PTFileModelPersistor", | ||
"args": { | ||
"model": { | ||
"path": "simple_network.SimpleNetwork" | ||
} | ||
} | ||
}, | ||
{ | ||
"id": "shareable_generator", | ||
"path": "nvflare.app_common.shareablegenerators.full_model_shareable_generator.FullModelShareableGenerator", | ||
"args": {} | ||
}, | ||
{ | ||
"id": "aggregator", | ||
"path": "nvflare.app_common.aggregators.intime_accumulate_model_aggregator.InTimeAccumulateWeightedAggregator", | ||
"args": { | ||
"expected_data_kind": "WEIGHTS" | ||
} | ||
}, | ||
{ | ||
"id": "model_locator", | ||
"path": "nvflare.app_opt.pt.file_model_locator.PTFileModelLocator", | ||
"args": { | ||
"pt_persistor_id": "persistor" | ||
} | ||
}, | ||
{ | ||
"id": "json_generator", | ||
"path": "nvflare.app_common.widgets.validation_json_generator.ValidationJsonGenerator", | ||
"args": {} | ||
}, | ||
{ | ||
"id": "tb_analytics_receiver", | ||
"name": "TBAnalyticsReceiver", | ||
"args": {"events": ["fed.analytix_log_stats"]} | ||
}, | ||
{ | ||
"id": "mlflow_receiver", | ||
"path": "nvflare.app_opt.tracking.mlflow.mlflow_receiver.MLFlowReceiver", | ||
"args": { | ||
"kwargs": {"experiment_name": "hello-pt-experiments"}, | ||
"artifact_location": "artifacts" | ||
} | ||
} | ||
], | ||
"workflows": [ | ||
{ | ||
"id": "scatter_and_gather", | ||
"name": "ScatterAndGather", | ||
"args": { | ||
"min_clients" : 2, | ||
"num_rounds" : 1, | ||
"start_round": 0, | ||
"wait_time_after_min_received": 10, | ||
"aggregator_id": "aggregator", | ||
"persistor_id": "persistor", | ||
"shareable_generator_id": "shareable_generator", | ||
"train_task_name": "train", | ||
"train_timeout": 0 | ||
} | ||
}, | ||
{ | ||
"id": "cross_site_validate", | ||
"name": "CrossSiteModelEval", | ||
"args": { | ||
"model_locator_id": "model_locator" | ||
} | ||
} | ||
] | ||
} |
22 changes: 22 additions & 0 deletions
22
examples/tutorial/hello-pt-tb-mlflow/hello-pt-tb-mlflow-job1/app/custom/pt_constants.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
class PTConstants: | ||
PTServerName = "server" | ||
PTFileModelName = "FL_global_model.pt" | ||
PTLocalModelName = "local_model.pt" | ||
|
||
PTModelsDir = "models" | ||
CrossValResultsJsonFilename = "cross_val_results.json" |
Oops, something went wrong.