Skip to content

Commit 07f5662

Browse files
Merge branch 'main' into yixuann-dev-goodput
2 parents 3556e9f + 518ad8d commit 07f5662

67 files changed

Lines changed: 2591 additions & 1265 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/run_jupyter_notebooks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
runs-on: ${{ inputs.cloud_runner != '' && inputs.cloud_runner || fromJson(format('["self-hosted", "{0}", "{1}"]', inputs.device_type, inputs.device_name)) }}
5151
container:
5252
image: gcr.io/tpu-prod-env-multipod/${{ inputs.base_image }}
53+
env:
54+
VLLM_TARGET_DEVICE: "tpu"
55+
UV_TORCH_BACKEND: "cpu"
5356
steps:
5457
- name: Checkout MaxText
5558
if: ${{ !inputs.maxtext_installed }}

.github/workflows/run_tests_against_package.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ jobs:
8585
XLA_PYTHON_CLIENT_MEM_FRACTION: ${{ inputs.xla_python_client_mem_fraction }}
8686
TF_FORCE_GPU_ALLOW_GROWTH: ${{ inputs.tf_force_gpu_allow_growth }}
8787
TPU_SKIP_MDS_QUERY: ${{ inputs.device_type == 'cpu' && '1' || '' }}
88+
VLLM_TARGET_DEVICE: "tpu"
89+
UV_TORCH_BACKEND: "cpu"
8890
MAXTEXT_PACKAGE_EXTRA: >-
8991
${{
9092
!contains(inputs.pytest_marker, 'not post_training') && 'tpu-post-train'

docs/development.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ hidden:
77
---
88
development/update_dependencies.md
99
development/contribute_docs.md
10+
development/hlo_diff_testing.md
1011
```

docs/development/update_dependencies.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ overrides. You will need to do this separately for the TPU and GPU environments.
8080

8181
### TPU Pre-Training
8282

83-
> **Note:** The current `src/dependencies/requirements/generated_requirements/tpu-requirements.txt` in the repository was generated using JAX build commit hash: efd6cf797ee9c4f29c6c6d5e91ae4432209063be. When regenerating the requirements, either use the same commit hash or update this hash if you use a different one.
83+
> **Note:** The current `src/dependencies/requirements/generated_requirements/tpu-requirements.txt` in the repository was generated using JAX build commit hash: [efd6cf797ee9c4f29c6c6d5e91ae4432209063be](https://github.com/jax-ml/jax/commit/efd6cf797ee9c4f29c6c6d5e91ae4432209063be). When regenerating the requirements, either use the same commit hash or update this hash if you use a different one.
8484
8585
If you have made changes to TPU pre-training dependencies in `src/dependencies/requirements/base_requirements/tpu-requirements.txt`, you need to regenerate the pinned pre-training requirements in `generated_requirements/` directory. Run the following command, replacing `<jax-build-commit-hash>` with the hash you copied in the previous step:
8686

@@ -89,7 +89,7 @@ bash src/dependencies/scripts/generate_requirements.sh \
8989
--base-requirements src/dependencies/requirements/base_requirements/tpu-requirements.txt \
9090
--generated-requirements tpu-requirements.txt \
9191
--override-requirements src/dependencies/extra_deps/tpu_overrides.txt \
92-
--seed-commit <jax-build-commit-hash>
92+
--seed-commit efd6cf797ee9c4f29c6c6d5e91ae4432209063be
9393

9494
# Copy generated requirements to src/dependencies/requirements/generated_requirements
9595
mv generated_artifacts/python3_12/tpu-requirements.txt \
@@ -98,7 +98,7 @@ mv generated_artifacts/python3_12/tpu-requirements.txt \
9898

9999
### TPU Post-Training
100100

101-
> **Note:** The current `src/dependencies/requirements/generated_requirements/tpu-post-train-requirements.txt` in the repository was generated using JAX build commit hash: efd6cf797ee9c4f29c6c6d5e91ae4432209063be. When regenerating the requirements, either use the same commit hash or update this hash if you use a different one.
101+
> **Note:** The current `src/dependencies/requirements/generated_requirements/tpu-post-train-requirements.txt` in the repository was generated using JAX build commit hash: [a0d62932cbb02835296964e707f1cac0cbb939f8](https://github.com/jax-ml/jax/commit/a0d62932cbb02835296964e707f1cac0cbb939f8). When regenerating the requirements, either use the same commit hash or update this hash if you use a different one.
102102
103103
If you have made changes to the post-training dependencies in `src/dependencies/requirements/base_requirements/tpu-post-train-requirements.txt`, you need to regenerate the pinned post-training requirements in `generated_requirements/` directory. Run the following command, replacing `<jax-build-commit-hash>` with the hash you copied in the previous step:
104104

@@ -108,7 +108,7 @@ bash src/dependencies/scripts/generate_requirements.sh \
108108
--base-requirements src/dependencies/requirements/base_requirements/tpu-post-train-requirements.txt \
109109
--generated-requirements tpu-post-train-requirements.txt \
110110
--override-requirements src/dependencies/extra_deps/tpu_post_train_overrides.txt \
111-
--seed-commit <jax-build-commit-hash>
111+
--seed-commit a0d62932cbb02835296964e707f1cac0cbb939f8
112112

113113
# Copy generated requirements to src/dependencies/requirements/generated_requirements
114114
mv generated_artifacts/python3_12/tpu-post-train-requirements.txt \
@@ -117,15 +117,15 @@ mv generated_artifacts/python3_12/tpu-post-train-requirements.txt \
117117

118118
### GPU Pre-Training
119119

120-
> **Note:** The current `src/dependencies/requirements/generated_requirements/cuda12-requirements.txt` in the repository was generated using JAX build commit hash: efd6cf797ee9c4f29c6c6d5e91ae4432209063be. When regenerating the requirements, either use the same commit hash or update this hash if you use a different one.
120+
> **Note:** The current `src/dependencies/requirements/generated_requirements/cuda12-requirements.txt` in the repository was generated using JAX build commit hash: [efd6cf797ee9c4f29c6c6d5e91ae4432209063be](https://github.com/jax-ml/jax/commit/efd6cf797ee9c4f29c6c6d5e91ae4432209063be). When regenerating the requirements, either use the same commit hash or update this hash if you use a different one.
121121
122122
If you have made changes to the GPU pre-training dependencies in `src/dependencies/requirements/base_requirements/cuda12-requirements.txt`, you need to regenerate the pinned pre-training requirements in `generated_requirements/` directory. Run the following command, replacing `<jax-build-commit-hash>` with the hash you copied in the previous step:
123123

124124
```bash
125125
bash src/dependencies/scripts/generate_requirements.sh \
126126
--base-requirements src/dependencies/requirements/base_requirements/cuda12-requirements.txt \
127127
--generated-requirements cuda12-requirements.txt \
128-
--seed-commit <jax-build-commit-hash> \
128+
--seed-commit efd6cf797ee9c4f29c6c6d5e91ae4432209063be \
129129
--override-requirements src/dependencies/extra_deps/cuda12_overrides.txt \
130130
--hardware cuda12
131131

docs/guides/checkpointing_solutions/convert_checkpoint.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ You can find your converted checkpoint files under `${BASE_OUTPUT_DIRECTORY}/0/i
7070
### Key Parameters
7171

7272
- `model_name`: The specific model identifier. It must match a supported entry in the MaxText [globals.py](https://github.com/AI-Hypercomputer/maxtext/blob/16b684840db9b96b19e24e84ac49f06af7204ae3/src/maxtext/utils/globals.py#L46C1-L46C7).
73-
- `scan_layers`: Controls whether the output uses a scanned (`scan_layers=true`) or unscanned (`scan_layers=false`) checkpoint format. Refer [here](../../reference/core_concepts/checkpoints.md) for more information.
73+
- `scan_layers`: Controls whether the output uses a scanned (`scan_layers=true`) or unscanned (`scan_layers=false`) checkpoint format. Refer [here](../../reference/core_concepts/checkpoints.md) for more information. **IMPORTANT:** This setting *must* match the `scan_layers` value used during model training or loading. A mismatch will cause PyTree loading errors (though MaxText will intercept these and raise a descriptive `ValueError` explaining the mismatch).
7474
- `use_multimodal`: Indicates if multimodality is used, important for Gemma3.
7575
- `base_output_directory`: The path where the converted Orbax checkpoint will be stored; it can be Google Cloud Storage (GCS) or local.
7676
- `hardware=cpu`: The conversion script runs on a CPU machine.
@@ -239,7 +239,10 @@ Here is an example [PR to add support for gemma3 multi-modal model](https://gith
239239

240240
### Common Errors
241241

242-
- "Type ShapeDtypeStruct is not a valid JAX type": Usually caused by a mismatch in the `scan_layers` flag.
242+
- "Type ShapeDtypeStruct is not a valid JAX type" or generic **PyTree structure/shape mismatches** (e.g., Orbax reporting `"X/Y paths matched"`, such as `143/145 paths`):
243+
This is almost always caused by a mismatch in the `scan_layers` configuration between the checkpoint conversion script (e.g., `to_maxtext.py` or `to_huggingface.py`) and the trainer/inference runner (e.g., `train.py`).
244+
245+
- **Solution:** Ensure the `scan_layers` flag is set to the exact same value (`True` or `False`) in both the conversion command and your training/execution command.
243246

244247
- If the converted checkpoint loads without errors but produces nonsensical output, likely an error in the Q/K/V weight reshaping logic during conversion.
245248

0 commit comments

Comments
 (0)