NVIDIA / NVIDIA/cuvs

[FEA] search_multi_cta_00_generate.py support cuvs::neighbors::filtering::bitmap_filter<uint32_t COMMA int64_t>

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

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I wish I could use RAFT to do [...]

I wish I could use RAFT to support batch queries with filtering. and each query has its own bitset

Describe the solution you'd like

in search_multi_cta.*.cu, add the code like following:

instantiate_kernel_selection(int8_t,
                             uint32_t,
                             float,
                             CagraSampleFilterWithQueryIdOffset<
                               cuvs::neighbors::filtering::bitmap_filter<uint32_t COMMA int64_t>>);

update file: search_multi_cta_00_generate.py

for type_path, (data_t, idx_t, distance_t) in search_types.items():
    path = f"search_multi_cta_{type_path}.cu"
    with open(path, "w") as f:
        f.write(header)
        f.write(
                f"instantiate_kernel_selection(\n  {data_t}, {idx_t}, {distance_t}, cuvs::neighbors::filtering::none_sample_filter);\n"
        )
        f.write(
                f"instantiate_kernel_selection(\n  {data_t}, {idx_t}, {distance_t}, CagraSampleFilterWithQueryIdOffset<cuvs::neighbors::filtering::bitset_filter<uint32_t COMMA int64_t>>);\n"
        )
       f.write(
                f"instantiate_kernel_selection(\n  {data_t}, {idx_t}, {distance_t}, CagraSampleFilterWithQueryIdOffset<cuvs::neighbors::filtering::bitmap_filter<uint32_t COMMA int64_t>>);\n"
        )
        f.write(trailer)
        # For pasting into CMakeLists.txt
    print(f"src/neighbors/detail/cagra/{path}")

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 search_multi_cta_00_generate.py and inspect how it writes the search_multi_cta_*.cu files. Update the generator to emit the bitmap_filter instantiation alongside the existing filters, then verify that the generated CUDA files contain the requested CagraSampleFilterWithQueryIdOffset specialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
search
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.