Skip to content

Commit 355178c

Browse files
committed
Fix broken links and formatting for documentation
Also adds API documentation to ToC.
1 parent 5b0bb89 commit 355178c

7 files changed

Lines changed: 58 additions & 47 deletions

File tree

docs/development.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ The MaxText documentation website is built using [Sphinx](https://www.sphinx-doc
99

1010
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.
1111

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:
1313

1414
```bash
15-
pip install -r dependencies/requirements/requirements_docs.txt
15+
uv pip install -r dependencies/requirements/requirements_docs.txt
1616
```
1717

18-
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:
1919

2020
```bash
2121
sphinx-build -b html . _build/html

docs/guides/model_bringup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ For models with existing Hugging Face support, you can validate parity using the
9393

9494
### 5.2 Eval Benchmark
9595

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.
9797

9898
## 6. Completion Checklist
9999

docs/guides/optimization/benchmark_and_performance.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Begin your benchmarking efforts by performing an arithmetic intensity analysis.
1818

1919
Arithmetic intensity is calculated as the ratio of floating-point operations (FLOPs) to memory(bytes) or communication(bytes).
2020

21-
* **Arithmetic Intensity = FLOPs / Bytes**
21+
- **Arithmetic Intensity = FLOPs / Bytes**
2222

2323
This metric helps determine whether a computation is MXU-bound (high arithmetic intensity) or memory-bound/communication-bound (low arithmetic intensity).
2424

@@ -28,8 +28,8 @@ This metric helps determine whether a computation is MXU-bound (high arithmetic
2828

2929
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.
3030

31-
* **MFU = flops_train_step / step_time / peak HW FLOPS**
32-
* **Throughput = global tokens / step_time / number of devices**
31+
- **MFU = flops_train_step / step_time / peak HW FLOPS**
32+
- **Throughput = global tokens / step_time / number of devices**
3333

3434
More detailed are explained in [](performance-metrics).
3535

@@ -69,7 +69,7 @@ Different quantization recipes are available, including` "int8", "fp8", "fp8_ful
6969

7070
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.
7171

72-
See [](quantization).
72+
See [](quantization-doc).
7373

7474
### Choose sharding strategy
7575

@@ -98,19 +98,19 @@ There are two methods for asynchronous collective offloading:
9898

9999
1. Offload Collectives to Sparse Core:
100100

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):
102102

103-
* `ENABLE_SPARSECORE_OFFLOADING_FOR_RS_AG_AR`
104-
* `ENABLE_SPARSECORE_OFFLOADING_FOR_REDUCE_SCATTER`
105-
* `ENABLE_SPARSECORE_OFFLOADING_FOR_ALL_GATHER`
106-
* `ENABLE_SPARSECORE_OFFLOADING_FOR_ALL_REDUCE`
103+
- `ENABLE_SPARSECORE_OFFLOADING_FOR_RS_AG_AR`
104+
- `ENABLE_SPARSECORE_OFFLOADING_FOR_REDUCE_SCATTER`
105+
- `ENABLE_SPARSECORE_OFFLOADING_FOR_ALL_GATHER`
106+
- `ENABLE_SPARSECORE_OFFLOADING_FOR_ALL_REDUCE`
107107

108-
2. Overlap Collective Using Continuation Fusion:**
108+
2. Overlap Collective Using Continuation Fusion:
109109

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)):
111111

112-
* `CF_FOR_ALL_GATHER`
113-
* `CF_FOR_ALL_REDUCE`
112+
- `CF_FOR_ALL_GATHER`
113+
- `CF_FOR_ALL_REDUCE`
114114

115115
Those XLA can be set via `LIBTPU_INIT_ARGS`
116116

docs/guides/optimization/custom_model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Use these general runtime configurations to improve your model's performance.
8585

8686
## Step 3. Choose efficient sharding strategies using Roofline Analysis
8787

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/).
8989

9090
| TPU Type | ICI Arithmetic Intensity |
9191
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |

docs/install_maxtext.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
This document discusses how to install MaxText. We recommend installing MaxText inside a Python virtual environment.
2020

2121
## From PyPI (Recommended)
22+
2223
This is the easiest way to get started with the latest stable version.
2324

2425
```bash
@@ -33,11 +34,13 @@ source maxtext_venv/bin/activate
3334
uv pip install maxtext --resolution=lowest
3435
install_maxtext_github_deps
3536
```
37+
3638
> **Note:** The `install_maxtext_github_deps` command is temporarily required to install dependencies directly from GitHub that are not yet available on PyPI.
3739
3840
> **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.
3941
4042
## From Source
43+
4144
If you plan to contribute to MaxText or need the latest unreleased features, install from source.
4245

4346
```bash
@@ -70,11 +73,11 @@ This document provides a guide to updating dependencies in MaxText using the `se
7073

7174
To update dependencies, you will follow these general steps:
7275

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.
7881

7982
The following sections provide detailed instructions for each step.
8083

@@ -126,25 +129,26 @@ seed-env \
126129

127130
After generating the new requirements, you need to update the files in the MaxText repository.
128131

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`.
132136

133-
2. **Update `extra_deps_from_github.txt` (if necessary):**
134-
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.
137+
2. **Update `extra_deps_from_github.txt` (if necessary):**
138+
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.
135139

136140
## Step 5: Verify the New Dependencies
137141

138142
Finally, test that the new dependencies install correctly and that MaxText runs as expected.
139143

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.
141145

142146
```bash
143147
uv venv --python 3.12 --seed maxtext_venv
144148
source maxtext_venv/bin/activate
145149
```
146150

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.
148152

149153
```bash
150154
pip install uv
@@ -155,4 +159,4 @@ uv pip install -e .[tpu] --resolution=lowest
155159
install_maxtext_github_deps
156160
```
157161

158-
3. **Run tests:** Run MaxText tests to ensure there are no regressions.
162+
3. **Run tests:** Run MaxText tests to ensure there are no regressions.

docs/reference.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,51 @@
1818

1919
Deep dive into MaxText architecture, models, and core concepts.
2020

21-
::::{grid} 1 2 2 2
22-
:gutter: 2
23-
24-
:::{grid-item-card} 📊 Performance Metrics
21+
````{grid} 1 2 2 2
22+
---
23+
gutter: 2
24+
---
25+
```{grid-item-card} 📊 Performance Metrics
2526
:link: reference/performance_metrics
2627
:link-type: doc
2728
2829
Understanding Model Flops Utilization (MFU), calculation methods, and why it matters for performance optimization.
29-
:::
30+
```
3031
31-
:::{grid-item-card} 🤖 Models
32+
```{grid-item-card} 🤖 Models
3233
:link: reference/models
3334
:link-type: doc
3435
3536
Supported models and architectures, including Llama, Qwen, and Mixtral. Details on tiering and new additions.
36-
:::
37+
```
3738
38-
:::{grid-item-card} 🏗️ Architecture
39+
```{grid-item-card} 🏗️ Architecture
3940
:link: reference/architecture
4041
:link-type: doc
4142
4243
High-level overview of MaxText design, JAX/XLA choices, and how components interact.
43-
:::
44+
```
4445
45-
:::{grid-item-card} 💡 Core Concepts
46+
```{grid-item-card} 💡 Core Concepts
4647
:link: reference/core_concepts
4748
:link-type: doc
4849
4950
Key concepts including checkpointing strategies, quantization, tiling, and Mixture of Experts (MoE) configuration.
50-
:::
51-
::::
51+
```
52+
````
5253

53-
```{toctree}
54-
:hidden:
55-
:maxdepth: 1
54+
## 📚 API Reference
5655

56+
Find comprehensive API documentation for MaxText modules, classes, and functions in the [API Reference page](reference/api.rst).
57+
58+
```{toctree}
59+
---
60+
hidden:
61+
maxdepth: 1
62+
---
5763
reference/performance_metrics
5864
reference/models
5965
reference/architecture
6066
reference/core_concepts
67+
reference/api.rst
6168
```

docs/reference/core_concepts/quantization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
-->
1616

17-
(quantization)=
17+
(quantization-doc)=
1818

1919
# Quantization
2020

0 commit comments

Comments
 (0)