-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy patha3ultra_maxtext_benchmarking_dags.py
132 lines (120 loc) · 4.28 KB
/
a3ultra_maxtext_benchmarking_dags.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""DAGs to run Aotc reproducibility benchmarks."""
import datetime
import os
from airflow import models
from dags.map_reproducibility.utils.constants import Schedule, Image
from dags.map_reproducibility.utils.internal_aotc_workload import run_internal_aotc_workload
# Configuration parameters
TEST_RUN = False
TURN_ON_SCHEDULE = True
BACKFILL = False
# Get current date for image tags
utc_date = datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d")
NIGHTLY_IMAGE = f"{Image.MAXTEXT_JAX_STABLE_NIGHTLY}:{utc_date}"
RELEASE_IMAGE = f"{Image.MAXTEXT_JAX_STABLE_RELEASE}:{utc_date}"
# Common DAG tags
DAG_TAGS = [
"reproducibility",
"experimental",
"xlml",
"v1.16",
"internal",
"regressiontests",
"a3ultra",
]
# Model configurations with schedule and timeout settings
MODEL_CONFIGS = {
# a3ultra_llama3.1-8b
"recipes/a3ultra/a3ultra_llama3.1-8b_8gpus_bf16_maxtext.yaml": {
"schedule": Schedule.DAILY_PDT_6PM_EXCEPT_THURSDAY,
"timeout_minutes": 15,
},
"recipes/a3ultra/a3ultra_llama3.1-8b_8gpus_fp8_maxtext.yaml": {
"schedule": Schedule.DAILY_PDT_6PM_EXCEPT_THURSDAY,
"timeout_minutes": 15,
},
"recipes/a3ultra/a3ultra_llama3.1-8b_16gpus_bf16_maxtext.yaml": {
"schedule": Schedule.DAILY_PDT_6PM_EXCEPT_THURSDAY,
"timeout_minutes": 15,
},
"recipes/a3ultra/a3ultra_llama3.1-8b_16gpus_fp8_maxtext.yaml": {
"schedule": Schedule.DAILY_PDT_6PM_EXCEPT_THURSDAY,
"timeout_minutes": 15,
},
# a3ultra_mixtral-8x7
"recipes/a3ultra/a3ultra_mixtral-8x7b_8gpus_bf16_maxtext.yaml": {
"schedule": Schedule.DAILY_PDT_6PM_EXCEPT_THURSDAY,
"timeout_minutes": 15,
},
"recipes/a3ultra/a3ultra_mixtral-8x7b_16gpus_bf16_maxtext.yaml": {
"schedule": Schedule.DAILY_PDT_6PM_EXCEPT_THURSDAY,
"timeout_minutes": 15,
},
# a3ultra_llama3.1-70b
"recipes/a3ultra/a3ultra_llama3.1-70b_256gpus_bf16_maxtext.yaml": {
"schedule": Schedule.DAILY_PDT_6_30PM_EXCEPT_THURSDAY,
"timeout_minutes": 15,
},
"recipes/a3ultra/a3ultra_llama3.1-70b_256gpus_fp8_maxtext.yaml": {
"schedule": Schedule.DAILY_PDT_7PM_EXCEPT_THURSDAY,
"timeout_minutes": 15,
},
# a3ultra_llama3.1-405b
"recipes/a3ultra/a3ultra_llama3.1-405b_256gpus_fp8_maxtext.yaml": {
"schedule": Schedule.DAILY_PDT_7_30PM_EXCEPT_THURSDAY,
"timeout_minutes": 30,
},
"recipes/a3ultra/a3ultra_llama3.1-405b_256gpus_bf16_maxtext.yaml": {
"schedule": Schedule.DAILY_PDT_8PM_EXCEPT_THURSDAY,
"timeout_minutes": 40,
},
}
# Create DAGs for each configuration
for config_path, config_info in MODEL_CONFIGS.items():
# Extract config name for the DAG ID
config_name = os.path.basename(config_path).replace(".yaml", "")
schedule = config_info["schedule"] if TURN_ON_SCHEDULE else None
timeout = config_info["timeout_minutes"]
# Create DAG for nightly build
with models.DAG(
dag_id=f"new_internal_{config_name}",
schedule=schedule,
tags=DAG_TAGS,
start_date=datetime.datetime(2025, 4, 3),
catchup=False,
) as dag:
run_internal_aotc_workload(
relative_config_yaml_path=config_path,
test_run=TEST_RUN,
backfill=BACKFILL,
timeout=timeout,
image_version=NIGHTLY_IMAGE,
)
# Create DAG for stable release
with models.DAG(
dag_id=f"new_internal_stable_release_{config_name}",
schedule=schedule,
tags=DAG_TAGS,
start_date=datetime.datetime(2025, 4, 3),
catchup=False,
) as dag:
run_internal_aotc_workload(
relative_config_yaml_path=config_path,
test_run=TEST_RUN,
backfill=BACKFILL,
timeout=timeout,
image_version=RELEASE_IMAGE,
)