镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[diskann-inmem] Remove allocation during prune - #1523

Open
Mark Hildebrand (hildebrandmw) wants to merge 1 commit into
mhildebr/inmem-regressionfrom
mhildebr/inmem-perf
Open

Mark Hildebrand (hildebrandmw) wants to merge 1 commit into
mhildebr/inmem-regressionfrom
mhildebr/inmem-perf

Conversation

@hildebrandmw

Copy link
Copy Markdown
Contributor

The PruneKey design for repr::Prune was based off of theoretically needing to support hybrid prune for PQ. Since it seems like we won't need to support that (or may still be able to by other means), we can simplify back to using slices and avoid allocating the hash table.

Increases in get_vector counts are due to robust_prune_list, which now goes through all the way to the Store instead of into the hash table. The total number of vector accesses does not necessarily increase: just the number that behave as if going through the store.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Documentation links to removed methods remain unresolved and fail the docs job under -D rustdoc::all.

1 open issue
What changed in this PR

Simplifies in-memory graph pruning by replacing buffered prune keys with borrowed slices, removing the hash-table and pointer-buffer allocations.

Changes:

  • Updates prune accessors and tests to retrieve and compare slices directly.
  • Moves vector-access counting to retrieval and refreshes integration baselines.
  • Centralizes the erased-serde dependency in the workspace.
File Description
diskann-inmem/​src/​store/​intrusive.rs Removes the unused byte-length helper.
diskann-inmem/​src/​repr/​test/​mod.rs Tests slice retrieval and distance evaluation.
diskann-inmem/​src/​repr/​mod.rs Replaces prune keys with a slice-based interface.
diskann-inmem/​src/​repr/​internal/​intrusive.rs Removes pointer buffering during pruning.
diskann-inmem/​src/​repr/​full.rs Adapts full-precision prune tests.
diskann-inmem/​src/​provider.rs Removes the key map and uses borrowed element references.
diskann-inmem/​src/​counters.rs Adds shared-reference vector-access counting.
diskann-inmem/​integration/​jsons/​integration-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​spherical/​two-bit-l2-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​spherical/​two-bit-ip-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​spherical/​two-bit-cosine-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​spherical/​one-bit-l2-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​spherical/​one-bit-ip-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​spherical/​one-bit-cosine-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​spherical/​four-bit-l2-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​spherical/​four-bit-ip-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​spherical/​four-bit-cosine-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​scalar/​two-bit-cosine-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​scalar/​one-bit-l2-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​scalar/​four-bit-ip-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​scalar/​eight-bit-l2-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​product/​l2-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​product/​ip-baseline.json Refreshes vector-access counts.
diskann-inmem/​integration/​jsons/​graph/​product/​cosine-baseline.json Refreshes vector-access counts.
diskann-benchmark-runner/​Cargo.toml Inherits erased-serde from the workspace.
Cargo.toml Declares the shared erased-serde dependency.

Review effort: Balanced

Comment on lines +256 to 257
/// Implementations may assume that `a` and `b` were produced by a call to
/// [`Self::prepare`] and are allowed to panic if this is violated. This property may

This branch has not been deployed

No deployments
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.

2 participants