Skip to content

[PoC] Enable flexible different layout for same mesh via a util function #1550

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fduwjj
Copy link
Contributor

@fduwjj fduwjj commented Aug 11, 2025

We have seen use cases for more flexible configurations for N-D device mesh especially with MoE and EP. So now we want to implement a util function to support this use case.

For now since we only leverage _flatten, so what we can do is to find a way to unflatten to a mesh config which all mesh config can be unflattened into. Then we do flatten on top of that. This might not be very efficient but this is the way we can temporarily unblock users while still figuring out a proper final UX from DeviceMesh side.

For now this PR is just for PoC not aim at landing. If we do want to merge this change, I will further polish it to make it mergable into Torchtitan.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant