Skip to content

Commit dae905c

Browse files
Merge pull request #2949 from AI-Hypercomputer:integration_tests_restructure
PiperOrigin-RevId: 859214905
2 parents 3c8e0fa + 5d66b49 commit dae905c

119 files changed

Lines changed: 91 additions & 66 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_and_test_maxtext.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ jobs:
231231
image_type: ${{ matrix.image_type }}
232232
cloud_runner: linux-x86-a2-48-a100-4gpu
233233
pytest_marker: 'not cpu_only and not tpu_only and not integration_test'
234-
pytest_addopts: '--ignore=tests/sft_hooks_test.py'
235234
xla_python_client_mem_fraction: 0.65
236235
tf_force_gpu_allow_growth: true
237236
container_resource_option: "--shm-size 2g --runtime=nvidia --gpus all --privileged"
@@ -252,7 +251,6 @@ jobs:
252251
image_type: ${{ matrix.image_type }}
253252
cloud_runner: linux-x86-a2-48-a100-4gpu
254253
pytest_marker: 'not cpu_only and not tpu_only and integration_test'
255-
pytest_addopts: '--ignore=tests/sft_hooks_test.py'
256254
xla_python_client_mem_fraction: 0.65
257255
tf_force_gpu_allow_growth: true
258256
container_resource_option: "--shm-size 2g --runtime=nvidia --gpus all --privileged"

.github/workflows/run_tests_against_package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
-v \
121121
-m "${FINAL_PYTEST_MARKER}" \
122122
--durations=0 \
123-
--deselect "tests/tokenizer_test.py::TokenizerTest::test_detokenize" \
123+
--deselect "tests/unit/tokenizer_test.py::TokenizerTest::test_detokenize" \
124124
--cov=MaxText \
125125
--cov-report=xml \
126126
--cov-report=term \

RESTRUCTURE.md

Lines changed: 11 additions & 2 deletions

docs/run_maxtext/decoupled_mode.md

Lines changed: 1 addition & 1 deletion

end_to_end/tpu/llama3.1/70b/3_test_llama3.1_70b.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ python3 -m tests.utils.forward_pass_logit_checker "${MAXTEXT_PKG_DIR:-${MAXTEXT_
2424
# If not, we can convert the checkpoint back from MaxText to Huggingface and compare with the original one
2525
JAX_PLATFORMS=cpu python3 -m MaxText.utils.ckpt_scripts.llama_mistral_mixtral_orbax_to_hf "${MAXTEXT_PKG_DIR:-${MAXTEXT_REPO_ROOT:-$PWD}/src/MaxText}/"configs/base.yml base_output_directory=gs://runner-maxtext-logs load_parameters_path=${CHECKPOINT_TPU_SCANNED}/0/items run_name=convert_to_hf model_name=${MODEL_SIZE} hf_model_path=$CHECKPOINT_TPU_CONVERTED_BACK
2626

27-
python3 -m tests.hf_checkpoint_conversion_checker --original_ckpt=${CHECKPOINT_ORIGINAL} --converted_ckpt=${CHECKPOINT_TPU_CONVERTED_BACK}
27+
python3 -m tests.utils.hf_checkpoint_conversion_checker --original_ckpt=${CHECKPOINT_ORIGINAL} --converted_ckpt=${CHECKPOINT_TPU_CONVERTED_BACK}
2828

2929
# If everything looks good, we move on to convert to the unrolled checkpoint for performant serving
3030
JAX_PLATFORMS=cpu python3 -m MaxText.generate_param_only_checkpoint "${MAXTEXT_PKG_DIR:-${MAXTEXT_REPO_ROOT:-$PWD}/src/MaxText}/"configs/base.yml async_checkpointing=false base_output_directory=${BASE_OUTPUT_PATH} load_parameters_path=${CHECKPOINT_TPU_SCANNED}/0/items run_name=${RUN_NAME} model_name=${MODEL_SIZE} force_unroll=true

end_to_end/tpu/llama3.1/8b/3_test_llama3.1_8b.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ python3 -m tests.utils.forward_pass_logit_checker "${MAXTEXT_PKG_DIR:-${MAXTEXT_
3030
# If not, we can convert the checkpoint back from MaxText to Huggingface and compare with the original one
3131
JAX_PLATFORMS=cpu python3 -m MaxText.utils.ckpt_scripts.llama_mistral_mixtral_orbax_to_hf "${MAXTEXT_PKG_DIR:-${MAXTEXT_REPO_ROOT:-$PWD}/src/MaxText}/"configs/base.yml base_output_directory=gs://runner-maxtext-logs load_parameters_path=${CHECKPOINT_TPU_SCANNED}/0/items run_name=convert_to_hf model_name=${MODEL_SIZE} hf_model_path=$CHECKPOINT_TPU_CONVERTED_BACK
3232

33-
python3 -m tests.hf_checkpoint_conversion_checker --original_ckpt=${CHECKPOINT_ORIGINAL} --converted_ckpt=${CHECKPOINT_TPU_CONVERTED_BACK}
33+
python3 -m tests.utils.hf_checkpoint_conversion_checker --original_ckpt=${CHECKPOINT_ORIGINAL} --converted_ckpt=${CHECKPOINT_TPU_CONVERTED_BACK}
3434

3535
# If everything looks good, we move on to convert to the unrolled checkpoint for performant serving
3636
JAX_PLATFORMS=cpu python3 -m MaxText.generate_param_only_checkpoint "${MAXTEXT_PKG_DIR:-${MAXTEXT_REPO_ROOT:-$PWD}/src/MaxText}/"configs/base.yml async_checkpointing=false base_output_directory=${BASE_OUTPUT_PATH} load_parameters_path=${CHECKPOINT_TPU_SCANNED}/0/items run_name=${RUN_NAME} model_name=${MODEL_SIZE} force_unroll=true

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ python3 -m MaxText.decode "${MAXTEXT_PKG_DIR:-${MAXTEXT_REPO_ROOT:-$PWD}/src/Max
4343
# Test whether the forward pass logits match the golden logits - matmul implementation
4444
python3 -m tests.utils.forward_pass_logit_checker "${MAXTEXT_PKG_DIR:-${MAXTEXT_REPO_ROOT:-$PWD}/src/MaxText}/"configs/base.yml base_output_directory=${BASE_OUTPUT_PATH} load_parameters_path=${UNSCANNED_CKPT_PATH} run_name=matmul_forward_pass_test per_device_batch_size=1 model_name=mixtral-8x7b tokenizer_path="${MAXTEXT_ASSETS_ROOT:-${MAXTEXT_PKG_DIR:-${MAXTEXT_REPO_ROOT:-$PWD}/src/MaxText/assets}}"/tokenizer.mistral-v1 ici_tensor_parallelism=1 ici_fsdp_parallelism=-1 max_prefill_predict_length=11 max_target_length=11 dtype=float32 megablox=False sparse_matmul=False scan_layers=false --token_size=4 --max_kl_div=3e-3
4545

46-
# To repeat duplicate tests, we have MoE unit test to verify outputs matching for matmul, megablox, and ragged_dot implementation at https://github.com/AI-Hypercomputer/maxtext/blob/5c4090b8d5713a1a25cab85df89b0ec9c9862635/MaxText/tests/moe_test.py#L338-L411
46+
# To repeat duplicate tests, we have MoE unit test to verify outputs matching for matmul, megablox, and ragged_dot implementation at https://github.com/AI-Hypercomputer/maxtext/blob/5c4090b8d5713a1a25cab85df89b0ec9c9862635/MaxText/tests/unit/moe_test.py#L338-L411
4747

4848
# Run pre-training - megablox implementation
4949
python3 -m MaxText.train "${MAXTEXT_PKG_DIR:-${MAXTEXT_REPO_ROOT:-$PWD}/src/MaxText}/"configs/base.yml base_output_directory=${BASE_OUTPUT_PATH} dataset_path=${DATASET_PATH} run_name=megablox_pre_training per_device_batch_size=4 enable_checkpointing=false model_name=mixtral-8x7b ici_fsdp_parallelism=-1 steps=5 max_target_length=1024 async_checkpointing=false tokenizer_path="${MAXTEXT_ASSETS_ROOT:-${MAXTEXT_PKG_DIR:-${MAXTEXT_REPO_ROOT:-$PWD}/src/MaxText/assets}}"/tokenizer.mistral-v1 attention=flash dtype=bfloat16 weight_dtype=bfloat16

local_datasets/get_minimal_hf_c4_parquet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
1717
Fetch the first train & validation TFRecord 00000-of shard for a version and
1818
sample rows into two tiny parquet files with fixed output names for the usage
19-
in tests/grain_data_processing_test.py, tests/hf_data_processing_test.py,
20-
tests/train_tests.py:
19+
in tests/unit/grain_data_processing_test.py, tests/unit/hf_data_processing_test.py,
20+
tests/integration/train_tests.py:
2121
c4-train-00000-of-01637.parquet
2222
c4-validation-00000-of-01637.parquet
2323
"""

pytest.ini

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@ testpaths =
55
python_files = *_test.py *_tests.py
66
addopts =
77
-rf --import-mode=importlib --strict-markers
8-
--ignore=tests/profiler_test.py
9-
--ignore=tests/train_smoke_test.py
10-
--ignore=tests/train_int8_smoke_test.py
11-
--ignore=tests/train_gpu_smoke_test.py
12-
--ignore=tests/train_using_ragged_dot_smoke_test.py
13-
--ignore=tests/grpo_trainer_correctness_test.py
14-
--ignore=tests/offline_engine_test.py
8+
--ignore=tests/integration/grpo_trainer_correctness_test.py
9+
--ignore=tests/integration/smoke/train_gpu_smoke_test.py
10+
--ignore=tests/integration/smoke/train_int8_smoke_test.py
11+
--ignore=tests/integration/smoke/train_smoke_test.py
12+
--ignore=tests/integration/smoke/train_using_ragged_dot_smoke_test.py
13+
--ignore=tests/unit/dequantize_mxfp4_test.py
14+
--ignore=tests/unit/gemma3_layers_test.py
15+
--ignore=tests/unit/gpt_vs_reference_test.py
16+
--ignore=tests/unit/llama4_layers_test.py
17+
--ignore=tests/unit/mla_vs_reference_test.py
18+
--ignore=tests/unit/moba_vs_reference_test.py
19+
--ignore=tests/unit/offline_engine_test.py
20+
--ignore=tests/unit/profiler_test.py
21+
--ignore=tests/unit/qwen3_embedding_vs_reference_test.py
22+
--ignore=tests/unit/qwen3_next_vs_reference_test.py
1523
markers =
1624
tpu_only: marks tests to be run on TPUs only
1725
gpu_only: marks tests to be run on GPUs only

tests/assets/logits_generation/generate_grpo_golden_logits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
from MaxText.globals import MAXTEXT_TEST_ASSETS_ROOT, MAXTEXT_PKG_DIR
5353
from MaxText.layers import models
5454

55-
from tests.grpo_trainer_correctness_test import prepare_maxtext_inputs
55+
from tests.integration.grpo_trainer_correctness_test import prepare_maxtext_inputs
5656

5757

5858
class GRPOTest(unittest.TestCase):

0 commit comments

Comments
 (0)