Skip to content

Use cuda::hash for sparse distance hashing - #2741

Open
PointKernel wants to merge 7 commits into
NVIDIA:mainfrom
PointKernel:migrate-cuda-hash
Open

PointKernel wants to merge 7 commits into
NVIDIA:mainfrom
PointKernel:migrate-cuda-hash

Conversation

@PointKernel

Copy link
Copy Markdown
Member

This PR replaces cuco::murmurhash3_32 with cuda::hash in the sparse distance hash strategy, preserving the existing algorithm and seed.

Adds sparse InnerProduct and L1 cases that exercise the hash strategy, including reverse lookups.

Preserve MurmurHash3-32 hashing and cover the hash strategy with wide sparse inner-product and L1 distance inputs.
@copy-pr-bot

copy-pr-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@PointKernel
PointKernel marked this pull request as ready for review October 5, 2026 20:08
@PointKernel
PointKernel requested a review from a team as a code owner October 5, 2026 20:08
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

  • Source mode: Auto
  • Repository: NVIDIA/cuvs
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 0bc1867
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 1281d02e-78a2-44d1-aa15-dc153c1784ed
Commits

Reviewing files that changed from the base of the PR and between b2e82c1 and cfd9fa0.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Updated sparse-distance hashing for improved handling of large inputs.
  • Tests
    • Added coverage for inner-product and L1 distance calculations on large, sparse inputs, including cases with matching and non-matching indices.

The sparse COO SpMV probing scheme now uses CUDA’s MurmurHash3 hash. Two sparse-distance test cases cover inputs with 2²⁰ columns: one for InnerProduct and one for L1.

Changes: Sparse distance hashing

Layer / File(s) Summary
Hash strategy and wide-input tests
cpp/src/distance/detail/sparse/coo_spmv_strategies/hash_strategy.cuh, cpp/tests/distance/sparse_distance.cu
The probing scheme uses CUDA’s MurmurHash3 hash for value indices. InnerProduct and L1 tests add sparse inputs with 2²⁰ columns.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested reviewers: mythrocks, bdice

Merge Risk: Minimal · previous review 52cc8

This swaps the hash implementation used by sparse distance computation for an equivalent one and adds wide-column test coverage. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the sparse distance hash strategy now uses cuda::hash in place of cuco::murmurhash3_32. The raw summary confirms hash_strategy.cuh switches to cuda::hash with murmurha…
Description check Passed The description states the replacement of cuco::murmurhash3_32 with cuda::hash in the sparse distance hash strategy and the new sparse InnerProduct and L1 test cases. Both match the raw summary and ob…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the sparse distance hash strategy now uses cuda::hash in place of cuco::murmurhash3_32. The raw summary confirms hash_strategy.cuh switches to cuda::hash with murmurhash3_32, and the objectives state the same replacement.

Full details: Description check

Explanation

The description states the replacement of cuco::murmurhash3_32 with cuda::hash in the sparse distance hash strategy and the new sparse InnerProduct and L1 test cases. Both match the raw summary and objectives.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: NVIDIA/cuvs
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 471e6d7
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 25793d15-aacb-4015-91a9-185418394165
Commits

Reviewing files that changed from the base of the PR and between fda7906 and 52cc80f.

Files selected for processing: 1

  • cpp/tests/distance/sparse_distance.cu

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@aamijar aamijar added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Oct 8, 2026

@tfeher tfeher 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.

LGTM, thanks @PointKernel!

@github-project-automation github-project-automation Bot moved this from Needs Review to Approved in Unstructured Data Processing Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

5 participants