Skip to content

Commit 22217c8

Browse files
committed
Update Gemma3-4b E2E post-training scripts for pathways
1 parent c3d6fdc commit 22217c8

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

tests/end_to_end/tpu/gemma3/4b/test_gemma3_rl.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
set -ex
1818

1919
run_id=${1:-$(date +%Y-%m-%d-%H-%M-%S)}
20+
use_pathways=${2:-false}
2021
MODEL_NAME='gemma3-4b'
2122

2223
# Non-Googlers please remember to point `BASE_OUTPUT_DIRECTORY` to the GCS paths where you have the scanned and unscanned checkpoints stored
@@ -31,15 +32,15 @@ python3 -m maxtext.inference.vllm_decode \
3132
vllm_hf_overrides='{architectures: ["MaxTextForCausalLM"]}' \
3233
hbm_utilization_vllm=0.5 \
3334
prompt='Suggest some famous landmarks in London.' \
34-
use_chat_template=True scan_layers=false
35+
use_chat_template=True scan_layers=false enable_single_controller=${use_pathways}
3536

3637
# Step 2: Run RL on the converted checkpoint
3738
python3 -m maxtext.trainers.post_train.rl.train_rl \
3839
base_output_directory=${BASE_OUTPUT_DIRECTORY}/rl \
3940
load_parameters_path=${SCANNED_CKPT_PATH} \
4041
run_name=${run_id} rl.loss_algo='grpo' scan_layers=true \
4142
num_batches=5 batch_size=1 num_test_batches=5 \
42-
model_name=${MODEL_NAME} enable_single_controller=True \
43+
model_name=${MODEL_NAME} enable_single_controller=${use_pathways} \
4344
checkpoint_storage_use_zarr3=False checkpoint_storage_use_ocdbt=False \
4445
rollout_tensor_parallelism=1 \
4546
vllm_hf_overrides='{architectures: ["MaxTextForCausalLM"]}' \
@@ -53,5 +54,4 @@ python3 -m maxtext.inference.vllm_decode \
5354
vllm_hf_overrides='{architectures: ["MaxTextForCausalLM"]}' \
5455
hbm_utilization_vllm=0.5 \
5556
prompt='Suggest some famous landmarks in London.' \
56-
use_chat_template=True scan_layers=true
57-
57+
use_chat_template=True scan_layers=true enable_single_controller=${use_pathways}

tests/end_to_end/tpu/gemma3/4b/test_gemma3_sft.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
set -ex
1818

1919
run_id=${1:-$(date +%Y-%m-%d-%H-%M-%S)}
20+
use_pathways=${2:-false}
2021
MODEL_NAME='gemma3-4b'
2122

2223
# Non-Googlers please remember to point `BASE_OUTPUT_DIRECTORY` to the GCS paths where you have the scanned and unscanned checkpoints stored
@@ -31,15 +32,15 @@ python3 -m maxtext.inference.vllm_decode \
3132
vllm_hf_overrides='{architectures: ["MaxTextForCausalLM"]}' \
3233
hbm_utilization_vllm=0.5 \
3334
prompt="Suggest some famous landmarks in London." \
34-
use_chat_template=True scan_layers=false
35+
use_chat_template=True scan_layers=false enable_single_controller=${use_pathways}
3536

3637
# Step 2: Run SFT on the converted checkpoint
3738
python3 -m maxtext.trainers.post_train.sft.train_sft \
3839
base_output_directory=${BASE_OUTPUT_DIRECTORY}/sft \
3940
load_parameters_path=${SCANNED_CKPT_PATH} \
4041
per_device_batch_size=1 run_name=${run_id} \
4142
steps=5 scan_layers=true \
42-
model_name=${MODEL_NAME} enable_single_controller=True \
43+
model_name=${MODEL_NAME} enable_single_controller=${use_pathways} \
4344
checkpoint_storage_use_zarr3=False checkpoint_storage_use_ocdbt=False
4445

4546
# Step 3: Run inference on the checkpoint generated from the previous run
@@ -49,6 +50,6 @@ python3 -m maxtext.inference.vllm_decode \
4950
vllm_hf_overrides='{architectures: ["MaxTextForCausalLM"]}' \
5051
hbm_utilization_vllm=0.5 \
5152
prompt="Suggest some famous landmarks in London." \
52-
use_chat_template=True scan_layers=true
53+
use_chat_template=True scan_layers=true enable_single_controller=${use_pathways}
5354

5455

0 commit comments

Comments
 (0)