This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Add gather/scatter support 1D tensor #229
Merged
rapids-bot
merged 3 commits into
rapidsai:branch-24.12
from
chang-l:add_1D_gather_scatter
Nov 22, 2024
Merged
Add gather/scatter support 1D tensor #229
rapids-bot
merged 3 commits into
rapidsai:branch-24.12
from
chang-l:add_1D_gather_scatter
Nov 22, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for bring this up. Yes, scatter_op supposes to work with 1D wholememory tensor. I will try to find out why it does't work. |
This was referenced Nov 19, 2024
linhu-nv
approved these changes
Nov 19, 2024
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.
Since the scatter_test issue has been addressed, this PR looks good to me.
BradReesWork
added
improvement
Improves an existing functionality
non-breaking
Introduces a non-breaking change
labels
Nov 21, 2024
/okay to test |
… into add_1D_gather_scatter
/okay to test |
rapids-bot bot
pushed a commit
that referenced
this pull request
Nov 21, 2024
This is to address the issue found by: #229 Authors: - Chang Liu (https://github.com/chang-l) Approvers: - https://github.com/linhu-nv - Brad Rees (https://github.com/BradReesWork) URL: #235
/merge |
BradReesWork
approved these changes
Nov 22, 2024
rapids-bot bot
pushed a commit
to rapidsai/cugraph-gnn
that referenced
this pull request
Nov 22, 2024
Migrated from: rapidsai/wholegraph#229 This PR is to add gather/scatter support 1D tensor on python level, as WholeGraph should support basic indexing operations for both 1D (array) and 2D (matrix) wholememory tensors. Without this PR, if with 1D wholememory tensor, gather/scatter op does not work, e.g., https://github.com/rapidsai/wholegraph/blob/0efba33835d6e4e104b5d7101a91e0ea55a6ca53/python/pylibwholegraph/pylibwholegraph/torch/tensor.py#L89 To test, run ``` pytest --cache-clear --import-mode=append tests/wholegraph_torch/ops/test_wholegraph_gather_scatter.py -s ``` **Remaining issue:** On my local test with single GPU, the test can pass. For multiGPU setup, gather op works fine, but 1D scatter seems not working as it would crash at: https://github.com/rapidsai/wholegraph/blob/2e963b98aa6027c300d60e839010d3dd8ca422eb/python/pylibwholegraph/pylibwholegraph/tests/wholegraph_torch/ops/test_wholegraph_gather_scatter.py#L108 with incorrect scatter outputs: `Indices where allclose fails: tensor([0., 0., 0., ..., 0., 0., 0.]) tensor([ 1435., 1439., 1443., ..., 257703., 257707., 257711.]) ` This would work if this bugfix is merged: #73 cc. @linhu-nv Authors: - Chang Liu (https://github.com/chang-l) Approvers: - https://github.com/linhu-nv - Alex Barghi (https://github.com/alexbarghi-nv) URL: #74
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to add gather/scatter support 1D tensor on python level, as WholeGraph should support basic indexing operations for both 1D (array) and 2D (matrix) wholememory tensors. Without this PR, if with 1D wholememory tensor, gather/scatter op does not work, e.g.,
wholegraph/python/pylibwholegraph/pylibwholegraph/torch/tensor.py
Line 89 in 0efba33
To test, run
Remaining issue:
On my local test with single GPU, the test can pass.
For multiGPU setup, gather op works fine, but 1D scatter seems not working as it would crash at:
wholegraph/python/pylibwholegraph/pylibwholegraph/tests/wholegraph_torch/ops/test_wholegraph_gather_scatter.py
Line 108 in 2e963b9
Indices where allclose fails: tensor([0., 0., 0., ..., 0., 0., 0.]) tensor([ 1435., 1439., 1443., ..., 257703., 257707., 257711.])
@linhu-nv Can you please take a look? Does scatter_op suppose to work with 1D wholememory tensor?