Comments (3)
Hi there, thanks for a good question! It's been on our radars for a while, but it hasn't been clear so far whether pre-computing lookup tables per-query may get in the way of other raft optimizations.
In raft, the lookup table fully encodes distance components from the query to all possible vectors in a list (cluster). In particular, it depends on the distance from the query to the cluster center. Hence, it's unique for every (query, probe) pair.
As far as I know, some other implementations only encode the residual distances in the lookup table; in that case the lookup table needs only be constructed once per query. Both approaches have their pros and cons. Couple reasons to back up our choice:
- Encoding the full distance for every (query, probe) pair means we save a little bit of compute during the second phase - scanning through the encoded list. This tends to give better performance with larger datasets (100M or 1B records and up), where the construction of the lookup table takes only a small fraction of overall runtime.
- We support an alternative codebook mode, where the codebooks are trained per-cluster rather than per-subspace in the feature space. This mode allows even faster lookup table creation due to better data locality, but it naturally depends on the probed cluster id.
from raft.
I'd suggest we keep it open as a feature request, so that we can prioritize and try this as an optional optimization at some point.
from raft.
Thanks @QDXG-CXK and @achirkin. I've gone ahead and converted this to a feature request so we can keep it on our radar.
from raft.
Related Issues (20)
- [QST] How can we use cagra search with both ranked based optimization and distance-based optimization? HOT 1
- [FEA] Expose Sparse raft functions in pylibraft
- [FEA] Wrap `epsilon_neighbors` through pylibraft
- [DOC] How to used AIR Topk? HOT 1
- [FEA] Add power consumption metrics to `raft-ann-bench`
- [BUG] IVFPQ Benchmarks crash with >=8 threads on Ampere and above
- [FEA] Add runtime test for serialization format changes HOT 1
- [FEA] Remove pre-filtering template args
- [BUG] ptxas error : Value of threads per SM for entry is out of the range.
- [BUG] Kmeans balanced test fails when n_cols<=4
- [FEA] Enable direct cosine distance computation in nearest neighbors algorithms
- [QST] How to build raft with a -arch=sm_75? HOT 1
- [FEA] Replace temporary_device_buffer with mdbuffer-based copyback_buffer
- [FEA] Create a helper function for generating an mdbuffer from a pointer of unknown memory type
- [Task] Review performance impact of `std::visit` in mdbuffer
- [FEA] Improve refine_host performance when batch size is small
- [FEA] how to align rmm stream usage with raft handle
- [FEA] Consistently use the same convention for `hpp` files and their usage of device APIs
- [BUG] Crash in CAGRA optimize from invalid neighbor indices (produced by nn-descent)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raft.