Skip to content

Add a sharding-aware implementation of muon to Maxtext. - #4936

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_966768307
Open

Add a sharding-aware implementation of muon to Maxtext.#4936
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_966768307

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Add a sharding-aware implementation of muon to Maxtext.

This implementation uses all-to-all on specific layers to reduce overhead. It also removes the vmap over batch axes and replaces it with a generalized einsum.

Unlike most optax optimizers, this implementation requires a full sharding tree, in order to effectively use operations like jax.lax.with_sharding_constraint to constrain sharding of intermediate tensors.

This implementation uses all-to-all on specific layers to reduce overhead. It also removes the vmap over batch axes and replaces it with a generalized einsum.

Unlike most optax optimizers, this implementation requires a full sharding tree, in order to effectively use operations like jax.lax.with_sharding_constraint to constrain sharding of intermediate tensors.

PiperOrigin-RevId: 966768307
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant