NVIDIA / NVIDIA/cuvs

[FEA] Pairiwse distances to support computing triangular and symmetrizing

Open
#1,775 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
Cuda
Stars
854
Forks
236
Avg merge
3d 3h
Merged PRs (30d)
62

Description

Currently, our pairwise distsnces computaiton exhaustively materializes the full n^2 matrix with n^2 complexity. But for symmetric distances, we can skip half the computations, taking the overall complexity down to n^2/2. We are finding users are seeing exactly 2x higher runtime than expected.

Scipy also has a dedicated option for being able to do this, and this feature will be useful for cupy.distance (which uses cuVS).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the pairwise distances computation entry point and review how it currently materializes the full matrix. Compare the requested behavior with SciPy's triangular and symmetrizing option, then verify that symmetric inputs avoid redundant computations while producing the expected distance matrix for cupy.distance users.

Written by the indexing model from the issue text.

Assessment

Domain
machine-learning, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.