Skip to content

Commit dd9de10

Browse files
authored
chore: Set maxtext TPU E2E pre/post training DAGs priority to "very-high" (GoogleCloudPlatform#1311)
- Exposed the `priority` argument (defaulting to `"high"`) in `XpkTask` methods (`run`, `run_model`, `launch_workload`) within `xlml/apis/task.py` to allow passing custom scheduling priorities down to `xpk.run_workload`. - Explicitly set `priority="very-high"` in both `maxtext_e2e_tpu_pre_training.py` and `maxtext_e2e_tpu_post_training.py` DAGs to expedite these specific test runs.
1 parent 7f2b30d commit dd9de10

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

dags/multipod/maxtext_e2e_tpu_post_training.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def get_workload_name(model, mode, length=6):
9494
docker_image="{{ params.docker_image }}",
9595
cluster=XpkClusters.TPU_V5P_8_CLUSTER_V2,
9696
test_owner=test_owner.SURBHI_J,
97-
).run(skip_post_process=True)
97+
).run(skip_post_process=True, priority="very-high")
9898

9999
for mode, mode_test_config in test_config["post_training"].items():
100100
with TaskGroup(group_id=f"{mode}-{model}") as model_group:
@@ -125,6 +125,7 @@ def get_workload_name(model, mode, length=6):
125125
test_owner=test_owner.SURBHI_J,
126126
).run_model(
127127
use_pathways=True,
128+
priority="very-high",
128129
)
129130

130131
model_path = mode_test_config["maxtext_ckpt_path"].format(
@@ -140,7 +141,7 @@ def get_workload_name(model, mode, length=6):
140141
docker_image="{{ params.docker_image }}",
141142
cluster=XpkClusters.TPU_V5P_8_CLUSTER_V2,
142143
test_owner=test_owner.SURBHI_J,
143-
).run(skip_post_process=True)
144+
).run(skip_post_process=True, priority="very-high")
144145

145146
(
146147
convert_to_maxtext_task

dags/multipod/maxtext_e2e_tpu_pre_training.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
docker_image="{{ params.docker_image }}",
7171
cluster=XpkClusters.TPU_V5P_8_CLUSTER_V2,
7272
test_owner=test_owner.SURBHI_J,
73-
).run(skip_post_process=True)
73+
).run(skip_post_process=True, priority="very-high")
7474

7575
training_cmd = (f"export HF_TOKEN={HF_TOKEN}",) + (
7676
f"{test_config['training']['command']} {run_name}",
@@ -82,7 +82,7 @@
8282
docker_image="{{ params.docker_image }}",
8383
cluster=XpkClusters.TPU_V5P_128_CLUSTER,
8484
test_owner=test_owner.SURBHI_J,
85-
).run(skip_post_process=True)
85+
).run(skip_post_process=True, priority="very-high")
8686

8787
model_path = test_config["training"]["maxtext_ckpt_path"].format(
8888
run_name=run_name
@@ -97,6 +97,6 @@
9797
docker_image="{{ params.docker_image }}",
9898
cluster=XpkClusters.TPU_V5P_8_CLUSTER_V2,
9999
test_owner=test_owner.SURBHI_J,
100-
).run(skip_post_process=True)
100+
).run(skip_post_process=True, priority="very-high")
101101

102102
convert_to_maxtext_task >> training_task >> convert_to_huggingface_task

xlml/apis/task.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ def run(
350350
mtc_enabled: bool = False,
351351
xpk_branch: str = xpk.MAIN_BRANCH,
352352
max_restart: int = 0,
353+
priority: str = "high",
353354
) -> DAGNode:
354355
"""Run a test job within a docker image.
355356
@@ -371,6 +372,7 @@ def run(
371372
mtc_enabled,
372373
xpk_branch,
373374
max_restart,
375+
priority=priority,
374376
)
375377
if not skip_post_process:
376378
_ = run_model >> self.post_process(gcs_path)
@@ -727,6 +729,7 @@ def run_model(
727729
mtc_enabled: bool = False,
728730
xpk_branch: str = xpk.MAIN_BRANCH,
729731
max_restart: int = 0,
732+
priority: str = "high",
730733
) -> DAGNode:
731734
"""Run the TPU/GPU test in `task_test_config` using xpk.
732735
@@ -761,6 +764,7 @@ def run_model(
761764
mtc_enabled,
762765
xpk_branch,
763766
max_restart,
767+
priority=priority,
764768
)
765769
wait_for_workload_completion = xpk.wait_for_workload_completion.override(
766770
timeout=int(self.task_test_config.timeout.total_seconds()),
@@ -798,6 +802,7 @@ def launch_workload(
798802
mtc_enabled: bool = False,
799803
xpk_branch: str = xpk.MAIN_BRANCH,
800804
max_restart: int = 0,
805+
priority: str = "high",
801806
) -> DAGNode:
802807
"""Create the workload and wait for it to provision."""
803808
with TaskGroup(group_id="launch_workload") as group:
@@ -821,6 +826,7 @@ def launch_workload(
821826
mtc_enabled=mtc_enabled,
822827
xpk_branch=xpk_branch,
823828
max_restart=max_restart,
829+
priority=priority,
824830
)
825831
wait_for_workload_start = xpk.wait_for_workload_start.override(
826832
timeout=self.workload_provision_timeout.total_seconds()

0 commit comments

Comments
 (0)