Skip to content

Commit ff5e160

Browse files
committed
Fix format/linting errors and apply changes to DAGs that're affected
1 parent 79be043 commit ff5e160

6 files changed

Lines changed: 49 additions & 43 deletions

dags/examples/maxtext_aqtp_version_sweep_gke_example_dag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@
9898

9999
# Run jobs
100100
for test in tests:
101-
test.run_with_run_name_generation()
101+
test.to_name_gen_and_quarantine_task().run()

dags/examples/maxtext_profile_namegen_example_dag.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
"""
1616
An example DAG to extract profile metrics from pretraining mixtral-8x7b model on 1xv4-128.
17-
Profile extraction can be easily integrated with gke_config + run_with_run_name_generation.
17+
Profile extraction can be easily integrated with gke_config + (to_name_gen_and_quarantine_task + run).
1818
"""
1919

2020
import datetime
@@ -88,7 +88,8 @@
8888
) as dag:
8989
for run_name, test_scripts_details in test_models_tpu.items():
9090
for image in docker_image.keys():
91-
# file_location: pass in base_output_directory, will be altered in `run_with_run_name_generation`
91+
# file_location: pass in base_output_directory, will be altered in
92+
# XpkNameGenAndQuarantineTask.run_with_run_name_generation
9293
job_metric_config = metric_config.MetricConfig()
9394
# optionally, add tensorboard metrics
9495
job_metric_config.tensorboard_summary = metric_config.SummaryConfig(
@@ -105,13 +106,17 @@
105106
if "not_add_profile_config" in test_scripts_details:
106107
job_metric_config.profile = None
107108

108-
tpu_task = gke_config.get_gke_config(
109-
num_slices=1,
110-
time_out_in_min=test_scripts_details["time_out_in_min"],
111-
test_name=f"maxtext_{image}_{run_name}",
112-
run_model_cmds=test_scripts_details["train_command"],
113-
docker_image=docker_image[image],
114-
test_owner=test_owner.SHUNING_J,
115-
cluster=test_scripts_details["cluster"],
116-
user_specified_job_metric_config=job_metric_config, # customize config
117-
).run_with_run_name_generation(run_name_env="RUN_NAME")
109+
tpu_task = (
110+
gke_config.get_gke_config(
111+
num_slices=1,
112+
time_out_in_min=test_scripts_details["time_out_in_min"],
113+
test_name=f"maxtext_{image}_{run_name}",
114+
run_model_cmds=test_scripts_details["train_command"],
115+
docker_image=docker_image[image],
116+
test_owner=test_owner.SHUNING_J,
117+
cluster=test_scripts_details["cluster"],
118+
user_specified_job_metric_config=job_metric_config, # customize config
119+
)
120+
.to_name_gen_and_quarantine_task(run_name_env="RUN_NAME")
121+
.run()
122+
)

dags/examples/maxtext_profile_sweep_example_dag.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def dict_to_arg(param_dict):
3838

3939
docker_image = {
4040
"stable": (
41-
"gcr.io/tpu-prod-env-multipod/"
42-
"maxtext_jax_stable_stack:2025-05-20"
41+
"gcr.io/tpu-prod-env-multipod/" "maxtext_jax_stable_stack:2025-05-20"
4342
),
4443
}
4544

@@ -140,22 +139,20 @@ def dict_to_arg(param_dict):
140139
# generate run_name and tensorboard/profile location for extraction
141140
num_slices = [1]
142141
sweep_params = {}
143-
maxtext_sweep_gke_test = (
144-
maxtext_sweep_gke_config.get_maxtext_sweep_gke_config(
145-
test_owner=test_owner.SHUNING_J,
146-
dataset_project=Project.CLOUD_ML_AUTO_SOLUTIONS.value,
147-
composer_project=Project.CLOUD_ML_AUTO_SOLUTIONS.value,
148-
dataset_name=metric_config.DatasetOption.XLML_DATASET,
149-
cluster=test_scripts_details["cluster"],
150-
time_out_in_min=test_scripts_details["time_out_in_min"],
151-
base_output_directory=BASE_OUTPUT_PATH,
152-
num_slices=num_slices,
153-
docker_image=img_val,
154-
run_name_prefix=f"maxtext_{image}_{run_name}",
155-
base_run_model_cmds=test_scripts_details["train_command"],
156-
sweep_params=sweep_params,
157-
enable_profile_config=True, # add flag to enable profile extraction
158-
)
142+
maxtext_sweep_gke_test = maxtext_sweep_gke_config.get_maxtext_sweep_gke_config(
143+
test_owner=test_owner.SHUNING_J,
144+
dataset_project=Project.CLOUD_ML_AUTO_SOLUTIONS.value,
145+
composer_project=Project.CLOUD_ML_AUTO_SOLUTIONS.value,
146+
dataset_name=metric_config.DatasetOption.XLML_DATASET,
147+
cluster=test_scripts_details["cluster"],
148+
time_out_in_min=test_scripts_details["time_out_in_min"],
149+
base_output_directory=BASE_OUTPUT_PATH,
150+
num_slices=num_slices,
151+
docker_image=img_val,
152+
run_name_prefix=f"maxtext_{image}_{run_name}",
153+
base_run_model_cmds=test_scripts_details["train_command"],
154+
sweep_params=sweep_params,
155+
enable_profile_config=True, # add flag to enable profile extraction
159156
)
160157

161158
for test in maxtext_sweep_gke_test:

dags/examples/maxtext_sweep_gke_example_dag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@
5757

5858
# Run jobs
5959
for test in maxtext_sweep_gke_test:
60-
test.run_with_run_name_generation()
60+
test.to_name_gen_and_quarantine_task().run()

dags/multipod/maxtext_convergence.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,20 @@
8787
# The grain dataset takes longer to run, so we give it a longer timeout. The other tests are expected to complete within 5 hours.
8888
timeout_in_min = 360 if test_name == "maxtext-convergence-grain" else 300
8989

90-
test_task = gke_config.get_gke_config(
91-
cluster=XpkClusters.TPU_V6E_256_MLPERF_CLUSTER,
92-
time_out_in_min=timeout_in_min,
93-
test_name=test_name,
94-
run_model_cmds=run_command,
95-
docker_image=DockerImage.MAXTEXT_TPU_JAX_STABLE.value,
96-
test_owner=test_owner.MATT_D,
97-
base_output_directory=base_output_directory,
98-
metric_aggregation_strategy=metric_config.AggregationStrategy.LAST,
99-
).run_with_run_name_generation()
90+
test_task = (
91+
gke_config.get_gke_config(
92+
cluster=XpkClusters.TPU_V6E_256_MLPERF_CLUSTER,
93+
time_out_in_min=timeout_in_min,
94+
test_name=test_name,
95+
run_model_cmds=run_command,
96+
docker_image=DockerImage.MAXTEXT_TPU_JAX_STABLE.value,
97+
test_owner=test_owner.MATT_D,
98+
base_output_directory=base_output_directory,
99+
metric_aggregation_strategy=metric_config.AggregationStrategy.LAST,
100+
)
101+
.to_name_gen_and_quarantine_task()
102+
.run()
103+
)
100104
if test_name not in parallel_test_names:
101105
sequential_tests.append(test_task)
102106

xlml/apis/task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ def run(
769769
) -> DAGNode:
770770
"""Run a test job with run name generation and quarantine."""
771771
test_name = self.task_test_config.benchmark_id
772-
if QuarantineTests.is_quarantined(test_name):
772+
if QuarantineTests.is_quarantined(test_name) and self.quarantine_task_group:
773773
with self.quarantine_task_group:
774774
return self.run_with_run_name_generation(
775775
use_pathways=use_pathways,

0 commit comments

Comments
 (0)