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
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,13 @@ 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:
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_github_deps` command is temporarily required to install dependencies directly from GitHub that are not yet available on PyPI.
37
39
38
40
> **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.
39
41
40
42
## From Source
43
+
41
44
If you plan to contribute to MaxText or need the latest unreleased features, install from source.
42
45
43
46
```bash
@@ -70,11 +73,11 @@ This document provides a guide to updating dependencies in MaxText using the `se
70
73
71
74
To update dependencies, you will follow these general steps:
72
75
73
-
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`).
74
-
2.**Generate New Files**: Run the `seed-env` CLI tool to generate new, fully-pinned requirements files based on your changes.
75
-
3.**Update Project Files**: Copy the newly generated files into the `generated_requirements/` directory.
76
-
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`.
77
-
5.**Verify**: Test the new dependencies to ensure the project installs and runs correctly.
76
+
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`).
77
+
2.**Generate New Files**: Run the `seed-env` CLI tool to generate new, fully-pinned requirements files based on your changes.
78
+
3.**Update Project Files**: Copy the newly generated files into the `generated_requirements/` directory.
79
+
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`.
80
+
5.**Verify**: Test the new dependencies to ensure the project installs and runs correctly.
78
81
79
82
The following sections provide detailed instructions for each step.
80
83
@@ -126,25 +129,26 @@ seed-env \
126
129
127
130
After generating the new requirements, you need to update the files in the MaxText repository.
128
131
129
-
1.**Copy the generated files:**
130
-
- Move `generated_tpu_artifacts/tpu-requirements.txt` to `generated_requirements/tpu-requirements.txt`.
131
-
- Move `generated_gpu_artifacts/cuda12-requirements.txt` to `generated_requirements/cuda12-requirements.txt`.
132
+
1.**Copy the generated files:**
133
+
134
+
- Move `generated_tpu_artifacts/tpu-requirements.txt` to `generated_requirements/tpu-requirements.txt`.
135
+
- 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.
135
139
136
140
## Step 5: Verify the New Dependencies
137
141
138
142
Finally, test that the new dependencies install correctly and that MaxText runs as expected.
139
143
140
-
1.**Create a clean environment:** It's best to start with a fresh Python virtual environment.
144
+
1.**Create a clean environment:** It's best to start with a fresh Python virtual environment.
141
145
142
146
```bash
143
147
uv venv --python 3.12 --seed maxtext_venv
144
148
source maxtext_venv/bin/activate
145
149
```
146
150
147
-
2.**Run the setup script:** Execute `bash setup.sh` to install the new dependencies.
151
+
2.**Run the setup script:** Execute `bash setup.sh` to install the new dependencies.
0 commit comments