Skip to content
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

Faster topk implementation for large enough graphs #6123

Merged
merged 5 commits into from
Dec 3, 2022

Conversation

mova
Copy link
Contributor

@mova mova commented Dec 2, 2022

Topk needs quite some time to construct the mask in my application.
I noticed I can avoid the loop, if all of the graphs in the batch are large than ratio.

@codecov
Copy link

codecov bot commented Dec 2, 2022

Codecov Report

Merging #6123 (a45a193) into master (11c8cbd) will decrease coverage by 1.87%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #6123      +/-   ##
==========================================
- Coverage   86.21%   84.34%   -1.88%     
==========================================
  Files         363      363              
  Lines       20490    20488       -2     
==========================================
- Hits        17666    17280     -386     
- Misses       2824     3208     +384     
Impacted Files Coverage Δ
torch_geometric/nn/pool/topk_pool.py 100.00% <100.00%> (ø)
torch_geometric/nn/models/dimenet_utils.py 0.00% <0.00%> (-75.52%) ⬇️
torch_geometric/nn/models/dimenet.py 14.90% <0.00%> (-52.76%) ⬇️
torch_geometric/profile/profile.py 36.27% <0.00%> (-26.48%) ⬇️
torch_geometric/nn/conv/utils/typing.py 81.25% <0.00%> (-17.50%) ⬇️
torch_geometric/nn/pool/asap.py 92.10% <0.00%> (-7.90%) ⬇️
torch_geometric/nn/inits.py 67.85% <0.00%> (-7.15%) ⬇️
torch_geometric/nn/dense/linear.py 87.40% <0.00%> (-5.93%) ⬇️
torch_geometric/transforms/add_self_loops.py 94.44% <0.00%> (-5.56%) ⬇️
torch_geometric/nn/models/attentive_fp.py 95.83% <0.00%> (-4.17%) ⬇️
... and 13 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rusty1s rusty1s changed the title faster topk for large enough graphs Faster top_k implementation for large enough graphs Dec 3, 2022
@rusty1s rusty1s changed the title Faster top_k implementation for large enough graphs Faster topk implementation for large enough graphs Dec 3, 2022
Copy link
Member

@rusty1s rusty1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you!

@rusty1s rusty1s merged commit adf3bad into pyg-team:master Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants