Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stage first axes mesh #886

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions MaxText/configs/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ jax_cache_dir: "~/jax_cache"
hardware: 'tpu' # Supported hardware types are 'tpu', 'gpu', 'gpu_multiprocess' and 'cpu'

# Parallelism
mesh_axes: ['data', 'stage', 'fsdp', 'fsdp_transpose', 'sequence', 'tensor', 'expert', 'autoregressive']
mesh_axes: ['stage', 'data', 'fsdp', 'fsdp_transpose', 'sequence', 'tensor', 'expert', 'autoregressive']
logical_axis_rules: [
['activation_batch', ['data', 'fsdp', 'fsdp_transpose', 'expert']],
['activation_batch_no_exp', ['data', 'fsdp', 'fsdp_transpose']],
Expand Down Expand Up @@ -221,7 +221,7 @@ logical_axis_rules: [
['exp', 'expert'],
]
# 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', 'tensor', 'expert', 'autoregressive']]
data_sharding: [['stage', 'data', 'fsdp', 'fsdp_transpose', 'sequence', 'tensor', 'expert', 'autoregressive']]

# One axis for each parallelism type may hold a placeholder (-1)
# value to auto-shard based on available slices and devices.
Expand Down
4 changes: 2 additions & 2 deletions MaxText/max_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ def create_device_mesh(config, devices=None):
multi_slice_env = num_slices > 1

dcn_parallelism = [
config.dcn_data_parallelism,
config.dcn_pipeline_parallelism,
config.dcn_data_parallelism,
config.dcn_fsdp_parallelism,
config.dcn_fsdp_transpose_parallelism,
config.dcn_sequence_parallelism,
Expand All @@ -395,8 +395,8 @@ def create_device_mesh(config, devices=None):
config.dcn_autoregressive_parallelism,
]
ici_parallelism = [
config.ici_data_parallelism,
config.ici_pipeline_parallelism,
config.ici_data_parallelism,
config.ici_fsdp_parallelism,
config.ici_fsdp_transpose_parallelism,
config.ici_sequence_parallelism,
Expand Down
Loading