Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDP support for training loop #110

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reset rdzv_id when rank 0 node failed
It is does not necessarily run the rank 0 processes, but should still be
fine
ranlu committed Jan 17, 2025
commit 73f1944f2ff31b5a13bbb038a6b04373e3da01e8
8 changes: 8 additions & 0 deletions dags/training.py
Original file line number Diff line number Diff line change
@@ -36,6 +36,13 @@
)


def reset_rdzv_id(context):
from airflow.models import Variable
param = Variable.get("training_param", {}, deserialize_json=True)
param["rdzv_id"] = str(uuid.uuid4())
Variable.set("training_param", param, serialize_json=True)


def prep_parameters() -> dict:
"""Modify the user-supplied parameters to be used as a command for DeepEM."""
param = PARAM.copy()
@@ -107,6 +114,7 @@ def training_op(dag: DAG, rank=0, queue="deepem-gpu") -> Operator:
use_gpus=True,
environment=environment,
force_pull=True,
on_retry_callback=reset_rdzv_id if rank == 0 else None,
on_failure_callback=task_failure_alert,
on_success_callback=task_done_alert,
image=DEEPEM_IMAGE,