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

Edge-based temporal sampling #280

Merged
merged 15 commits into from
Nov 14, 2023
Merged

Edge-based temporal sampling #280

merged 15 commits into from
Nov 14, 2023

Conversation

pmpalang
Copy link
Contributor

This PR is to enable edge-based temporal sampling for both homogeneous and heterogeneous graphs.
Thanks,
Poovaiah

@rusty1s rusty1s enabled auto-merge (squash) November 14, 2023 10:51
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (f78959a) 85.74% compared to head (6581564) 85.65%.
Report is 1 commits behind head on master.

Files Patch % Lines
pyg_lib/csrc/sampler/cpu/neighbor_kernel.cpp 78.94% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #280      +/-   ##
==========================================
- Coverage   85.74%   85.65%   -0.10%     
==========================================
  Files          32       32              
  Lines        1087     1115      +28     
==========================================
+ Hits          932      955      +23     
- Misses        155      160       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rusty1s rusty1s merged commit 2b9af1c into pyg-team:master Nov 14, 2023
10 checks passed
@@ -12,6 +12,8 @@
#include "pyg_lib/csrc/utils/cpu/convert.h"
#include "pyg_lib/csrc/utils/types.h"

#include <iostream>
Copy link
Contributor

Choose a reason for hiding this comment

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

to be removed?

pyg::sampler::Mapper<node_t, scalar_t>& dst_mapper,
pyg::random::RandintEngine<scalar_t>& generator,
std::vector<node_t>& out_global_dst_nodes) {
void edge_temporal_sample(const node_t global_src_node,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep the order of argument same as in the temporal_sample function:
const int64_t count, const temporal_t seed_time, const temporal_t* edge_time,

if ((row_end - row_start == 0) || (count == 0))
return;
// Find new `row_end` such that all neighbors fulfill temporal constraints:
std::vector<int> v(row_end - row_start);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
std::vector<int> v(row_end - row_start);
std::vector<scalar_t> v(row_end - row_start);

@rusty1s
Copy link
Member

rusty1s commented Nov 14, 2023

@kgajdamo Thanks for the review. I think all of your comments are already resolved in latest commit :)

@kgajdamo
Copy link
Contributor

@kgajdamo Thanks for the review. I think all of your comments are already resolved in latest commit :)

I came back to this review after a while and didn't notice it was merged and left the comments 🥲

rusty1s added a commit to pyg-team/pytorch_geometric that referenced this pull request Nov 15, 2023
This PR is to enable the edge-based temporal sampling for
NeighborSampler. This PR covers both homogeneous and heterogeneous
cases. The associated PYG-LIB PR is
pyg-team/pyg-lib#280 .

Thanks,
Poovaiah

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Akihiro Nitta <[email protected]>
Co-authored-by: Matthias Fey <[email protected]>
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.

3 participants