NVIDIA / NVIDIA/raft

[FEA] pairwise distance primitives to output compressed format from scipy

Open
#650 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request inactive-30d inactive-90d
Dominant language
Cuda
Stars
1k
Forks
251
Avg merge
1d 8h
Merged PRs (30d)
31

Description

Scipy’s pdist() [1] function outputs a compressed form of pairwise distances that, for valid metrics, eliminates the symmetry and redundant self-loop distances.

The compressed output array is a deterministic size with deterministic indexing so it should be straightforward to implement this right in raft’s pairwise distances.

For now, we can use the current pairwise distance outputs (called the squareform format) for pdist in cupy and convert to the compressed form. It’ll use extra memory temporarily, though, so once the primitive is able to output this directly then we can update cupy to use it.

cc @teju85 @mdoijade

[1] https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.pdist.html#scipy.spatial.distance.pdist

Contributor guide

No contributing guide indexed for this repository

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 with the existing RAFT pairwise-distance primitive and compare its squareform output with scipy.spatial.distance.pdist indexing and size. Review how CuPy currently converts the output, then make the primitive produce the deterministic compressed representation directly and verify that the resulting distances and indexing match pdist.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.