-
Notifications
You must be signed in to change notification settings - Fork 632
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
Partitioned HNSW Deeplake Side Changes. #2847
Conversation
…r in additional params as they are mutable.
|
…r in additional params as they are mutable.
8f86704
to
b906611
Compare
…to partitioned_hnsw
…to partitioned_hnsw
Quality Gate failedFailed conditions |
This reverts commit 31959f2.
🚀 🚀 Pull Request
This PR is the deeplake side implementation of the Partitioned HNSW. In case of Partititoned HNSW we divide the HNSW into number of partition. This is done when the data is large and it has to scale. HNSW is not scalable, so in order to accommodate large of of data Partitioning is a way out.
Partitions are defined in index params. For e.g. we are creating 5 partitions and if the dataset is having 1000000 rows then each partition will have 200000 rows.
Through VectorStore API.
vs = VectorStore(
path=dest,
exec_option="compute_engine",
index_params={"threshold": 1, "distance_metric": "COS", "additional_params": {
"efConstruction": 200,
"M": 16,
"partitions": 5,
}},
token = TOKEN,
verbose=True,
overwrite= True,
)
Through Deeplake API.
ds = vs.dataset.
params = {
"efConstruction": 200,
"M": 16,
"partitions": 32,
}
ds.embedding.create_vdb_index("hnsw_1", distance="cosine_similarity", additional_params = params)
While doing query there is no change and TQL will be fired to all the partitions simultenously. The best match will be responded back.
Incremental index maintenance is enabled for partitioned hnsw. In case of new row Addition, Update or Remove of Top most rows the partitioned hnsw is automatically maintained.
In order to delete the partitioned hnsw index
ds.embedding.delete_vdb_index("hnsw_1")
Impact
Partitioned indexes are much faster to create and have high recall impact. Whenever indexing has to be done at scale, this feature is helpful.