-
Notifications
You must be signed in to change notification settings - Fork 655
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
RuntimeError: Cannot return the results in a contigious 2D array. Probably ef or M is too small #465
Comments
Hi @AmanKishore, Can you provide more details on the dataset? Are you using filtering? |
I can reproduce this when filtering out enough items that Say I have an index with 10 documents, but only 2 evaluate to # idx: ef_construction=200, M=64
docs, distance = idx.knn_query(vector, k=2, filter=_predicate, num_threads=1)
# works OK, returns 2 docs
# delete the first result
idx.mark_deleted(docs[0])
# do the same search (expect 1 results because of filtering)
docs, distance = idx.knn_query(vector, k=2, filter=_predicate, num_threads=1)
# RuntimeError: Cannot return the results in a contigious 2D array. Probably ef or M is too small It would be nice for the |
Hi @aramperes, Thanks for the example. We will fix it soon for non-batched queries. I wonder if it is a problem for batched queries? There there would be an issue with a the different number of returned nearest neighbors, which would require a flag that would do switching output to lists, padding, or returning the number of items. I am not sure which would work the best. |
I tried multiple parameters for ef and M but problem persists. However, if I remove the where clause in query, it goes away. Perhaps the error message is misleading and it has nothing to do with the tuning but bug with memory issues? |
Getting this error with the following code:
Any ideas how to fix?
The text was updated successfully, but these errors were encountered: