Skip to content

Add directed=False (induced subgraph) support for homogeneous CPU neighbor sampling#690

Open
joeykaji wants to merge 6 commits into
pyg-team:masterfrom
joeykaji:feat/directed-graphs-cpu
Open

Add directed=False (induced subgraph) support for homogeneous CPU neighbor sampling#690
joeykaji wants to merge 6 commits into
pyg-team:masterfrom
joeykaji:feat/directed-graphs-cpu

Conversation

@joeykaji

Copy link
Copy Markdown

Addresses #23

Feature Summary

  • Implements directed=False (induced subgraph) neighbor sampling for homogeneous graphs on CPU
  • Adds three test cases covering: induced subgraph correctness, edge-count difference between directed=True/directed=False, and rejection of unsupported flag combinations

Notes

  • Does not yet support disjoint=True or distributed=True in combination with directed=False, but both are explicitly guarded against via TORCH_CHECK
  • Heterogeneous graphs are not covered by this PR (still rejects directed=False, unchanged from before)
  • For tests, I tried mimicking the other tests on that I saw in test_neighbor.cpp

Happy to adjust based on feedback — this is my first contribution to pyg-lib, so let me know if I've missed any conventions.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.66%. Comparing base (bdee3ae) to head (cf57121).
⚠️ Report is 207 commits behind head on master.

❌ Your project check has failed because the head coverage (44.66%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #690       +/-   ##
===========================================
- Coverage   70.13%   44.66%   -25.48%     
===========================================
  Files          37       82       +45     
  Lines        1671     4254     +2583     
  Branches        0      414      +414     
===========================================
+ Hits         1172     1900      +728     
- Misses        499     2352     +1853     
- Partials        0        2        +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant