-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Fix ProcessGroupGloo allgather for tensors with shared storage #21490
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
|
|
|
I suppose this is not specific to tensors with shared storage but to all views more generally, right? |
I think it applies to all cases where |
facebook-github-bot
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.
@mrshenli has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
pietern
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.
Can we remove getDataPointer in this PR or is it still used somewhere?
@pietern I found that |
facebook-github-bot
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.
@mrshenli has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Fix #20421
ProcessGroupGlooonly requires input/output tensors to be contiguous. Contiguous tensors might not start from the beginning of the underlying storage, e.g.,chunk(..., dim=0)[1]. The current implementation passestensor.storage().data()ptr to gloo buffer. This leads to wrong results if the tensor has a non-zero storage offset.The proposed solution is to use
tensor.data_ptr()instead. Let's see if this breaks any tests.cc @qijianan777