Skip to content

Commit a7e7e81

Browse files
authored
Update ckpt conversion scripts (#25)
1 parent 5820c95 commit a7e7e81

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

jetstream/tools/maxtext/model_ckpt_conversion.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export MODEL_NAME=${MODEL}-${MODEL_VARIATION}
3131
# After downloading checkpoints, copy them to GCS bucket at $CHKPT_BUCKET \
3232
# Please use seperate GCS paths for uploading open source model weights ($CHKPT_BUCKET) and MaxText compatible weights ($MODEL_BUCKET).
3333
# Point these variables to a GCS bucket that you created.
34-
export CHKPT_BUCKET=gs://${USER}-maxtext/chkpt/${MODEL}/${MODEL_VARIATION}
34+
# An example of CHKPT_BUCKET could be: gs://${USER}-maxtext/chkpt/${MODEL}/${MODEL_VARIATION}
35+
export CHKPT_BUCKET=$3
3536
export MODEL_BUCKET=gs://${USER}-maxtext
3637

3738
# Point `BASE_OUTPUT_DIRECTORY` to a GCS bucket that you created, this bucket will store all the files generated by MaxText during a run.
@@ -47,11 +48,6 @@ gcloud storage buckets create ${MODEL_BUCKET} --location=${BUCKET_LOCATION} || t
4748
gcloud storage buckets create ${BASE_OUTPUT_DIRECTORY} --location=${BUCKET_LOCATION} || true
4849
gcloud storage buckets create ${DATASET_PATH} --location=${BUCKET_LOCATION} || true
4950

50-
# Copy the downloaded checkpoints to `CHKPT_BUCKET`.
51-
# Gemma example: gsutil -m cp -r 7b ${CHKPT_BUCKET}
52-
# Llama2 example: gsutil -m cp -r llama-2-7b ${CHKPT_BUCKET}
53-
sudo gsutil -m cp -r $3 ${CHKPT_BUCKET}
54-
5551
# Covert model checkpoints to MaxText compatible checkpoints.
5652
if [ "$MODEL" == "gemma" ]; then
5753
CONVERT_CKPT_SCRIPT="convert_gemma_chkpt.py"

jetstream/tools/maxtext/model_ckpt_finetune_with_aqt.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export MODEL_NAME=${MODEL}-${MODEL_VARIATION}
3131
# After downloading checkpoints, copy them to GCS bucket at $CHKPT_BUCKET \
3232
# Please use seperate GCS paths for uploading open source model weights ($CHKPT_BUCKET) and MaxText compatible weights ($MODEL_BUCKET).
3333
# Point these variables to a GCS bucket that you created.
34-
export CHKPT_BUCKET=gs://${USER}-maxtext/chkpt/${MODEL}/${MODEL_VARIATION}
34+
# An example of CHKPT_BUCKET could be: gs://${USER}-maxtext/chkpt/${MODEL}/${MODEL_VARIATION}
35+
export CHKPT_BUCKET=$3
3536
export MODEL_BUCKET=gs://${USER}-maxtext
3637

3738
# Point `BASE_OUTPUT_DIRECTORY` to a GCS bucket that you created, this bucket will store all the files generated by MaxText during a run.
@@ -41,7 +42,7 @@ export BASE_OUTPUT_DIRECTORY=gs://${USER}-runner-maxtext-logs
4142
export DATASET_PATH=gs://${USER}-maxtext-dataset
4243

4344
# Prepare C4 dataset for fine tuning: https://github.com/allenai/allennlp/discussions/5056
44-
sudo gsutil -u $3 -m cp 'gs://allennlp-tensorflow-datasets/c4/en/3.0.1/*' ${DATASET_PATH}/c4/en/3.0.1/
45+
sudo gsutil -u $4 -m cp 'gs://allennlp-tensorflow-datasets/c4/en/3.0.1/*' ${DATASET_PATH}/c4/en/3.0.1/
4546

4647
# We define `CONVERTED_CHECKPOINT` to refer to the checkpoint subdirectory.
4748
export CONVERTED_CHECKPOINT=${MODEL_BUCKET}/${MODEL}/${MODEL_VARIATION}/${idx}/0/items

0 commit comments

Comments
 (0)