-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[DTensor] check DeviceMesh ranks contiguity #91802
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
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/91802
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit e2b6a26: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
[ghstack-poisoned]
wanchaol
left a comment
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.
same comment as the previous PR, can we do this check only when we are creating the world_pg?
[ghstack-poisoned]
wanchaol
left a comment
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.
lgtm, one nit
| # mesh must be contiguous (i.e. from 0 to N-1) | ||
| if 2 * unique_mesh_values.sum().item() != world_size * (world_size - 1): | ||
| raise RuntimeError( | ||
| f"DeviceMesh is expected to be contiguous, but found {self.mesh.tolist()}" |
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.
nit: it might not be contiguous as always, i.e. [[0, 2], [1, 3]] Maybe change the error msg to sth like:
DeviceMesh should have all ranks of the world
[ghstack-poisoned]
[ghstack-poisoned]
Stack from ghstack (oldest at bottom):