Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ array-record
cloud-accelerator-diagnostics
cloud-tpu-diagnostics
datasets
drjax
flax
gcsfs
google-api-python-client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
absl-py>=2.3.1
aiofiles>=25.1.0
aiohappyeyeballs>=2.6.1
aiohttp>=3.13.1
aiohttp>=3.13.2
aiosignal>=1.4.0
annotated-doc>=0.0.3
annotated-types>=0.7.0
Expand Down Expand Up @@ -40,13 +40,14 @@ dill>=0.4.0
distlib>=0.4.0
dm-tree>=0.1.9
docstring-parser>=0.17.0
drjax>=0.1.4
editdistance>=0.8.1
einops>=0.8.1
einshape>=1.0
etils>=1.13.0
evaluate>=0.4.6
execnet>=2.1.1
fastapi>=0.120.1
fastapi>=0.120.2
filelock>=3.20.0
flatbuffers>=25.9.23
flax>=0.12.0
Expand All @@ -55,11 +56,11 @@ frozenlist>=1.8.0
fsspec>=2025.9.0
gast>=0.6.0
gcsfs>=2025.9.0
google-api-core>=2.28.0
google-api-core>=2.28.1
google-api-python-client>=2.185.0
google-auth-httplib2>=0.2.0
google-auth-oauthlib>=1.2.2
google-auth>=2.41.1
google-auth>=2.42.0
google-benchmark>=1.9.4
google-cloud-aiplatform>=1.122.0
google-cloud-appengine-logging>=1.7.0
Expand Down Expand Up @@ -195,7 +196,7 @@ python-dateutil>=2.9.0.post0
pytype>=2024.10.11
pytz>=2025.2
pyyaml>=6.0.3
qwix>=0.1.1
qwix>=0.1.2
regex>=2025.10.23
requests-oauthlib>=2.0.0
requests>=2.32.5
Expand All @@ -214,7 +215,7 @@ simplejson>=3.20.2
six>=1.17.0
sniffio>=1.3.1
sortedcontainers>=2.4.0
starlette>=0.48.0
starlette>=0.49.1
sympy>=1.14.0
tabulate>=0.9.0
tenacity>=9.1.2
Expand Down Expand Up @@ -248,7 +249,7 @@ tzdata>=2025.2
uritemplate>=4.2.0
urllib3>=2.5.0
uvicorn>=0.38.0
virtualenv>=20.35.3
virtualenv>=20.35.4
wadler-lindig>=0.1.7
websockets>=15.0.1
werkzeug>=3.1.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
absl-py>=2.3.1
aiofiles>=25.1.0
aiohappyeyeballs>=2.6.1
aiohttp>=3.13.1
aiohttp>=3.13.2
aiosignal>=1.4.0
annotated-doc>=0.0.3
annotated-types>=0.7.0
antlr4-python3-runtime>=4.9.3
anyio>=4.11.0
aqtp>=0.9.0
array-record>=0.8.1
array-record>=0.8.2
astroid>=4.0.1
astunparse>=1.6.3
attrs>=25.4.0
Expand Down Expand Up @@ -40,13 +40,14 @@ dill>=0.4.0
distlib>=0.4.0
dm-tree>=0.1.9
docstring-parser>=0.17.0
drjax>=0.1.4
editdistance>=0.8.1
einops>=0.8.1
einshape>=1.0
etils>=1.13.0
evaluate>=0.4.6
execnet>=2.1.1
fastapi>=0.120.0
fastapi>=0.120.2
filelock>=3.20.0
flatbuffers>=25.9.23
flax>=0.12.0
Expand All @@ -55,11 +56,11 @@ frozenlist>=1.8.0
fsspec>=2025.9.0
gast>=0.6.0
gcsfs>=2025.9.0
google-api-core>=2.27.0
google-api-core>=2.28.1
google-api-python-client>=2.185.0
google-auth-httplib2>=0.2.0
google-auth-oauthlib>=1.2.2
google-auth>=2.41.1
google-auth>=2.42.0
google-benchmark>=1.9.4
google-cloud-aiplatform>=1.122.0
google-cloud-appengine-logging>=1.7.0
Expand All @@ -85,7 +86,7 @@ gviz-api>=1.10.0
h11>=0.16.0
h5py>=3.15.1
hf-transfer>=0.1.9
hf-xet>=1.1.10 ; platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'
hf-xet>=1.2.0 ; platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'
httpcore>=1.0.9
httplib2>=0.31.0
httpx>=0.28.1
Expand Down Expand Up @@ -184,11 +185,11 @@ pyproject-hooks>=1.2.0
pytest-xdist>=3.8.0
pytest>=8.4.2
python-dateutil>=2.9.0.post0
python-dotenv>=1.1.1
python-dotenv>=1.2.1
pytype>=2024.10.11
pytz>=2025.2
pyyaml>=6.0.3
qwix>=0.1.1
qwix>=0.1.2
regex>=2025.10.23
requests-oauthlib>=2.0.0
requests>=2.32.5
Expand All @@ -207,7 +208,7 @@ simplejson>=3.20.2
six>=1.17.0
sniffio>=1.3.1
sortedcontainers>=2.4.0
starlette>=0.48.0
starlette>=0.49.1
sympy>=1.14.0
tabulate>=0.9.0
tenacity>=9.1.2
Expand Down Expand Up @@ -238,7 +239,7 @@ tzdata>=2025.2
uritemplate>=4.2.0
urllib3>=2.5.0
uvicorn>=0.38.0
virtualenv>=20.35.3
virtualenv>=20.35.4
wadler-lindig>=0.1.7
websockets>=15.0.1
werkzeug>=3.1.3
Expand Down
1 change: 1 addition & 0 deletions dependencies/requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ array-record
cloud-accelerator-diagnostics
cloud-tpu-diagnostics
datasets
drjax>=0.1.4
flax
gcsfs
google-api-python-client
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Requirements for Building the MaxText Docker Image
# These requirements are additional to the dependencies present in the JAX AI base image.
datasets @ https://github.com/huggingface/datasets/archive/6790e138c00b87a1ddc72184f89e7814cf784360.zip
drjax>=0.1.4
flax>=0.11.0
google-api-python-client
google-jetstream @ https://github.com/AI-Hypercomputer/JetStream/archive/29329e8e73820993f77cfc8efe34eb2a73f5de98.zip
Expand Down
11 changes: 10 additions & 1 deletion src/MaxText/configs/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ hardware: 'tpu' # Supported hardware types are 'tpu', 'gpu', 'gpu_multiprocess'

# Parallelism
shard_mode: "auto" # can be either auto or explicit
mesh_axes: ['data', 'stage', 'fsdp', 'fsdp_transpose', 'sequence', 'context', 'context_autoregressive', 'tensor', 'tensor_transpose', 'tensor_sequence', 'expert', 'autoregressive']
mesh_axes: ['diloco', 'data', 'stage', 'fsdp', 'fsdp_transpose', 'sequence', 'context', 'context_autoregressive', 'tensor', 'tensor_transpose', 'tensor_sequence', 'expert', 'autoregressive']
logical_axis_rules: [
['activation_batch', ['data', 'fsdp', 'fsdp_transpose', 'expert']],
['activation_batch_no_exp', ['data', 'fsdp', 'fsdp_transpose']],
Expand Down Expand Up @@ -435,6 +435,7 @@ logical_axis_rules: [
['paged_kv_head_dim_size', []],
['dense_layers', []],
['moe_layers', []],
['diloco', 'diloco'],
]
# Axes used for DCN must be earlier in this list than ICI, see (b/339009148) for details
data_sharding: [['data', 'stage', 'fsdp', 'fsdp_transpose', 'sequence', 'context', 'context_autoregressive', 'tensor', 'tensor_transpose', 'tensor_sequence', 'expert', 'autoregressive']]
Expand All @@ -447,6 +448,7 @@ sharding_tolerance: 0.02
# value to auto-shard based on available slices and devices.
# By default, product of the DCN axes should equal number of slices
# and product of the ICI axes should equal number of devices per slice.
dcn_diloco_parallelism: 1
dcn_data_parallelism: -1 # recommended DCN axis to be auto-sharded
dcn_fsdp_parallelism: 1
dcn_fsdp_transpose_parallelism: 1
Expand All @@ -459,6 +461,7 @@ dcn_tensor_sequence_parallelism: 1 # never recommended
dcn_pipeline_parallelism: 1
dcn_expert_parallelism: 1
dcn_autoregressive_parallelism: 1 # never recommended
ici_diloco_parallelism: 1
ici_data_parallelism: 1
ici_fsdp_parallelism: -1 # recommended ICI axis to be auto-sharded
ici_fsdp_transpose_parallelism: 1
Expand Down Expand Up @@ -644,6 +647,12 @@ enable_data_shuffling: True
data_shuffle_seed: 0
init_weights_seed: 0

# DiLoCo params.
enable_diloco: False
diloco_sync_period: 36
diloco_outer_lr: 0.3
diloco_outer_momentum: 0.9

# You may disable clipping by setting gradient_clipping_threshold to zero.
gradient_clipping_threshold: 1.0

Expand Down
Loading
Loading