Skip to content

Commit f1fcf8c

Browse files
Merge pull request #2501 from AI-Hypercomputer:anisha-clean-path
PiperOrigin-RevId: 820032273
2 parents 44d6528 + d32731a commit f1fcf8c

4 files changed

Lines changed: 20 additions & 17 deletions

File tree

src/MaxText/examples/grpo_llama3_1_70b_demo_pw.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,21 @@
141141
TRAIN_FRACTION = 1.0
142142

143143

144+
# ====== Input Checkpoint directory =====
145+
MODEL_CHECKPOINT_PATH = "/path/to/scanned/model/ckpt_load_dir/"
146+
144147
# ====== Checkpoint directory =====
145148
LOG_DIR = f"{HOME}/content/tensorboard/grpo/logs_llama3/"
146149
if not os.path.exists(LOG_DIR):
147150
os.makedirs(LOG_DIR)
148151

149152
# ===== Profiling =====
150-
PROFILE_DIR = f"gs://mazumdera-test-bucket-europe-west4/rl-tuning/grpo/anisha-{run_id}/profiles_llama3/"
153+
PROFILE_DIR = f"/path/to/profile_dir/{run_id}/profiles_llama3/"
151154
if not epath.Path(PROFILE_DIR).exists():
152155
epath.Path(PROFILE_DIR).mkdir(parents=True)
153156

154157
# ====== Checkpoint saving ======
155-
CKPT_DIR = f"gs://mazumdera-test-bucket-europe-west4/rl-tuning/grpo/anisha-{run_id}/ckpts_llama3/"
158+
CKPT_DIR = f"/path/to/ckpt_save_dir/{run_id}/ckpts_llama3/"
156159

157160
if not epath.Path(CKPT_DIR).exists():
158161
epath.Path(CKPT_DIR).mkdir(parents=True)
@@ -396,8 +399,7 @@ def get_ref_maxtext_model(config, devices=None):
396399
run_name="test-tunix-maxtext-llama3.1-70b",
397400
tokenizer_type="tiktoken",
398401
tokenizer_path=os.path.join(MAXTEXT_ASSETS_ROOT, "tokenizer_llama3.tiktoken"),
399-
load_parameters_path="gs://mazumdera-test-bucket-europe-west4/llama3.1-70b-Instruct/scanned-pathways/0/items",
400-
# load_parameters_path="path/to/scanned/checkpoint",
402+
load_parameters_path=MODEL_CHECKPOINT_PATH,
401403
per_device_batch_size=1,
402404
max_prefill_predict_length=4,
403405
max_target_length=1024,
@@ -470,8 +472,7 @@ def get_ref_maxtext_model(config, devices=None):
470472
run_name="test-tunix-maxtext-llama3.1-70b", # This is not used in Tunix.
471473
tokenizer_type="tiktoken",
472474
tokenizer_path=os.path.join(MAXTEXT_ASSETS_ROOT, "tokenizer_llama3.tiktoken"),
473-
load_parameters_path="gs://mazumdera-test-bucket-europe-west4/llama3.1-70b-Instruct/scanned-pathways/0/items",
474-
# load_parameters_path="path/to/scanned/checkpoint",
475+
load_parameters_path=MODEL_CHECKPOINT_PATH,
475476
per_device_batch_size=1,
476477
max_prefill_predict_length=4,
477478
max_target_length=1024,

src/MaxText/examples/grpo_llama3_1_8b_demo.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"\n",
105105
"DEBUG = False # set to True to run in debug mode, for more print statements\n",
106106
"# set this to the path of the checkpoint you want to load, gs://<bucket> supported\n",
107-
"MODEL_CHECKPOINT_PATH = \"path/to/scanned/checkpoint\""
107+
"MODEL_CHECKPOINT_PATH = \"/path/to/scanned/model/ckpt_load_dir/\""
108108
]
109109
},
110110
{

src/MaxText/examples/grpo_llama3_1_8b_demo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@
109109
TRAIN_FRACTION = 1.0
110110

111111

112+
# ====== Input Checkpoint directory =====
113+
MODEL_CHECKPOINT_PATH = "/path/to/scanned/model/ckpt_load_dir/"
114+
112115
# ====== Checkpoint directory =====
113116
LOG_DIR = os.path.join(HOME, "content", "tensorboard", "grpo", "logs_llama3", "")
114117
if not os.path.exists(LOG_DIR):
@@ -404,8 +407,7 @@ def get_ref_maxtext_model(config):
404407
run_name="test-tunix-maxtext-llama3.1-8b",
405408
tokenizer_type="tiktoken",
406409
tokenizer_path=os.path.join(MAXTEXT_ASSETS_ROOT, "tokenizer_llama3.tiktoken"),
407-
load_parameters_path="gs://yixuannwang-maxtext-logs/llama3.1-8b-Instruct/scanned/0/items",
408-
# load_parameters_path="path/to/scanned/checkpoint",
410+
load_parameters_path=MODEL_CHECKPOINT_PATH,
409411
per_device_batch_size=1,
410412
max_prefill_predict_length=4,
411413
max_target_length=1024,
@@ -464,8 +466,7 @@ def get_ref_maxtext_model(config):
464466
run_name="test-tunix-maxtext-llama3.1-8b", # This is not used in Tunix.
465467
tokenizer_type="tiktoken",
466468
tokenizer_path=os.path.join(MAXTEXT_ASSETS_ROOT, "tokenizer_llama3.tiktoken"),
467-
load_parameters_path="gs://yixuannwang-maxtext-logs/llama3.1-8b-Instruct/scanned/0/items",
468-
# load_parameters_path="path/to/scanned/checkpoint",
469+
load_parameters_path=MODEL_CHECKPOINT_PATH,
469470
per_device_batch_size=1,
470471
max_prefill_predict_length=4,
471472
max_target_length=1024,

src/MaxText/examples/grpo_llama3_1_8b_demo_pw.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,21 @@
141141
TRAIN_FRACTION = 1.0
142142

143143

144+
# ====== Input Checkpoint directory =====
145+
MODEL_CHECKPOINT_PATH = "/path/to/scanned/model/ckpt_load_dir/"
146+
144147
# ====== Checkpoint directory =====
145148
LOG_DIR = f"{HOME}/content/tensorboard/grpo/logs_llama3/"
146149
if not os.path.exists(LOG_DIR):
147150
os.makedirs(LOG_DIR)
148151

149152
# ===== Profiling =====
150-
PROFILE_DIR = f"gs://mazumdera-test-bucket-europe-west4/rl-tuning/grpo/{run_id}/profiles_llama3/"
153+
PROFILE_DIR = f"/path/to/profile_dir/{run_id}/profiles_llama3/"
151154
if not epath.Path(PROFILE_DIR).exists():
152155
epath.Path(PROFILE_DIR).mkdir(parents=True)
153156

154157
# ====== Checkpoint saving ======
155-
CKPT_DIR = f"gs://mazumdera-test-bucket-europe-west4/rl-tuning/grpo/{run_id}/ckpts_llama3/"
158+
CKPT_DIR = f"/path/to/ckpt_save_dir/{run_id}/ckpts_llama3/"
156159

157160
if not epath.Path(CKPT_DIR).exists():
158161
epath.Path(CKPT_DIR).mkdir(parents=True)
@@ -394,8 +397,7 @@ def get_ref_maxtext_model(config, devices=None):
394397
run_name="test-tunix-maxtext-llama3.1-8b",
395398
tokenizer_type="tiktoken",
396399
tokenizer_path=os.path.join(MAXTEXT_ASSETS_ROOT, "tokenizer_llama3.tiktoken"),
397-
load_parameters_path="gs://mazumdera-test-bucket-europe-west4/llama3.1-8b-Instruct/scanned-pathways/0/items",
398-
# load_parameters_path="path/to/scanned/checkpoint",
400+
load_parameters_path=MODEL_CHECKPOINT_PATH,
399401
per_device_batch_size=1,
400402
max_prefill_predict_length=4,
401403
max_target_length=1024,
@@ -469,8 +471,7 @@ def get_ref_maxtext_model(config, devices=None):
469471
run_name="test-tunix-maxtext-llama3.1-8b", # This is not used in Tunix.
470472
tokenizer_type="tiktoken",
471473
tokenizer_path=os.path.join(MAXTEXT_ASSETS_ROOT, "tokenizer_llama3.tiktoken"),
472-
load_parameters_path="gs://mazumdera-test-bucket-europe-west4/llama3.1-8b-Instruct/scanned-pathways/0/items",
473-
# load_parameters_path="path/to/scanned/checkpoint",
474+
load_parameters_path=MODEL_CHECKPOINT_PATH,
474475
per_device_batch_size=1,
475476
max_prefill_predict_length=4,
476477
max_target_length=1024,

0 commit comments

Comments
 (0)