Skip to content

Commit 34eb574

Browse files
authored
Update maxtext_moe_tpu_e2e DAG: hf access token & refactor (GoogleCloudPlatform#1322)
1 parent a954def commit 34eb574

1 file changed

Lines changed: 31 additions & 14 deletions

File tree

dags/sparsity_diffusion_devx/maxtext_moe_tpu_e2e.py

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333

3434
# Run once a day at 1 am UTC (5 pm PST)
3535
SCHEDULED_TIME = "30 1 * * *" if composer_env.is_prod_env() else None
36-
HF_TOKEN = safe_get_from_variable("HF_TOKEN", None)
36+
# Track access in b/536711415
37+
HF_TOKEN = safe_get_from_variable("HF_TOKEN_MOE", None)
3738

3839

3940
with models.DAG(
@@ -68,26 +69,31 @@
6869
"script_name": "tpu/deepseek/v3.2-671b/2_test_deepseek",
6970
"cluster": XpkClusters.TPU_V5P_128_CLUSTER,
7071
"time_out_in_min": 180,
72+
"owner": test_owner.SHUNING_J,
7173
},
7274
"deepseek3-671b": {
7375
"script_name": "tpu/deepseek/v3-671b/2_test_deepseek",
7476
"cluster": XpkClusters.TPU_V5P_128_CLUSTER,
7577
"time_out_in_min": 180,
78+
"owner": test_owner.SHUNING_J,
7679
},
7780
"deepseek3-671b-mtp": {
7881
"script_name": "tpu/deepseek/v3-671b/2_test_deepseek_mtp",
7982
"cluster": XpkClusters.TPU_V5P_128_CLUSTER,
8083
"time_out_in_min": 180,
84+
"owner": test_owner.SHUNING_J,
8185
},
8286
"deepseek2-16b": {
8387
"script_name": "tpu/deepseek/v2-16b/test_deepseek",
8488
"cluster": XpkClusters.TPU_V5P_8_CLUSTER_V2,
8589
"time_out_in_min": 180,
90+
"owner": test_owner.SHUNING_J,
8691
},
8792
"gpt-oss-20b": {
8893
"script_name": "tpu/gpt_oss/20b/test_gpt_oss",
8994
"cluster": XpkClusters.TPU_V5P_8_CLUSTER_V2,
9095
"time_out_in_min": 180,
96+
"owner": test_owner.SHUNING_J,
9197
},
9298
}
9399

@@ -97,13 +103,15 @@
97103
training_tpu = gke_config.get_gke_config(
98104
time_out_in_min=test_scripts_details["time_out_in_min"],
99105
test_name=f"{test_name_prefix}_{image}_{model}",
100-
run_model_cmds=(
101-
f"export HF_TOKEN={HF_TOKEN}; "
102-
"export BASE_OUTPUT_PATH=$GCS_OUTPUT; "
103-
f"bash tests/end_to_end/{test_scripts_details['script_name']}.sh",
106+
run_model_cmds=tuple(
107+
[
108+
f"export HF_TOKEN={HF_TOKEN}; "
109+
"export BASE_OUTPUT_PATH=$GCS_OUTPUT; "
110+
f"bash tests/end_to_end/{test_scripts_details['script_name']}.sh"
111+
]
104112
),
105113
docker_image=image_config,
106-
test_owner=test_owner.SHUNING_J,
114+
test_owner=test_scripts_details["owner"],
107115
cluster=test_scripts_details["cluster"],
108116
).run_with_quarantine(quarantine_task_group)
109117
unchained_tests.append(training_tpu)
@@ -113,12 +121,14 @@
113121
chain(unchained_tests[i], unchained_tests[i + 1])
114122

115123
# Chained tests
124+
# assume same model chain has a single owner
116125
multicluster_test_models = {
117126
"mixtral-8x7b": [
118127
{
119128
"script_name": "tpu/mixtral/8x7b/1_test_mixtral",
120129
"cluster": XpkClusters.CPU_M1_MEGAMEM_96_CLUSTER,
121130
"time_out_in_min": 240,
131+
"owner": test_owner.SHUNING_J,
122132
},
123133
{
124134
"script_name": "tpu/mixtral/8x7b/2_test_mixtral",
@@ -131,6 +141,7 @@
131141
"script_name": "tpu/llama4/1_test_llama4",
132142
"cluster": XpkClusters.CPU_M1_MEGAMEM_96_CLUSTER,
133143
"time_out_in_min": 240,
144+
"owner": test_owner.SHUNING_J,
134145
},
135146
{
136147
"script_name": "tpu/llama4/2_test_llama4",
@@ -159,23 +170,29 @@ def convert_checkpoint_and_run_training(
159170
conversion_cpu = gke_config.get_maxtext_cpu_end_to_end_gke_config(
160171
time_out_in_min=test_scripts_details_list[0]["time_out_in_min"],
161172
test_name=test_name,
162-
run_model_cmds=(
163-
f"export BASE_OUTPUT_PATH=$GCS_OUTPUT; bash tests/end_to_end/"
164-
f"{test_scripts_details_list[0]['script_name']}.sh",
173+
run_model_cmds=tuple(
174+
[
175+
f"export HF_TOKEN={HF_TOKEN}; "
176+
"export BASE_OUTPUT_PATH=$GCS_OUTPUT; "
177+
f"bash tests/end_to_end/{test_scripts_details_list[0]['script_name']}.sh"
178+
]
165179
),
166180
docker_image=docker_image_config,
167-
test_owner=test_owner.SHUNING_J,
181+
test_owner=test_scripts_details_list[0]["owner"],
168182
cluster=test_scripts_details_list[0]["cluster"],
169183
).run(gcs_location=shared_gcs_location)
170184
training_tpu_task = gke_config.get_gke_config(
171185
time_out_in_min=test_scripts_details_list[1]["time_out_in_min"],
172186
test_name=test_name,
173-
run_model_cmds=(
174-
f"export BASE_OUTPUT_PATH=$GCS_OUTPUT; bash tests/end_to_end/"
175-
f"{test_scripts_details_list[1]['script_name']}.sh",
187+
run_model_cmds=tuple(
188+
[
189+
f"export HF_TOKEN={HF_TOKEN}; "
190+
"export BASE_OUTPUT_PATH=$GCS_OUTPUT; "
191+
f"bash tests/end_to_end/{test_scripts_details_list[1]['script_name']}.sh"
192+
]
176193
),
177194
docker_image=docker_image_config,
178-
test_owner=test_owner.SHUNING_J,
195+
test_owner=test_scripts_details_list[0]["owner"],
179196
cluster=test_scripts_details_list[1]["cluster"],
180197
).run(gcs_location=shared_gcs_location)
181198
return conversion_cpu, training_tpu_task

0 commit comments

Comments
 (0)