[Java] Using functions for mapping#1007
[Java] Using functions for mapping#1007rapids-bot[bot] merged 17 commits intorapidsai:branch-25.08from
Conversation
|
/ok to test b3856a1 |
|
/ok to test 6a46323 |
java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraIndexImpl.java
Show resolved
Hide resolved
java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraIndexImpl.java
Show resolved
Hide resolved
|
@ldematte One of my wishlist items was to compute this mapping on the GPU (when possible) to cut down on time to return the results from the various algorithms. Maybe something like a transform operation (https://nvidia.github.io/cccl/thrust/api/function_group__transformations_1ga62a6227031c9c811c5b497b347398a8a.html), or something similar, if available in Raft/RAPIDS. Towards that, maybe we could bring back (in addition to this function) a Alternatively, the same function can be used to construct an int[] for the mapping on the GPU. However, constructing it on every request could be as bad as doing the entire mapping application on the CPU itself, so maybe some strategy involving caching the constructed mapping int[] could be explored. |
|
/ok to test 76264ea |
|
/ok to test 726c5dc |
|
This PR seems to be labeled as Any objection to labeling this as |
java/cuvs-java/src/main/java/com/nvidia/cuvs/SearchResults.java
Outdated
Show resolved
Hide resolved
java/cuvs-java/src/main/java/com/nvidia/cuvs/SearchResults.java
Outdated
Show resolved
Hide resolved
The change in the java API signature is clearly an incompatible change, no question. However, the API is experimental, and as such is still evolving before being made final. So it't not a breaking change. We're likely going to have several of these kinds of change in the next release. |
java/cuvs-java/src/test/java/com/nvidia/cuvs/HnswBuildAndSearchIT.java
Outdated
Show resolved
Hide resolved
|
/ok to test eb8a15c |
|
I've merged #1049. I'm afraid this PR will need a rebase. |
…g-as-function # Conflicts: # java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java # java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraQuery.java # java/cuvs-java/src/main/java/com/nvidia/cuvs/HnswQuery.java # java/cuvs-java/src/main/java/com/nvidia/cuvs/SearchResults.java # java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/BruteForceSearchResults.java # java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraIndexImpl.java # java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraSearchResults.java # java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/HnswSearchResults.java # java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/common/SearchResultsImpl.java # java/cuvs-java/src/test/java/com/nvidia/cuvs/BruteForceAndSearchIT.java # java/cuvs-java/src/test/java/com/nvidia/cuvs/CagraBuildAndSearchIT.java # java/cuvs-java/src/test/java/com/nvidia/cuvs/HnswBuildAndSearchIT.java
All of the pending PRs will need that :) |
|
/ok to test f4b40a8 |
…g-as-function # Conflicts: # java/cuvs-java/src/test/java/com/nvidia/cuvs/CagraBuildAndSearchIT.java
|
/ok to test 4db9f63 |
|
/ok to test 142050a |
|
/merge |
|
Thank you for this change, @ldematte. I've merged this change. |
This PR replaces "array" based ID mappings with a more free-form mapping based on functions.
This should be more efficient both when the number of IDs is huge (you don't need to actually allocate big list for all IDs to map) and in general (as it won't need to perform boxing/unboxing of integers).
It should also be more flexible; as an example, I have introduced a simple helper to wrap a list, so that the previous approach can still be used. The same can be done for maps etc.
Relates to #699