NVIDIA / NVIDIA/cuvs

[BUG] Improve python tests of ANN algorithm for `int8`/`uint8` and `inner_product`

Open
#817 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

ANN algorithm with metric=inner_product and dtype=int8 or uint8 are not tested properly.
In pytest the dataset generated is in (u)int8, then it gets normalized and transformed in float.
So when testing those dtypes the pytests are skipped (cagra) or they end up testing float inputs (ivf_flat/pq).

The inner_product is compared with sklearn cosine since they don't have IP distance, but the queries are also not normalized.

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 pytest coverage for the cagra, ivf_flat, and pq ANN algorithms. Check how datasets and queries are normalized or converted before testing int8/uint8 inputs, and review the sklearn cosine comparison for inner_product. Done means these tests exercise the intended integer inputs and correctly compare normalized queries.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, scikit-learn
Domain
machine-learning, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.