Skip to content

Commit 70aeb55

Browse files
authored
Merge branch 'main' into fix-links
2 parents 91310cb + fb79a9e commit 70aeb55

25 files changed

Lines changed: 409 additions & 982 deletions

File tree

docs/guides/monitoring_and_debugging/features_and_diagnostics.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,6 @@
1616

1717
# Features and diagnostics
1818

19-
## Collect stack traces
20-
21-
When running a Single Program, Multiple Data (SPMD) job on accelerators, the overall process can hang if there is any error or any VM hangs/crashes for some reason. In this scenario, capturing stack traces will help to identify and troubleshoot the issues for the jobs running on TPU VMs.
22-
23-
The following configurations will help to debug a fault or when a program is stuck or hung somewhere by collecting stack traces. Change the parameter values accordingly in `src/maxtext/configs/base.yml`:
24-
25-
1. Set `collect_stack_trace: True` to enable collection of stack traces on faults or when the program is hung. This setting will periodically dump the traces for the program to help in debugging. To disable this, set `collect_stack_trace: False`.
26-
2. Set `stack_trace_to_cloud: False` to display stack traces on console. `stack_trace_to_cloud: True` will create a temporary file in `/tmp/debugging` in the TPUs to store the stack traces. There is an agent running on TPU VMs that will periodically upload the traces from the temporary directory to cloud logging in the gcp project. You can view the traces in Logs Explorer on Cloud Logging using the following query:
27-
28-
```
29-
logName="projects/<project_name>/logs/tpu.googleapis.com%2Fruntime_monitor"
30-
jsonPayload.verb="stacktraceanalyzer"
31-
```
32-
33-
3. `stack_trace_interval_seconds` signifies the duration in seconds between each stack trace collection event. Setting `stack_trace_interval_seconds: 600` will collect the stack traces every 600 seconds (10 minutes).
34-
35-
Here is the related PyPI package: https://pypi.org/project/cloud-tpu-diagnostics.
36-
3719
(aot-compilation)=
3820

3921
## Ahead of Time compilation (AOT)

docs/reference/architecture/architecture_overview.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,5 @@ The critical technology enabling this strategy is the suite of checkpoint conver
179179

180180
Debugging performance issues in a distributed system with thousands of accelerators is a notoriously difficult challenge. MaxText incorporates several built-in diagnostic features designed to provide visibility into the system's behavior at scale.
181181

182-
- Stack trace collection: To diagnose program hangs or faults, users can set `collect_stack_trace: True` in the configuration. This feature will periodically dump the Python stack traces from all worker processes. The traces can be directed to the console for immediate inspection or, more scalably, uploaded to Cloud Logging, where they can be aggregated and queried to identify misbehaving nodes.
183182
- HLO dumping: For deep, low-level performance analysis, MaxText allows users to dump the XLA High-Level Optimizer (HLO) graph. By setting the `dump_hlo` flag, the compiled graph for a specific training step can be saved to a local directory or uploaded to Cloud Storage. This HLO representation is invaluable for compiler engineers and advanced users who need to understand exactly how XLA is interpreting and optimizing the model, making it possible to debug subtle performance regressions or compiler-related issues.
184183
- Goodput monitoring: The framework integrates with the ml-goodput-measurement library, which provides a more holistic view of job efficiency than simple TFLOPs calculations. This allows for the tracking of metrics that capture overall "goodput," accounting for factors like data loading time, compilation overhead, and idle time, giving a truer picture of end-to-end performance.

docs/reference/models/supported_models_and_architectures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ MaxText is an open-source, high-performance LLM framework written in Python/JAX.
1313
- **Supported Precisions**: FP32, BF16, INT8, and FP8.
1414
- **Ahead-of-Time Compilation (AOT)**: For faster model development/prototyping and earlier OOM detection.
1515
- **Quantization**: Via **Qwix** (recommended) and AQT. See the [Quantization guide](quantization-doc).
16-
- **Diagnostics**: Structured error context via **`cloud_tpu_diagnostics`** (filters stack traces to user code), simple logging via `max_logging`, profiling in **XProf**, and visualization in **TensorBoard**.
16+
- **Diagnostics**: Simple logging via `max_logging`, profiling in **XProf**, and visualization in **TensorBoard**.
1717
- **Multi-Token Prediction (MTP)**: Enables token efficient training with multi-token prediction.
1818
- **Elastic Training**: Fault-tolerant and dynamic scale-up/scale-down on Cloud TPUs with Pathways.
1919
- **Flexible Remat Policy**: Provides fine-grained control over memory-compute trade-offs. Users can select pre-defined policies (like 'full' or 'minimal') or set the policy to **'custom'**.

docs/run_maxtext/decoupled_mode.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,12 @@ Optional environment variables:
5454
MaxText exposes a single module `maxtext.common.gcloud_stub` to avoid scattering environment checks:
5555

5656
```python
57-
from maxtext.common.gcloud_stub import is_decoupled, cloud_diagnostics, jetstream
57+
from maxtext.common.gcloud_stub import is_decoupled, jetstream
5858

5959
if is_decoupled():
6060
# Skip optional integrations or use local fallbacks
6161
pass
6262

63-
# Cloud diagnostics (returns diagnostic, debug_configuration, diagnostic_configuration, stack_trace_configuration)
64-
diagnostic, debug_configuration, diagnostic_configuration, stack_trace_configuration = (
65-
cloud_diagnostics()
66-
)
67-
6863
# JetStream (serving) components
6964
config_lib, engine_api, token_utils, tokenizer_api, token_params_ns = jetstream()
7065
TokenizerParameters = getattr(token_params_ns, "TokenizerParameters", object)
@@ -78,7 +73,7 @@ Behavior when `DECOUPLE_GCLOUD=TRUE`:
7873

7974
## Guidelines:
8075

81-
- Prefer calling `jetstream()` / `cloud_diagnostics()` once at module import and branching on `is_decoupled()` for functionality that truly requires the dependency.
76+
- Prefer calling `jetstream()` once at module import and branching on `is_decoupled()` for functionality that truly requires the dependency.
8277
- Use `is_decoupled()` to avoid direct `os.environ["DECOUPLE_GCLOUD"]` checking.
8378
- Use `get_test_config_path()` instead of hard-coded `base.yml`.
8479
- Prefer conditional local fallbacks for cloud buckets and avoid introducing direct `gs://...` paths.

docs/tutorials/posttraining/rl_on_multi_host.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ python3 -m maxtext.trainers.post_train.rl.train_rl \
170170
load_parameters_path=${MAXTEXT_CKPT_PATH?} \
171171
run_name=${RUN_NAME?} \
172172
base_output_directory=${BASE_OUTPUT_DIRECTORY?} \
173+
rollout_tensor_parallelism=8 \
173174
hf_access_token=${HF_TOKEN?}"
174175
```
175176

@@ -187,6 +188,7 @@ python3 -m maxtext.trainers.post_train.rl.train_rl \
187188
load_parameters_path=${MAXTEXT_CKPT_PATH?} \
188189
run_name=${RUN_NAME?} \
189190
base_output_directory=${BASE_OUTPUT_DIRECTORY?} \
191+
rollout_tensor_parallelism=8 \
190192
hf_access_token=${HF_TOKEN?} \
191193
loss_algo=gspo-token"
192194
```
@@ -214,6 +216,8 @@ python3 -m maxtext.trainers.post_train.rl.train_rl \
214216
installed and authentication is configured.
215217
- **Workload Failures**: Review the logs for specific error messages and
216218
ensure all environment variables are properly set.
219+
- **Parallelism ValueError (At most one can be -1)**: If you see `ValueError: At most one of rollout_tensor_parallelism, ... can be -1 (auto-derived)`, it means you have not explicitly defined the rollout parallelism parameters.
220+
- **Solution**: Explicitly pass at least one of them in your training command (e.g., `rollout_tensor_parallelism=8` as shown in the example commands above).
217221
- **Workload retry / resume**:
218222
- **Retry (fresh run)**: Use a unique run name to avoid overwriting
219223
outputs: `export RUN_NAME=${RUN_NAME?}-retry1 export MAXTEXT_CKPT_PATH=${BASE_OUTPUT_DIRECTORY?}/${RUN_NAME?}/0/items`. Then

src/dependencies/requirements/base_requirements/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ aqtp
33
array-record
44
chex
55
cloud-accelerator-diagnostics
6-
cloud-tpu-diagnostics!=1.1.14
76
datasets
87
drjax
98
flax

src/dependencies/requirements/base_requirements/tpu-post-train-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ setuptools<81.0.0
3636
sortedcontainers
3737
torch==2.11.0
3838
torchax==0.0.11
39-
torchvision==0.25.0
39+
torchvision==0.26.0
4040
tpu-info
4141
watchfiles
4242
xgrammar

src/dependencies/requirements/generated_requirements/cuda12-requirements.txt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
absl-py>=2.4.0
55
aiofiles>=25.1.0
6-
aiohappyeyeballs>=2.6.1
6+
aiohappyeyeballs>=2.6.2
77
aiohttp>=3.13.5
88
aiosignal>=1.4.0
99
annotated-doc>=0.0.4
@@ -23,17 +23,16 @@ cffi>=2.0.0 ; platform_python_implementation != 'PyPy'
2323
cfgv>=3.5.0
2424
charset-normalizer>=3.4.7
2525
chex>=0.1.91
26-
click>=8.3.3
26+
click>=8.4.0
2727
cloud-accelerator-diagnostics>=0.1.1
28-
cloud-tpu-diagnostics>=0.1.5
2928
cloudpickle>=3.1.2
3029
clu>=0.0.12
3130
colorama>=0.4.6
3231
contourpy>=1.3.3
3332
cryptography>=48.0.0
3433
cycler>=0.12.1
3534
datasets>=4.8.5
36-
decorator>=5.2.1
35+
decorator>=5.3.1
3736
dill>=0.4.1
3837
distlib>=0.4.0
3938
distro>=1.9.0
@@ -56,10 +55,10 @@ gast>=0.7.0
5655
gcsfs>=2026.2.0
5756
google-api-core>=2.30.3
5857
google-api-python-client>=2.196.0
59-
google-auth>=2.52.0
58+
google-auth>=2.53.0
6059
google-auth-httplib2>=0.4.0
6160
google-auth-oauthlib>=1.4.0
62-
google-cloud-aiplatform>=1.152.0
61+
google-cloud-aiplatform>=1.153.1
6362
google-cloud-appengine-logging>=1.9.0
6463
google-cloud-audit-log>=0.5.0
6564
google-cloud-bigquery>=3.41.0
@@ -71,7 +70,7 @@ google-cloud-resource-manager>=1.17.0
7170
google-cloud-storage>=3.10.1
7271
google-cloud-storage-control>=1.11.0
7372
google-crc32c>=1.8.0
74-
google-genai>=1.75.0
73+
google-genai>=2.4.0
7574
google-pasta>=0.2.0
7675
google-resumable-media>=2.9.0
7776
googleapis-common-protos>=1.75.0
@@ -86,14 +85,14 @@ hf-xet>=1.5.0 ; platform_machine == 'AMD64' or platform_machine == 'aarch64' or
8685
httpcore>=1.0.9
8786
httplib2>=0.31.2
8887
httpx>=0.28.1
89-
huggingface-hub>=1.14.0
88+
huggingface-hub>=1.15.0
9089
humanize>=4.15.0
9190
hypothesis>=6.142.1
9291
identify>=2.6.19
9392
idna>=3.11
9493
immutabledict>=4.3.1
9594
importlab>=0.8.1
96-
importlib-metadata>=8.7.1
95+
importlib-metadata>=9.0.0
9796
iniconfig>=2.3.0
9897
isort>=8.0.1
9998
jax>=0.10.0
@@ -147,7 +146,7 @@ nvidia-nvjitlink-cu12>=12.9.86 ; sys_platform == 'linux'
147146
nvidia-nvshmem-cu12>=3.6.5 ; sys_platform == 'linux'
148147
oauthlib>=3.3.1
149148
omegaconf>=2.3.0
150-
opentelemetry-api>=1.41.1
149+
opentelemetry-api>=1.42.0
151150
opt-einsum>=3.4.0
152151
optax>=0.2.8
153152
optree>=0.19.0
@@ -221,7 +220,7 @@ tensorflow-metadata>=1.17.3
221220
tensorflow-text>=2.20.1
222221
tensorstore>=0.1.82
223222
termcolor>=3.3.0
224-
tiktoken>=0.12.0
223+
tiktoken>=0.13.0
225224
tokamax>=0.0.12
226225
tokenizers>=0.22.2
227226
toml>=0.10.2
@@ -231,7 +230,7 @@ tqdm>=4.66.3
231230
transformer-engine>=2.15.0
232231
transformer-engine-cu12>=2.15.0
233232
transformer-engine-jax>=2.15.0
234-
transformers>=5.8.1
233+
transformers>=5.9.0
235234
treescope>=0.1.10
236235
typeguard>=2.13.3
237236
typer>=0.25.1
@@ -240,7 +239,7 @@ typing-inspection>=0.4.2
240239
tzdata>=2026.2 ; sys_platform == 'emscripten' or sys_platform == 'win32'
241240
uritemplate>=4.2.0
242241
urllib3>=2.6.3
243-
uvicorn>=0.46.0
242+
uvicorn>=0.47.0
244243
uvloop>=0.22.1
245244
virtualenv>=21.3.3
246245
wadler-lindig>=0.1.7
@@ -249,6 +248,6 @@ werkzeug>=3.1.8
249248
wheel>=0.46.3
250249
wrapt>=2.1.2
251250
xxhash>=3.7.0
252-
yarl>=1.23.0
251+
yarl>=1.24.2
253252
zipp>=3.23.1
254253
zstandard>=0.25.0

src/dependencies/requirements/generated_requirements/tpu-post-train-requirements.txt

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
absl-py>=2.4.0
55
accelerate>=1.13.0
66
aiofiles>=25.1.0
7-
aiohappyeyeballs>=2.6.1
7+
aiohappyeyeballs>=2.6.2
88
aiohttp>=3.13.5
99
aiosignal>=1.4.0
1010
annotated-doc>=0.0.4
1111
annotated-types>=0.7.0
12-
anthropic>=0.102.0
12+
anthropic>=0.103.1
1313
antlr4-python3-runtime>=4.9.3
1414
anyio>=4.13.0
1515
apache-tvm-ffi>=0.1.11
@@ -23,20 +23,19 @@ astunparse>=1.6.3
2323
attrs>=26.1.0
2424
auditwheel>=6.6.0
2525
black>=25.12.0
26-
boto3>=1.43.7
27-
botocore>=1.43.7
26+
boto3>=1.43.11
27+
botocore>=1.43.11
2828
build>=1.4.3
29-
cachetools>=7.1.1
29+
cachetools>=7.1.3
3030
cbor2>=6.1.1
3131
certifi>=2026.2.25
3232
cffi>=2.0.0 ; implementation_name == 'pypy' or platform_python_implementation != 'PyPy'
3333
cfgv>=3.5.0
3434
charset-normalizer>=3.4.7
3535
cheroot>=11.1.2
3636
chex>=0.1.91
37-
click>=8.3.3
37+
click>=8.4.0
3838
cloud-accelerator-diagnostics>=0.1.1
39-
cloud-tpu-diagnostics>=0.1.5
4039
cloudpickle>=3.1.2
4140
clu>=0.0.12
4241
colorama>=0.4.6
@@ -52,7 +51,7 @@ dataclasses>=0.5
5251
dataclasses-json>=0.0.1
5352
datasets>=4.8.5
5453
debugpy>=1.8.20
55-
decorator>=5.2.1
54+
decorator>=5.3.1
5655
dill>=0.4.1
5756
distlib>=0.4.0
5857
distro>=1.9.0
@@ -80,10 +79,10 @@ gepa>=0.1.1
8079
gguf>=0.19.0
8180
google-api-core>=2.30.3
8281
google-api-python-client>=2.196.0
83-
google-auth>=2.52.0
82+
google-auth>=2.53.0
8483
google-auth-httplib2>=0.4.0
8584
google-auth-oauthlib>=1.4.0
86-
google-cloud-aiplatform>=1.152.0
85+
google-cloud-aiplatform>=1.153.1
8786
google-cloud-appengine-logging>=1.9.0
8887
google-cloud-audit-log>=0.5.0
8988
google-cloud-bigquery>=3.41.0
@@ -95,7 +94,7 @@ google-cloud-resource-manager>=1.17.0
9594
google-cloud-storage>=3.10.1
9695
google-cloud-storage-control>=1.11.0
9796
google-crc32c>=1.8.0
98-
google-genai>=1.75.0
97+
google-genai>=2.4.0
9998
google-metrax>=0.2.3
10099
google-pasta>=0.2.0
101100
google-resumable-media>=2.9.0
@@ -114,28 +113,27 @@ hf-xet>=1.5.0 ; platform_machine == 'AMD64' or platform_machine == 'aarch64' or
114113
httpcore>=1.0.9
115114
httplib2>=0.31.2
116115
httpx>=0.28.1
117-
huggingface-hub>=1.14.0
116+
huggingface-hub>=1.15.0
118117
humanize>=4.15.0
119118
hypothesis>=6.142.1
120119
identify>=2.6.19
121120
idna>=3.11
122121
ijson>=3.5.0
123122
immutabledict>=4.3.1
124123
importlab>=0.8.1
125-
importlib-metadata>=8.7.1
126124
iniconfig>=2.3.0
127125
ipykernel>=7.2.0
128126
ipython>=9.13.0
129127
ipython-pygments-lexers>=1.1.1
130128
ipywidgets>=8.1.8
131129
isort>=8.0.1
132-
jaraco-functools>=4.4.0
130+
jaraco-functools>=4.5.0
133131
jax>=0.10.0
134132
jaxlib>=0.10.0
135133
jaxtyping>=0.3.9
136134
jedi>=0.20.0
137135
jinja2>=3.1.6
138-
jiter>=0.14.0
136+
jiter>=0.15.0
139137
jmespath>=1.1.0
140138
jsonlines>=4.0.0
141139
jsonschema>=4.26.0
@@ -154,7 +152,7 @@ libtpu>=0.0.40 ; platform_machine == 'x86_64' and sys_platform == 'linux'
154152
llguidance>=1.7.5
155153
llvmlite>=0.47.0
156154
loguru>=0.7.3
157-
lxml>=6.1.0
155+
lxml>=6.1.1
158156
markdown>=3.10.2
159157
markdown-it-py>=4.0.0
160158
markupsafe>=3.0.3
@@ -203,9 +201,9 @@ nvidia-nvshmem-cu13>=3.4.5 ; sys_platform == 'linux'
203201
nvidia-nvtx>=13.0.85 ; sys_platform == 'linux'
204202
oauthlib>=3.3.1
205203
omegaconf>=2.3.0
206-
openai>=2.36.0
204+
openai>=2.37.0
207205
openai-harmony>=0.0.8
208-
opentelemetry-api>=1.41.1
206+
opentelemetry-api>=1.42.0
209207
opt-einsum>=3.4.0
210208
optax>=0.2.6
211209
optree>=0.19.0
@@ -309,19 +307,20 @@ tensorflow-metadata>=1.17.3
309307
tensorflow-text>=2.20.1
310308
tensorstore>=0.1.82
311309
termcolor>=3.3.0
312-
tiktoken>=0.12.0
310+
tiktoken>=0.13.0
313311
tokamax>=0.0.12
314312
tokenizers>=0.22.2
315313
toml>=0.10.2
316314
tomlkit>=0.15.0
317315
toolz>=1.1.0
318316
torch>=2.11.0
319317
torchax>=0.0.11
318+
torchvision>=0.26.0
320319
tornado>=6.5.5
321320
tpu-info>=0.11.0
322321
tqdm>=4.66.3
323322
traitlets>=5.15.0
324-
transformers>=5.8.1
323+
transformers>=5.9.0
325324
treescope>=0.1.10
326325
triton>=3.6.0 ; sys_platform == 'linux'
327326
typeguard>=2.13.3
@@ -331,22 +330,22 @@ typing-inspection>=0.4.2
331330
tzdata>=2026.2 ; sys_platform == 'emscripten' or sys_platform == 'win32'
332331
uritemplate>=4.2.0
333332
urllib3>=2.6.3
334-
uvicorn>=0.46.0
333+
uvicorn>=0.47.0
335334
uvloop>=0.22.1
336335
virtualenv>=21.3.3
337336
wadler-lindig>=0.1.7
338-
watchfiles>=1.1.1
337+
watchfiles>=1.2.0
339338
wcwidth>=0.7.0
340339
websockets>=16.0
341340
werkzeug>=3.1.8
342341
wheel>=0.46.3
343342
widgetsnbextension>=4.0.15
344343
win32-setctime>=1.2.0 ; sys_platform == 'win32'
345344
wrapt>=2.1.2
346-
xgrammar>=0.2.0
345+
xgrammar>=0.2.1
347346
xprof>=2.22.3
348347
xxhash>=3.7.0
349348
yapf>=0.43.0
350-
yarl>=1.23.0
349+
yarl>=1.24.2
351350
zipp>=3.23.1
352351
zstandard>=0.25.0

0 commit comments

Comments
 (0)