-
-
Notifications
You must be signed in to change notification settings - Fork 744
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CoreEngine] update the workflow examples.
- Loading branch information
1 parent
c66dcf8
commit 5ce74ea
Showing
18 changed files
with
131 additions
and
40 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
51 changes: 51 additions & 0 deletions
51
python/fedml/workflow/driver_example/customized_job_example/README.md
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,51 @@ | ||
|
||
## Make your own workflow with multiple jobs | ||
# Define the job yaml | ||
``` | ||
working_directory = os.path.dirname(os.path.abspath(__file__)) | ||
deploy_image_job_yaml = os.path.join(working_directory, "deploy_image_job.yaml") | ||
deploy_3d_job_yaml = os.path.join(working_directory, "deploy_3d_job.yaml") | ||
train_job_yaml = os.path.join(working_directory, "train_job.yaml") | ||
``` | ||
|
||
# If needed, we may load the job yaml and change some config items. | ||
``` | ||
deploy_image_job_yaml_obj = DeployImageJob.load_yaml_config(deploy_image_job_yaml) | ||
deploy_3d_job_yaml_obj = DeployImageJob.load_yaml_config(deploy_3d_job_yaml) | ||
train_job_yaml_obj = DeployImageJob.load_yaml_config(train_job_yaml) | ||
# deploy_image_job_yaml_obj["computing"]["resource_type"] = "A100-80GB-SXM" | ||
# deploy_image_job_yaml_obj["computing"]["device_type"] = "GPU" | ||
# DeployImageJob.generate_yaml_doc(deploy_image_job_yaml_obj, deploy_image_job_yaml) | ||
``` | ||
|
||
# Generate the job object | ||
``` | ||
deploy_image_job = DeployImageJob(name="deploy_image_job", job_yaml_absolute_path=deploy_image_job_yaml) | ||
deploy_3d_job = Deploy3DJob(name="deploy_3d_job", job_yaml_absolute_path=deploy_3d_job_yaml) | ||
train_job = TrainJob(name="train_job", job_yaml_absolute_path=train_job_yaml) | ||
``` | ||
|
||
# Define the workflow | ||
``` | ||
workflow = Workflow(name="workflow_with_multi_jobs", loop=False) | ||
``` | ||
|
||
# Add the job object to workflow and set the dependency (DAG based). | ||
``` | ||
workflow.add_job(deploy_image_job) | ||
#workflow.add_job(deploy_3d_job, dependencies=[deploy_image_job]) | ||
workflow.add_job(train_job, dependencies=[deploy_image_job]) | ||
``` | ||
|
||
# Run workflow | ||
``` | ||
workflow.run() | ||
``` | ||
|
||
# After the workflow finished, print the graph, nodes and topological order | ||
``` | ||
print("graph", workflow.metadata.graph) | ||
print("nodes", workflow.metadata.nodes) | ||
print("topological_order", workflow.metadata.topological_order) | ||
print("loop", workflow.loop) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,7 +114,7 @@ def finalize_options(self): | |
|
||
setup( | ||
name="fedml", | ||
version="0.8.18.dev14", | ||
version="0.8.19.dev1", | ||
author="FedML Team", | ||
author_email="[email protected]", | ||
description="A research and production integrated edge-cloud library for " | ||
|