Skip to content

Commit 4b29338

Browse files
committed
Fix llama4 test with hf access token
1 parent dfd8d29 commit 4b29338

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

tests/end_to_end/tpu/llama4/2_test_llama4.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# The flow of this file is to take the MaxText (unscanned Orbax) checkpoint and run inference on a TPU VM.
88

9-
# Example Usage: export BASE_OUTPUT_PATH=/path/to/GCS/bucket; export MODEL_VARIATION=llama4-17b-[16e/128e]; bash tests/end_to_end/tpu/llama4/2_test_llama4.sh
9+
# Example Usage: export HF_TOKEN=<huggingface_access_token>; export BASE_OUTPUT_PATH=/path/to/GCS/bucket; export MODEL_VARIATION=llama4-17b-[16e/128e]; bash tests/end_to_end/tpu/llama4/2_test_llama4.sh
1010
# Use the same BASE_OUTPUT_PATH and MODEL_VARIATION for both 1_test_llama4.sh & 1_test_llama4.sh.
1111

1212
# In order to generate the Llama4 golden logits, please see this script: tests/assets/logits_generation/golden_llama4_17b_16e_128e_export.ipynb
@@ -36,4 +36,4 @@ echo using BASE_OUTPUT_PATH = ${BASE_OUTPUT_PATH}
3636
export UNSCANNED_CKPT_PATH=${BASE_OUTPUT_PATH}/unscanned/0/items
3737

3838
# Step 2: run logit checking
39-
python3 -m tests.utils.forward_pass_logit_checker "${MAXTEXT_CONFIGS_DIR:-${MAXTEXT_REPO_ROOT:-$PWD}/src/maxtext/configs}"//base.yml tokenizer_path=${TOKENIZER_PATH} load_parameters_path=${UNSCANNED_CKPT_PATH} run_name=forward_pass_test_${MODEL_VARIATION} attention=dot_product per_device_batch_size=1 model_name=${MODEL_VARIATION} max_prefill_predict_length=4 max_target_length=4 scan_layers=false --atol=0.01 --rtol=0.01 async_checkpointing=false sparse_matmul=false weight_dtype=float32 dtype=float32 activations_in_float32=true matmul_precision=float32 float32_logits=true float32_qk_product=true ici_expert_parallelism=16
39+
python3 -m tests.utils.forward_pass_logit_checker "${MAXTEXT_CONFIGS_DIR:-${MAXTEXT_REPO_ROOT:-$PWD}/src/maxtext/configs}"//base.yml tokenizer_path=${TOKENIZER_PATH} load_parameters_path=${UNSCANNED_CKPT_PATH} run_name=forward_pass_test_${MODEL_VARIATION} attention=dot_product per_device_batch_size=1 model_name=${MODEL_VARIATION} max_prefill_predict_length=4 max_target_length=4 scan_layers=false --atol=0.01 --rtol=0.01 async_checkpointing=false sparse_matmul=false weight_dtype=float32 dtype=float32 activations_in_float32=true matmul_precision=float32 float32_logits=true float32_qk_product=true ici_expert_parallelism=16 hf_access_token=${HF_TOKEN}

tests/utils/forward_pass_logit_checker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
# Utilities and Colab notebooks used to generate the golden logits are available in tests/assets/logits_generation.
3434
# For example:
3535
# tests/assets/logits_generation/golden_llama2-7b_export.ipynb
36+
#
37+
# NOTE: Be careful of updates. This file affects scripts under `tests/end_to_end/tpu` for nightly tests.
3638

3739
"""Check if the logits generated by a model's src/maxtext/HF implementation matches golden logits for the same inputs.
3840

0 commit comments

Comments
 (0)