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
MinCut pooling for sparse adjacency matrix #9243
base: master
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
…eometric into sparse-mincut-pool
for more information, see https://pre-commit.ci
…eometric into sparse-mincut-pool
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #9243 +/- ##
==========================================
- Coverage 85.22% 78.83% -6.40%
==========================================
Files 459 471 +12
Lines 29951 30318 +367
==========================================
- Hits 25526 23901 -1625
- Misses 4425 6417 +1992 ☔ View full report in Codecov by Sentry. |
…eometric into sparse-mincut-pool
…eometric into sparse-mincut-pool
Motivation
The current
nn.dense.mincut_pool
requires the input adjacency matrix to be a dense matrix. This requirement does not scale to large graphsWhat
This PR considers a sparse counterpart of
nn.dense.mincut_pool
, which takes in sparse adjacency matrix as input.Preliminary experiments (not shown here) indicate that the sparse version runs much faster with smaller memory footprint.
Technical issues / questions
NotImplementedError: Could not run 'aten::sparse_dim' with arguments from the 'CPU' backend.
I have little clue of how to fix it.Remarks on 3D sparse-dense tensor multiplication
Currently, multiplying a batched 3D dense tensor (e.g., the node-level feature matrix) with a batched 3D sparse tensor (e.g., the adjacency matrix) is implemented by looping through the batches and performing 2D matrix multiplication (detailed in the
_bmm
function in this PR).We can use a more efficient way to achieve the same goal:
Batch.from_data_list
),Other remark
This PR is WIP. It is my first PR for this project, appreciate any feedback 🙏🙏🙏