Skip to content

Commit a954def

Browse files
authored
Add an new DAG for goodput replica resize (GoogleCloudPlatform#1323)
This change adds a new DAG for goodput elastic replica resizing to validate the resilience, recovery, and scaling behaviors of MaxText Pathways Elastic Training. It also confirms that goodput is properly enabled and tracking metrics via three core Airflow tasks/sensors: `check_goodput_logs`, `check_goodput_logname`, and `check_workload_goodput`.
1 parent 7411d87 commit a954def

5 files changed

Lines changed: 224 additions & 158 deletions

File tree

dags/common/scheduling_helper/scheduling_helper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class DayOfWeek(enum.Enum):
5757

5858
DagIdToTimeout: TypeAlias = dict[str, dt.timedelta]
5959
DefaultTimeout: dt.timedelta = dt.timedelta(minutes=30)
60+
# pylint: disable=line-too-long
6061
REGISTERED_DAGS: dict[str, DagIdToTimeout] = {
6162
TPU_OBS_MOCK_CLUSTER.name: {
6263
"gke_node_pool_label_update": DefaultTimeout,
@@ -96,8 +97,10 @@ class DayOfWeek(enum.Enum):
9697
"pw_elastic_pause_resume": DefaultTimeout,
9798
"pw_elastic_replica_resize": DefaultTimeout,
9899
"pw_elastic_goodput": DefaultTimeout,
100+
"pw_elastic_goodput_replica": DefaultTimeout,
99101
},
100102
}
103+
# pylint: enable=line-too-long
101104

102105

103106
def get_dag_timeout(dag_id: str) -> dt.timedelta:

dags/maxtext_pathways/configs/parameters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@
134134
),
135135
),
136136
"priority": Param(
137-
"medium",
137+
"high",
138138
type="string",
139139
title="Priority",
140140
description="Priority for the workload",
141-
enum=["very high", "high", "medium", "low"],
141+
enum=["very-high", "high", "medium", "low"],
142142
),
143143
"max_restarts": Param(
144144
1,

dags/maxtext_pathways/configs/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@
2323
from xlml.utils import gke, xpk
2424

2525

26+
# TODO(cienet): Replace this with an official one.
27+
COLOCATED_PYTHON_IMAGE = (
28+
"gcr.io/tpu-prod-env-multipod/lidanny_maxtext-colocated-python:latest"
29+
)
30+
31+
2632
def generate_recipe_workload_id(dag_id: str) -> tuple[str, str]:
2733
"""Generate a workload_id following the standard naming convention."""
2834
time.localtime()
29-
timestamp = time.strftime("%Y%m%d%H%M%S", time.localtime())
35+
timestamp = time.strftime("%m%d%H%M%S", time.localtime())
3036
name = f"{dag_id[:10]}-{timestamp[:10]}"
3137
name = name[:40].replace("_", "-")
3238

dags/maxtext_pathways/pw_mcjax_elastic.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,20 @@
2929
from dags.common.scheduling_helper.scheduling_helper import SchedulingHelper
3030
from dags.maxtext_pathways.configs import parameters as ui_params
3131
from dags.maxtext_pathways.configs import recipe_config as recipe_cfg
32-
from dags.maxtext_pathways.configs.utils import get_dag_parameters, generate_install_dependencies_commands, generate_derived_parameters
32+
from dags.maxtext_pathways.configs.utils import (
33+
get_dag_parameters,
34+
generate_install_dependencies_commands,
35+
generate_derived_parameters,
36+
COLOCATED_PYTHON_IMAGE,
37+
)
3338
from xlml.utils import kpo, xpk
3439

40+
3541
ELASTIC_TYPE = ["Pause-resume", "Replica-resize"]
3642
elastic_params = ui_params.PARAMETERS.copy()
3743
elastic_params.update({
3844
"colocated_python_image": ui_params.Param(
39-
"gcr.io/tpu-prod-env-multipod/lidanny_maxtext-colocated-python:latest",
45+
COLOCATED_PYTHON_IMAGE,
4046
type="string",
4147
title="Colocated Python Image",
4248
description="Colocated Python image for pathways.",
@@ -266,11 +272,11 @@ def worker_pod_interruption(
266272
)
267273

268274
# TODO(cienet): Refine the mechanism to chain tasks
269-
_ = (
270-
wait_for_step
271-
>> trigger_interrupt
272-
>> wait_for_elastic_attempt
273-
>> wait_for_slices_active
275+
chain(
276+
wait_for_step,
277+
trigger_interrupt,
278+
wait_for_elastic_attempt,
279+
wait_for_slices_active,
274280
)
275281

276282
if previous_cycle_tail:

0 commit comments

Comments
 (0)