Skip to content

Add typed-channel PPR sampler#709

Open
mkolodner-sc wants to merge 1 commit into
mkolodner-sc/pr701-ppr-event-loopfrom
mkolodner-sc/typed-channel-ppr-sampler
Open

Add typed-channel PPR sampler#709
mkolodner-sc wants to merge 1 commit into
mkolodner-sc/pr701-ppr-event-loopfrom
mkolodner-sc/typed-channel-ppr-sampler

Conversation

@mkolodner-sc

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

Copy link
Copy Markdown
Collaborator

Summary

Adds typed-channel support to the distributed PPR sampler.

This is the typed-PPR enablement PR in the split stack. It builds on the cleanup and event-loop/GIL changes from #707 and #708, then adds the typed-channel-specific configuration, execution, C++ merge/extraction path, and tests.

Motivation

For heterogeneous graphs, edge types often carry meaningful relation information. A single collapsed PPR traversal can tell us that a neighbor is relevant, but it loses which typed relation paths contributed to that relevance.

Typed-channel PPR preserves that structure by running PPR over configured edge-type traversal channels and emitting channel-aware edge attributes. Downstream models can then consume:

  • the best calibrated PPR score
  • per-channel calibrated scores
  • per-channel presence indicators

What Changed

  • Adds typed_channel_quotas to PPRSamplerOptions.

    • Keys can be a single canonical edge type, e.g. ("user", "views", "item").
    • Keys can also be a tuple of canonical edge types to define one grouped traversal channel.
    • Values are positive candidate quotas for that channel.
  • Adds typed-channel validation and traversal-map construction.

    • Rejects invalid channel keys and non-positive quotas.
    • Rejects edge types that are not traversable by PPR.
    • Restricts typed PPR to heterogeneous sampling.
    • Allows quotas to sum above max_ppr_nodes so sparse channels can still help fill the final sequence.
  • Adds per-channel PPR execution.

    • Builds one PPRForwardPush state per typed channel.
    • Each state traverses only the edge types allowed by that channel.
    • Unions active channel frontiers in C++ so shared one-hop fetches are issued once per iteration.
  • Adds typed PPR C++ extraction.

    • Applies channel quotas.
    • Deduplicates candidates across channels.
    • Handles residual top-up in the typed path.
    • Emits multi-column edge attributes:
      [best_score, channel_scores..., channel_presence_bits...].
  • Wires typed_channel_quotas through sampler construction.

Tests

Added focused coverage for:

  • typed-channel quota parsing and validation
  • traversal-map construction for typed channels
  • C++ typed frontier drain and fetch-budget behavior
  • C++ typed extraction, cross-channel deduplication, and residual top-up behavior
  • disabling residual top-up for typed PPR

@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/typed-channel-ppr-sampler branch from 9724f59 to 81812c7 Compare July 15, 2026 20:02
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/pr701-ppr-event-loop branch from fc410ab to 2b85456 Compare July 15, 2026 20:02
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/typed-channel-ppr-sampler branch from 81812c7 to 41a65fd Compare July 15, 2026 21:24
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/pr701-ppr-event-loop branch from 2b85456 to ecb394c Compare July 15, 2026 21:24
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/typed-channel-ppr-sampler branch from 41a65fd to b826832 Compare July 15, 2026 21:40
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/pr701-ppr-event-loop branch 2 times, most recently from 0047b2f to 016517b Compare July 15, 2026 22:49
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/typed-channel-ppr-sampler branch 2 times, most recently from f6fc7a8 to 65d131c Compare July 15, 2026 23:01
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/pr701-ppr-event-loop branch from 016517b to 60a0cea Compare July 15, 2026 23:01
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/typed-channel-ppr-sampler branch from 65d131c to 44307b8 Compare July 15, 2026 23:04
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/pr701-ppr-event-loop branch 2 times, most recently from ff2d3ea to d0f9cea Compare July 16, 2026 18:46
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/typed-channel-ppr-sampler branch 2 times, most recently from 4d70c04 to a3751bd Compare July 16, 2026 19:15
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/pr701-ppr-event-loop branch 2 times, most recently from 33c8dde to 1b0ea2a Compare July 16, 2026 19:21
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/typed-channel-ppr-sampler branch from a3751bd to 6fbb8c9 Compare July 16, 2026 19:21
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/typed-channel-ppr-sampler branch from 6fbb8c9 to ce171bb Compare July 16, 2026 20:01
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/pr701-ppr-event-loop branch from 1b0ea2a to ed7387c Compare July 16, 2026 20:01
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