NVIDIA / NVIDIA/cuvs

[FEA] Investigate memory usage, thread usage, and memory transfers in NN Descent

Open
#172 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, NN Descent uses a lot of pinned host memory and device memory. As a consequence, it's not very scalable. Also, there are a lot of memory transfers and copies to create the final indices and distances. We should investigate and try to optimize memory-related usage where possible.

Another orthogonal issue is that NN Descent implementation relies on launching OMP threads to build the index. This can cause starvation issue when an application is attempting to build multiple indexes in different host threads. Ideally, we would attempt to refactor and use the GPU to achieve parallelism in lieu of OMP threads.

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 by reading the NN Descent implementation and tracing how it allocates pinned host memory, device memory, and creates final indices and distances. Profile the memory transfers and copies, then inspect how OMP threads are launched during index construction. Done means the identified memory and thread-scalability issues have measurable improvements.

Written by the indexing model from the issue text.

Assessment

Domain
performance, search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.