NVIDIA / NVIDIA/cuvs

[FEA] Follow-up work on Cosine distance for IVF-Flat (Norm precomputation)

Open
#238 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

As pointed by Tamas in his review, we should consider whether it is more efficient to pre-computing the norms before the distance computation kernel.
https://github.com/rapidsai/cuvs/pull/179#pullrequestreview-2189437185

We should ask the question whether it is more efficient to compute the norms here or precompute them:

  • we could store norm of database vectors in the index
  • query norm is recalculated every time we process vector in the cluster. I expect that it would be better to use precalculated query norm, but we should confirm that by measurement. Please open an issue to track this, and improve this in a follow-up PR.

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 with the linked PR review and the IVF-Flat cosine distance computation kernel mentioned there. Benchmark computing norms during distance evaluation against precomputing database and query norms; done means recording the comparison and implementing the more efficient approach in a follow-up change.

Written by the indexing model from the issue text.

Assessment

Domain
performance, search
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.