You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,22 +9,22 @@ The MaxText documentation website is built using [Sphinx](https://www.sphinx-doc
9
9
10
10
If you are writing documentation for MaxText, you may want to preview the documentation site locally to ensure things work as expected before a deployment to Read The Docs.
11
11
12
-
First, make sure you install the necessary dependencies. You can do this by navigating to your local clone of the MaxText repo and running:
12
+
First, make sure you install the necessary dependencies. You can do this by navigating to your local clone of the MaxText repo, following the [local installation instructions](install_maxtext.md) and running:
Once the dependencies are installed, you can navigate to the `docs/` folder and run:
18
+
Once the dependencies are installed and your `maxtext_venv` virtual environment is activated, you can navigate to the `docs/` folder and run:
19
19
20
20
```bash
21
-
sphinx-build -b html . _build/html
21
+
uv run sphinx-build -b html . _build/html
22
22
```
23
23
24
24
This will generate the documentation in the `docs/_build/html` directory. These files can be opened in a web browser directly, or you can use a simple HTTP server to serve the files. For example, you can run:
25
25
26
26
```bash
27
-
python -m http.server -d _build/html
27
+
uv run python -m http.server -d _build/html
28
28
```
29
29
30
30
Then, open your web browser and navigate to `http://localhost:8000` to view the documentation.
Copy file name to clipboardExpand all lines: docs/guides/model_bringup.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ For models with existing Hugging Face support, you can validate parity using the
93
93
94
94
### 5.2 Eval Benchmark
95
95
96
-
MaxText integrates with benchmark libraries like [lm-eval-harness](https://github.com/EleutherAI/lm-evaluation-harness) and [evalchemy](https://github.com/mlfoundations/evalchemy) to facilitate rapid verification of common inference scores ([guide](../../benchmarks/api_server)). This is particularly useful for validating decoding outputs or assessing model performance when logits deviate slightly from reference values.
96
+
MaxText integrates with benchmark libraries like [lm-eval-harness](https://github.com/EleutherAI/lm-evaluation-harness) and [evalchemy](https://github.com/mlfoundations/evalchemy) to facilitate rapid verification of common inference scores ([guide](https://github.com/AI-Hypercomputer/maxtext/tree/main/benchmarks/api_server)). This is particularly useful for validating decoding outputs or assessing model performance when logits deviate slightly from reference values.
Copy file name to clipboardExpand all lines: docs/guides/optimization/benchmark_and_performance.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ Begin your benchmarking efforts by performing an arithmetic intensity analysis.
18
18
19
19
Arithmetic intensity is calculated as the ratio of floating-point operations (FLOPs) to memory(bytes) or communication(bytes).
20
20
21
-
***Arithmetic Intensity = FLOPs / Bytes**
21
+
-**Arithmetic Intensity = FLOPs / Bytes**
22
22
23
23
This metric helps determine whether a computation is MXU-bound (high arithmetic intensity) or memory-bound/communication-bound (low arithmetic intensity).
24
24
@@ -28,8 +28,8 @@ This metric helps determine whether a computation is MXU-bound (high arithmetic
28
28
29
29
For benchmarking purposes, we collect the step time for training. This step time is then used to calculate MFU and throughputs, which provide insights into the utilization achieved for each benchmark workload.
-**Throughput = global tokens / step_time / number of devices**
33
33
34
34
More detailed are explained in [](performance-metrics).
35
35
@@ -69,7 +69,7 @@ Different quantization recipes are available, including` "int8", "fp8", "fp8_ful
69
69
70
70
For v6e and earlier generation TPUs, use the "int8" recipe. For v7x and later generation TPUs, use "fp8_full". GPUs should use “fp8_gpu” for NVIDIA and "nanoo_fp8" for AMD.
71
71
72
-
See [](quantization).
72
+
See [](quantization-doc).
73
73
74
74
### Choose sharding strategy
75
75
@@ -98,19 +98,19 @@ There are two methods for asynchronous collective offloading:
98
98
99
99
1. Offload Collectives to Sparse Core:
100
100
101
-
This method is recommended for v7x. To enable it, set the following flags from [[link](https://github.com/AI-Hypercomputer/maxtext/blob/main/benchmarks/xla_flags_library.py#L70)]:
101
+
This method is recommended for v7x. To enable it, set the following flags from [link](https://github.com/AI-Hypercomputer/maxtext/blob/main/benchmarks/xla_flags_library.py#L70):
2. Overlap Collective Using Continuation Fusion:**
108
+
2. Overlap Collective Using Continuation Fusion:
109
109
110
-
This method is recommended for v5p and v6e. To enable it, set the following flags [[link](https://github.com/AI-Hypercomputer/maxtext/blob/main/benchmarks/xla_flags_library.py#L39)]:
110
+
This method is recommended for v5p and v6e. To enable it, set the following flags ([link](https://github.com/AI-Hypercomputer/maxtext/blob/main/benchmarks/xla_flags_library.py#L39)):
Copy file name to clipboardExpand all lines: docs/guides/optimization/custom_model.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ Use these general runtime configurations to improve your model's performance.
85
85
86
86
## Step 3. Choose efficient sharding strategies using Roofline Analysis
87
87
88
-
To achieve good performance, it's often necessary to co-design the model's dimensions (like the MLP dimension) along with the sharding strategy. We have included examples for [v5p](https://docs.cloud.google.com/tpu/docs/v5p), [Trillium](https://docs.cloud.google.com/tpu/docs/v6e), and [Ironwood](https://docs.cloud.google.com/tpu/docs/tpu7x) that demonstrate which sharding approaches work well for specific models. We recommend reading [](sharding) and Jax’s [scaling book](https://jax-ml.github.io/scaling-book/sharding/).
88
+
To achieve good performance, it's often necessary to co-design the model's dimensions (like the MLP dimension) along with the sharding strategy. We have included examples for [v5p](https://docs.cloud.google.com/tpu/docs/v5p), [Trillium](https://docs.cloud.google.com/tpu/docs/v6e), and [Ironwood](https://docs.cloud.google.com/tpu/docs/tpu7x) that demonstrate which sharding approaches work well for specific models. We recommend reading [](sharding_on_TPUs) and Jax’s [scaling book](https://jax-ml.github.io/scaling-book/sharding/).
> **Note:** The `install_maxtext_tpu_github_deps`, `install_maxtext_cuda12_github_dep`, and
53
55
`install_maxtext_tpu_post_train_extra_deps` commands are temporarily required to install dependencies directly from GitHub
54
56
that are not yet available on PyPI. As shown above, choose the one that corresponds to your use case.
55
57
56
58
> **Note:** The maxtext package contains a comprehensive list of all direct and transitive dependencies, with lower bounds, generated by [seed-env](https://github.com/google-ml-infra/actions/tree/main/python_seed_env). We highly recommend the `--resolution=lowest` flag. It instructs `uv` to install the specific, tested versions of dependencies defined by MaxText, rather than the latest available ones. This ensures a consistent and reproducible environment, which is critical for stable performance and for running benchmarks.
57
59
58
60
## From Source
61
+
59
62
If you plan to contribute to MaxText or need the latest unreleased features, install from source.
60
63
61
64
```bash
@@ -98,11 +101,11 @@ Please keep dependencies updated throughout development. This will allow each co
98
101
99
102
To update dependencies, you will follow these general steps:
100
103
101
-
1.**Modify Base Requirements**: Update the desired dependencies in `base_requirements/requirements.txt` or the hardware-specific files (`base_requirements/tpu-base-requirements.txt`, `base_requirements/gpu-base-requirements.txt`).
102
-
2.**Generate New Files**: Run the `seed-env` CLI tool to generate new, fully-pinned requirements files based on your changes.
103
-
3.**Update Project Files**: Copy the newly generated files into the `generated_requirements/` directory.
104
-
4.**Handle GitHub Dependencies**: Move any dependencies that are installed directly from GitHub from the generated files to `src/install_maxtext_extra_deps/extra_deps_from_github.txt`.
105
-
5.**Verify**: Test the new dependencies to ensure the project installs and runs correctly.
104
+
1.**Modify Base Requirements**: Update the desired dependencies in `base_requirements/requirements.txt` or the hardware-specific files (`base_requirements/tpu-base-requirements.txt`, `base_requirements/gpu-base-requirements.txt`).
105
+
2.**Generate New Files**: Run the `seed-env` CLI tool to generate new, fully-pinned requirements files based on your changes.
106
+
3.**Update Project Files**: Copy the newly generated files into the `generated_requirements/` directory.
107
+
4.**Handle GitHub Dependencies**: Move any dependencies that are installed directly from GitHub from the generated files to `src/install_maxtext_extra_deps/extra_deps_from_github.txt`.
108
+
5.**Verify**: Test the new dependencies to ensure the project installs and runs correctly.
106
109
107
110
The following sections provide detailed instructions for each step.
108
111
@@ -154,25 +157,26 @@ seed-env \
154
157
155
158
After generating the new requirements, you need to update the files in the MaxText repository.
156
159
157
-
1.**Copy the generated files:**
158
-
- Move `generated_tpu_artifacts/tpu-requirements.txt` to `generated_requirements/tpu-requirements.txt`.
159
-
- Move `generated_gpu_artifacts/cuda12-requirements.txt` to `generated_requirements/cuda12-requirements.txt`.
160
+
1.**Copy the generated files:**
161
+
162
+
- Move `generated_tpu_artifacts/tpu-requirements.txt` to `generated_requirements/tpu-requirements.txt`.
163
+
- Move `generated_gpu_artifacts/cuda12-requirements.txt` to `generated_requirements/cuda12-requirements.txt`.
Currently, MaxText uses a few dependencies, such as `mlperf-logging` and `google-jetstream`, that are installed directly from GitHub source. These are defined in `base_requirements/requirements.txt`, and the `seed-env` tool will carry them over to the generated requirements files.
Currently, MaxText uses a few dependencies, such as `mlperf-logging` and `google-jetstream`, that are installed directly from GitHub source. These are defined in `base_requirements/requirements.txt`, and the `seed-env` tool will carry them over to the generated requirements files.
163
167
164
168
## Step 5: Verify the New Dependencies
165
169
166
170
Finally, test that the new dependencies install correctly and that MaxText runs as expected.
167
171
168
-
1.**Create a clean environment:** It's best to start with a fresh Python virtual environment.
172
+
1.**Create a clean environment:** It's best to start with a fresh Python virtual environment.
169
173
170
174
```bash
171
175
uv venv --python 3.12 --seed maxtext_venv
172
176
source maxtext_venv/bin/activate
173
177
```
174
178
175
-
2.**Run the setup script:** Execute `bash setup.sh` to install the new dependencies.
179
+
2.**Run the setup script:** Execute `bash setup.sh` to install the new dependencies.
0 commit comments