Skip to content

Conversation

@zaristei
Copy link
Contributor

The current implementation of SamplerOutput returns local indices of node ids in the node list for the row,col, batch, orig_row, and orig_col fields. This leads to some confusion for using the edges/seed nodes retrieved from the sampler. This PR adds some helper methods that will derive the global indices for these fields given the information already stored within the SamplerOutput.
Unittests have been also written for both homogeneous and heterogeneous outputs.

Copy link
Contributor

@Kh4L Kh4L left a comment

Choose a reason for hiding this comment

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

lgtm!

@codecov
Copy link

codecov bot commented Apr 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.85%. Comparing base (c211214) to head (37c97f5).
⚠️ Report is 137 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10200      +/-   ##
==========================================
- Coverage   86.11%   85.85%   -0.26%     
==========================================
  Files         496      501       +5     
  Lines       33655    34507     +852     
==========================================
+ Hits        28981    29625     +644     
- Misses       4674     4882     +208     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@puririshi98 puririshi98 left a comment

Choose a reason for hiding this comment

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

LGTM but ill let @akihironitta or @rusty1s review and merge this one

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.

What's the purpose?

@zaristei
Copy link
Contributor Author

The purpose of these changes is to make it easier for users of SamplerOutput to access the global row/col ids, as well as global seed node ids from the sampler. Although the docstring indicates that the row and col fields are indices of nodes, it's not immediately obvious from that documentation that one can get the global indices by indexing into the nodes list, or that the same can be done for to get seed nodes from batch, for instance.

@zaristei zaristei force-pushed the zaristei/sample_output_global_index branch from ab5ae61 to 3b8b10e Compare April 22, 2025 00:16
@zaristei zaristei force-pushed the zaristei/sample_output_global_index branch from 2df71ab to e6cbdf2 Compare April 22, 2025 19:26
Copy link
Contributor

@puririshi98 puririshi98 left a comment

Choose a reason for hiding this comment

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

merging as per discussions with @rusty1s , these are heavily tested through NVIDIA already

@puririshi98 puririshi98 merged commit ba8a393 into pyg-team:master Aug 22, 2025
19 checks passed
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.

4 participants