Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix multi-seed ego_graph offset handling#5584

Open
sauravsingla wants to merge 8 commits into
rapidsai:mainrapidsai/cugraph:mainfrom
sauravsingla:fix/ego-graph-multi-seed-offsetssauravsingla/cugraph:fix/ego-graph-multi-seed-offsetsCopy head branch name to clipboard
Open

Fix multi-seed ego_graph offset handling#5584
sauravsingla wants to merge 8 commits into
rapidsai:mainrapidsai/cugraph:mainfrom
sauravsingla:fix/ego-graph-multi-seed-offsetssauravsingla/cugraph:fix/ego-graph-multi-seed-offsetsCopy head branch name to clipboard

Conversation

@sauravsingla

Copy link
Copy Markdown

Summary

This draft addresses #4191.

The lower-level pylibcugraph.ego_graph API already returns subgraph offsets for
multiple seed vertices, but the high-level Python wrapper currently discards
them.

This proposal:

  • preserves existing single-seed behavior;
  • prevents ambiguous composite output for multiple seeds;
  • exposes offsets through return_offsets=True;
  • adds regression tests covering multi-seed behavior;
  • adds weighted graph and renumbered graph coverage.

Testing

Completed without GPU:

  • Python syntax validation
  • py_compile
  • mocked wrapper control-flow tests
  • input validation tests

GPU validation is still required for:

  • cuDF integration
  • pylibcugraph execution
  • weighted graph behavior
  • renumbered graph behavior
  • SG/MG CI

This is opened as a draft to discuss the preferred public API before finalizing the implementation.

@copy-pr-bot

copy-pr-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@sauravsingla
sauravsingla marked this pull request as ready for review July 11, 2026 06:14
@sauravsingla
sauravsingla requested a review from a team as a code owner July 11, 2026 06:14
@sauravsingla sauravsingla reopened this Jul 11, 2026
@sauravsingla

Copy link
Copy Markdown
Author

This PR was closed accidentally while I was trying to convert it to draft. The branch and commits are still available.

Could a maintainer please reopen this PR, or advise whether I should open a new draft PR from the same branch?

The change addresses #4191 and is intended for API discussion and GPU CI validation before being marked ready for review.

@alexbarghi-nv alexbarghi-nv added bug Something isn't working non-breaking Non-breaking change improvement Improvement / enhancement to an existing function and removed bug Something isn't working labels Jul 13, 2026
@alexbarghi-nv

Copy link
Copy Markdown
Member

/ok to test

@copy-pr-bot

copy-pr-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

/ok to test

@alexbarghi-nv, there was an error processing your request: E1

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/

@alexbarghi-nv

Copy link
Copy Markdown
Member

/ok to test 62e035b

@sauravsingla

Copy link
Copy Markdown
Author

Hi @alexbarghi-nv, just checking whether the CI run for commit 62e035b needs to be retriggered. Please let me know if anything is needed from my side.

@ChuckHastings

Copy link
Copy Markdown
Collaborator

Always excited for external contributions, thanks!

There are format issues with your PR that should be fixed, you should be able to follow the links to see them. I think if you enable pre-commit hooks you should be able to let the tools do much of the work for you.

@sauravsingla

Copy link
Copy Markdown
Author

Thank you for the guidance. I have applied the repository Python formatting fixes in the latest commit b2454a1. Please let me know if any further changes are needed.

@ChuckHastings

Copy link
Copy Markdown
Collaborator

/okay to test b2454a1

@ChuckHastings

Copy link
Copy Markdown
Collaborator

/okay to test c26adda

@sauravsingla

Copy link
Copy Markdown
Author

Hi, thanks for the review. I addressed the requested changes and updated the PR. The style checks and build jobs are now passing. I’m currently investigating the remaining Python 3.12 CI failure (conda-python-tests / 13.0.3, 3.12, amd64, ubuntu24.04) and will update the PR once I identify the root cause. Please let me know if you notice anything specific that I should look at.

@sauravsingla

Copy link
Copy Markdown
Author

I reviewed the Python 3.12 CI logs. The remaining failure is in tests/utils/test_dataset.py::test_benchmarking_datasets[dataset4] and is caused by urllib.error.URLError: No address associated with hostname. This appears to be an external dataset download/DNS issue and does not seem related to the changes in this PR. All other tests in the job passed.

@ChuckHastings
ChuckHastings requested a review from rlratzel July 14, 2026 20:51
@sauravsingla

Copy link
Copy Markdown
Author

Hi @rlratzel, just checking in on the review when convenient. Please let me know if any additional information or changes are needed from my side.

@rlratzel

rlratzel commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution @sauravsingla . I think the PR changes look technically fine, but I'm wondering if having a completely different return type is expected when return_offsets=True - I think a user of this API would be surprised if a Graph object is not returned.

That said, I'm not opposed to this change, I just want to make sure these aspects have been discussed. Also, would simply using pylibcugraph directly for your use case be an option instead?

@sauravsingla

Copy link
Copy Markdown
Author

Thanks for the thoughtful review!

For my own use case, calling pylibcugraph directly is certainly an option. My motivation for this PR was broader: to make the same capability available through the high-level cugraph API so users don’t need to drop down to the lower-level interface to work with multi-seed ego graphs.

Regarding the return type, I agree that returning something other than a Graph when return_offsets=True could be surprising. I chose (edge_dataframe, offsets) because the offsets returned by pylibcugraph directly delimit contiguous ranges in the returned edge output, so that representation preserves the meaning of the offsets naturally.

My intention wasn’t to introduce a different API pattern, but to expose the existing functionality while preserving the per-seed boundaries. If maintaining a Graph return type is the preferred direction for the public API, I’m happy to revise the implementation to align with the project’s conventions. I’d appreciate your guidance on the API shape you think would best fit cuGraph.

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

Labels

improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.