-
Notifications
You must be signed in to change notification settings - Fork 963
[spmd_types] fix spmd->DTensor translation on partial mesh #3913
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
Changes from all commits
719414f
4372470
3af9941
de103b7
04f7f7f
bb9db82
6d09203
aaa0e7d
309ff01
7294b29
11964fe
156ed56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sounds related to https://github.com/pytorch/torchtitan/pull/3895/changes#r3574804150, so putting a hold. The previous invariance seems
This PR breaks it in two ways
Both sounds unsafe, especially (2) which sounds very hacky. Please think about safer solutions. Worst case I'm OK with (1), but redistribute on the local activations should be banned at boundary.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
tbh, I don't think spmd_types has restrictions on redistribution relations b/w inner/outer axes, e.g. you can do {DP: V, TP: I} -> {DP: I, TP: I}, spmd_types treats this as an allgather on dim 0. Since V in titan might be any kind of varying, I've banned V redistributions in this PR for now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question 1: why only guarding on index [0]?
question 2: in addition to spmd.V, how about spmd.P?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the "src/dst redistribution can only redistribute one axis" thing, so it's just indexing the one redistribution.
P src should be fine, I assume you mean P dst? fwiw we do support
convert(R/I/S -> P), with the zero-ing out, or zero-padding: https://github.com/meta-pytorch/spmd_types/blob/60705234a3ebb7a2ddd423cb3259f80985d270b2/spmd_types/_local.py#L912-L999we actually do support V->I/R (assumed as dim 0 allgather), but I'm banning as V could be interpreted as generally different values/shapes