Skip to content

Commit 080dab1

Browse files
author
Kokoro Build
committed
Migrate the test script to use to_maxtext.py for supported models
Migrated test script for Deepseek2-16b, gpt-oss-20b, and Mixtral8x7b
1 parent dfd8d29 commit 080dab1

5 files changed

Lines changed: 41 additions & 4 deletions

File tree

tests/assets/golden_logits/golden_data_gpt-oss-20b.jsonl

Lines changed: 3 additions & 0 deletions
Large diffs are not rendered by default.

tests/end_to_end/tpu/deepseek/v2-16b/test_deepseek.sh

100644100755
Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,28 @@ if [ -z "${CKPT_DISK_LOCATION}" ]; then
4141
fi
4242

4343
# 1.1 Convert checkpoint to `scanned` format, more suitable for training
44-
JAX_PLATFORMS=cpu python3 -m maxtext.checkpoint_conversion.standalone_scripts.convert_deepseek_family_ckpt --base_model_path ${CKPT_DISK_LOCATION} --maxtext_model_path ${BASE_OUTPUT_PATH}/scanned --model_size ${MODEL_NAME}
44+
python3 -m maxtext.checkpoint_conversion.to_maxtext \
45+
model_name=${MODEL_NAME} \
46+
base_output_directory=${BASE_OUTPUT_PATH}/scanned \
47+
scan_layers=true \
48+
attention=dot_product \
49+
enable_nnx=false \
50+
hardware=cpu skip_jax_distributed_system=True \
51+
--hf_model_path=${CKPT_DISK_LOCATION} \
52+
--lazy_load_tensors=False \
53+
--eager_load_method='safetensors'
4554

4655
# 1.2 Convert checkpoint to `unscanned` format, more suitable for decoding
47-
JAX_PLATFORMS=cpu python3 -m maxtext.checkpoint_conversion.standalone_scripts.convert_deepseek_family_unscanned_ckpt --base_model_path ${CKPT_DISK_LOCATION} --maxtext_model_path ${BASE_OUTPUT_PATH}/unscanned --model_size ${MODEL_NAME}
56+
python3 -m maxtext.checkpoint_conversion.to_maxtext \
57+
model_name=${MODEL_NAME} \
58+
base_output_directory=${BASE_OUTPUT_PATH}/unscanned \
59+
scan_layers=false \
60+
attention=dot_product \
61+
enable_nnx=false \
62+
hardware=cpu skip_jax_distributed_system=True \
63+
--hf_model_path=${CKPT_DISK_LOCATION} \
64+
--lazy_load_tensors=False \
65+
--eager_load_method='safetensors'
4866

4967
# Step 2:
5068
# We define the checkpoint paths. This way it is easier to use these paths in the `train.py` and `decode.py` commands

tests/end_to_end/tpu/gpt_oss/20b/test_gpt_oss.sh

100644100755
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,26 @@ if [ -z "${CKPT_DISK_LOCATION}" ]; then
3939
fi
4040

4141
# 1.1 Convert checkpoint to `scanned` format, more suitable for training
42-
JAX_PLATFORMS=cpu python3 -m maxtext.checkpoint_conversion.standalone_scripts.convert_gpt_oss_ckpt --base-model-path ${CKPT_DISK_LOCATION} --maxtext-model-path ${BASE_OUTPUT_PATH}/scanned --model-size ${MODEL_NAME}
42+
python3 -m maxtext.checkpoint_conversion.to_maxtext \
43+
model_name=${MODEL_NAME} \
44+
base_output_directory=${BASE_OUTPUT_PATH}/scanned \
45+
scan_layers=true \
46+
attention=dot_product \
47+
hardware=cpu skip_jax_distributed_system=True \
48+
--hf_model_path=${CKPT_DISK_LOCATION} \
49+
--lazy_load_tensors=False \
50+
--eager_load_method='safetensors'
4351

4452
# 1.2 Convert checkpoint to `unscanned` format, more suitable for decoding
45-
JAX_PLATFORMS=cpu python3 -m maxtext.checkpoint_conversion.standalone_scripts.convert_gpt_oss_unscanned_ckpt --base-model-path ${CKPT_DISK_LOCATION} --maxtext-model-path ${BASE_OUTPUT_PATH}/unscanned --model-size ${MODEL_NAME}
53+
python3 -m maxtext.checkpoint_conversion.to_maxtext \
54+
model_name=${MODEL_NAME} \
55+
base_output_directory=${BASE_OUTPUT_PATH}/unscanned \
56+
scan_layers=false \
57+
attention=dot_product \
58+
hardware=cpu skip_jax_distributed_system=True \
59+
--hf_model_path=${CKPT_DISK_LOCATION} \
60+
--lazy_load_tensors=False \
61+
--eager_load_method='safetensors'
4662

4763
# Step 2:
4864
# We define the checkpoint paths. This way it is easier to use these paths in the `train.py` and `decode.py` commands

tests/end_to_end/tpu/mixtral/8x7b/1_test_mixtral.sh

100644100755
File mode changed.

tests/end_to_end/tpu/mixtral/8x7b/2_test_mixtral.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)