Skip to content

Add residual top-up extraction to PPR forward push#702

Merged
mkolodner-sc merged 15 commits into
mainfrom
mkolodner/ppr-residual-topup
Jul 15, 2026
Merged

Add residual top-up extraction to PPR forward push#702
mkolodner-sc merged 15 commits into
mainfrom
mkolodner/ppr-residual-topup

Conversation

@mkolodner-sc

@mkolodner-sc mkolodner-sc commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reasoning for Change

Previously, the PPR forward push would return all neighbors re-enqueued during forward push. This is how the base PPR forward push algorithm works, but results in small sequences volumes that could be more meaningful if they were larger. Decreasing epsilon previously provided a knob to get these larger sequence lengths, but came at heavy throughput costs. Instead of relying on epsilon for this behavior, this change exposes a way to allow us to "top-off" the existing PPR sequence with nodes that were found during forward-push but didn't meet the threshold for re-enqueue. The logic here is that these are the nodes that would have been re-enqueued next by decreasing epsilon, so this gives us a clean way to get these nodes and their ppr scores without having to pay heavy throughput costs.

On internal benchmarking, we have seen sequences toped off this way perform as good as the sequences with lower epsilon at a much faster runtime.

Changes Summary

Adds an configurable but opt-in residual top-up extraction API to PPRForwardPush.

The existing extractTopK behavior is unchanged. The new API returns the normal top-k finalized PPR nodes first, then appends additional candidates from residual mass that was discovered during forward push but did not necessarily cross the requeue threshold. This gives downstream samplers a way to fill more sequence slots without issuing extra neighbor fetches.

Changes

  • Adds extractTopKWithResidualTopUp(maxPprNodes, maxResidualNodes) in C++.
  • Exposes the new method through pybind and the Python stub.
  • Scores residual top-up candidates on the same scale as finalized candidates via ppr_score + residual.

Validation

  • Ran focused ruff check on the updated Python stub.
  • Full uv run validation in the temp worktree was blocked by local environment setup because gigl-core attempted to rebuild and could not find Torch CMake config.

@mkolodner-sc
mkolodner-sc force-pushed the mkolodner/ppr-residual-topup branch from 98d95fa to a33f080 Compare July 13, 2026 18:35
@mkolodner-sc
mkolodner-sc changed the base branch from main to mkolodner/ppr-neighbor-cache-reuse July 13, 2026 18:36
@mkolodner-sc

Copy link
Copy Markdown
Collaborator Author

/unit_test

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

GiGL Automation

@ 19:37:48UTC : 🔄 C++ Unit Test started.

@ 19:39:40UTC : ✅ Workflow completed successfully.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

GiGL Automation

@ 19:37:49UTC : 🔄 Python Unit Test started.

@ 19:42:19UTC : ❌ Workflow failed.
Please check the logs for more details.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

GiGL Automation

@ 19:38:02UTC : 🔄 Scala Unit Test started.

@ 19:49:31UTC : ✅ Workflow completed successfully.

@mkolodner-sc

Copy link
Copy Markdown
Collaborator Author

/unit_test

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

GiGL Automation

@ 19:58:29UTC : 🔄 Scala Unit Test started.

@ 20:06:43UTC : ✅ Workflow completed successfully.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

GiGL Automation

@ 19:58:29UTC : 🔄 C++ Unit Test started.

@ 20:00:20UTC : ✅ Workflow completed successfully.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

GiGL Automation

@ 19:58:30UTC : 🔄 Python Unit Test started.

@ 21:08:08UTC : ✅ Workflow completed successfully.

@kmontemayor2-sc kmontemayor2-sc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Matt! In generally I think we have a good amount of algorithmic changes here and it'd be nice if we could comment what / why the new code is doing.

Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl/distributed/dist_ppr_sampler.py Outdated
Comment thread tests/unit/distributed/dist_ppr_sampler_test.py Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp
Comment thread gigl/distributed/dist_ppr_sampler.py Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
@mkolodner-sc

Copy link
Copy Markdown
Collaborator Author

Thanks Matt! In generally I think we have a good amount of algorithmic changes here and it'd be nice if we could comment what / why the new code is doing.

@kmontemayor2-sc Done, added more context in the PR description and in the PR for the reasoning/change made here

Base automatically changed from mkolodner/ppr-neighbor-cache-reuse to main July 13, 2026 23:03
Comment thread gigl/distributed/dist_ppr_sampler.py Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl/distributed/dist_ppr_sampler.py
Comment thread gigl/distributed/dist_ppr_sampler.py Outdated
Comment thread gigl/distributed/sampler_options.py
Comment thread tests/unit/distributed/dist_ppr_sampler_test.py Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated

@kmontemayor2-sc kmontemayor2-sc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi Matt, once we resolve the sorting questions this lgtm! thanks for the iterations here :)

Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated

@kmontemayor2-sc kmontemayor2-sc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Matt!

@mkolodner-sc
mkolodner-sc marked this pull request as ready for review July 15, 2026 17:41
@mkolodner-sc
mkolodner-sc added this pull request to the merge queue Jul 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 15, 2026
@mkolodner-sc
mkolodner-sc added this pull request to the merge queue Jul 15, 2026
@mkolodner-sc
mkolodner-sc removed this pull request from the merge queue due to a manual request Jul 15, 2026
@mkolodner-sc
mkolodner-sc added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit e77918e Jul 15, 2026
7 checks passed
@mkolodner-sc
mkolodner-sc deleted the mkolodner/ppr-residual-topup branch July 15, 2026 23:54
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.

3 participants