-
Notifications
You must be signed in to change notification settings - Fork 205
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
[BE] replace the extra DeviceMesh _flatten with mesh access #667
Conversation
… with mesh access" **Summary** pytorch/pytorch#138945 fixes DeviceMesh access on flattened mesh which are constructed from more than 2 meshes. Refer to the fix PR for details if interested. In #592 we avoided this issue by calling `_flatten` instead of direct accessing the flattened mesh. We want to turn back to mesh access which is more straightforward since the fix has been merged in PyTorch. [ghstack-poisoned]
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * __->__ #666 **Summary** pytorch/pytorch#138945 fixes DeviceMesh access on flattened mesh which are constructed from more than 2 meshes. Refer to the fix PR for details if interested. In #592 we avoided this issue by calling `_flatten` instead of direct accessing the flattened mesh. We want to turn back to mesh access which is more straightforward since the fix has been merged in PyTorch.
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.
stamped as it was approved in another PR.
# note: this is a workaround of the above logic for old pytorch version | ||
# where https://github.com/pytorch/pytorch/pull/138945 is not included | ||
# throw a warning to encourage users to upgrade to a newer pytorch version | ||
check_if_feature_in_pytorch( |
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.
@fegin
Since we are already suggesting user to use latest PyTorch nightly, I wonder how necessary it is to include such messages, as multiple features would depend on non-stable release. E.g. for PP, we constantly see new features, without such try-catches.
Not saying this is not good, but there seems to be a trade-off / sacrifice for dev velocity and simplicity.
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.
I'm okay to remove it. Or we can periodically cleanup (like weekly). In general, this is not just for the end users but also for developers like us who may not up the local PyTorch reguarly.
Stack from ghstack (oldest at bottom):
Note: This PR is a reland of #666 where the PR was mistakenly merged into a wrong branch.
Summary
pytorch/pytorch#138945 fixes DeviceMesh access on flattened mesh which are constructed from more than 2 meshes. Refer to the fix PR for details if interested.
In #592 we avoided this issue by calling
_flatten
instead of direct accessing the flattened mesh. We want to turn back to mesh access which is more straightforward since the fix has been merged in PyTorch.