-
Notifications
You must be signed in to change notification settings - Fork 185
[FEA] expose python & C API for prefiltered brute force #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
63216bd
[FEA] expose python & C API for prefiltered brute force
rhdong 469a3ea
Merge remote-tracking branch 'origin/branch-24.08' into rhdong/pbf-py…
rhdong a6b93e5
Fix by review comments
rhdong 5daba7a
Fix CI issue
rhdong 3a50b90
Fix the doc issue
rhdong 59c4c28
fix rust build
benfred 31116fb
fix the doc issue, 2nd try
rhdong 4623b8f
Merge branch 'branch-24.08' into rhdong/pbf-python
benfred c422e2a
fix CI new issue
rhdong 46454d9
Merge branch 'branch-24.08' into rhdong/pbf-python
rhdong 9db7e47
Merge branch 'branch-24.08' into rhdong/pbf-python
rhdong c936f7e
fix by review comments
rhdong 3b65952
get ownership of bitmap tensor
benfred 6c12dab
Merge remote-tracking branch 'origin/branch-24.08' into rhdong/pbf-py…
rhdong b3ff079
fix style issue
rhdong d0b7c8a
Optimize the comments of brute-force APIs
rhdong 23f5909
Optimize the comments of APIs
rhdong 4de501e
Merge remote-tracking branch 'origin/branch-24.08' into rhdong/pbf-py…
rhdong 948b131
optimize naming
rhdong 4d0a61d
change to common.h
rhdong 21c44e7
replace `cudaMalloc` & `cudaMemcpy` by raft APIs(under neighbors)
rhdong f451ec6
optimize the name of `Prefilter` (not `prefilters`)
rhdong 3b2515d
Merge branch 'branch-24.08' into rhdong/pbf-python
rhdong a0d2097
Merge branch 'branch-24.08' into rhdong/pbf-python
benfred 3708175
Merge branch 'branch-24.08' into rhdong/pbf-python
benfred File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| /* | ||
| * Copyright (c) 2024, NVIDIA CORPORATION. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <cuvs/core/c_api.h> | ||
| #include <cuvs/distance/distance.h> | ||
| #include <dlpack/dlpack.h> | ||
| #include <stdint.h> | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| /** | ||
| * @defgroup prefilter Prefilter APIs | ||
| * @brief APIs related to prefilter functionality. | ||
| * @{ | ||
| */ | ||
|
|
||
| /** | ||
| * @brief Enum to denote prefilter type. | ||
| */ | ||
| enum cuvsPrefilterType { | ||
| /* No filter */ | ||
| NO_FILTER, | ||
| /* Filter an index with a bitset */ | ||
| BITSET, | ||
|
benfred marked this conversation as resolved.
|
||
| /* Filter an index with a bitmap */ | ||
| BITMAP | ||
| }; | ||
|
|
||
| /** | ||
| * @brief Struct to hold address of cuvs::neighbor::prefilter and its type | ||
| * | ||
| */ | ||
| typedef struct { | ||
| uintptr_t addr; | ||
| enum cuvsPrefilterType type; | ||
| } cuvsPrefilter; | ||
|
|
||
| /** | ||
| * @} | ||
| */ | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need a way to specify a custom filter function (maybe to accept a function pointer?) also. While bfknn currently only supports bitmap / bitset, we also need to expose the filtering APIs for the other ANN indexes (most ideally through the same API).
I'm okay pushing this to a future change, since it's going to be needed ASAP so that we can expose the remaining filtering functions for the other algorithm. Can you create an issue for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will!