-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Can HNSWPQ nbits parameter be made configurable? #3027
Comments
Suppport for >8 bits per PQ has improved a lot, so we should support it in HNSW as well. Easy to address here with a default value of 8 https://github.com/facebookresearch/faiss/blob/main/faiss/IndexHNSW.cpp#L889 the only issue is that the PQ parameters are intermixed with the HNSW parameters but there is no easy way around it wihtout breaking compatibiiuty. |
Sure, let me see if I can make the change without breaking bwc. I assume that we could use default of 8 as a way to avoid this in most cases. |
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com>
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com>
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com>
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com>
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com>
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com>
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com> (cherry picked from commit ce47b1b)
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com> (cherry picked from commit ce47b1b)
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com> (cherry picked from commit ce47b1b)
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com> (cherry picked from commit ce47b1b)
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com>
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com>
Summary: As requested in facebookresearch#3027 Indeed, PQ sizes with nbits > 8 are good tradeoffs, so it is interesting to support them. Differential Revision: D48860659 fbshipit-source-id: 4956fdf5a442dae0a206478e211a72108c85c284
…ch#3031) Summary: Pull Request resolved: facebookresearch#3031 As requested in facebookresearch#3027 Indeed, PQ sizes with nbits > 8 are good tradeoffs, so it is interesting to support them. Differential Revision: D48860659 fbshipit-source-id: 5cd679a4a62f3c9177962481679aa85e88827cc4
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com>
Updates faiss engine to enable hnsw and faiss to work together. For HNSW, code_size must be equal to 8 (refer to facebookresearch/faiss#3027). Therefore, the index description string "HNSW32,PQXxY" does not work. Only "HNSW32,PQX" ends up working. Additionally, adds several unit tests and integration tests in order to validate the functionality. Signed-off-by: John Mazanec <jmazane@amazon.com>
…ch#3031) Summary: Pull Request resolved: facebookresearch#3031 As requested in facebookresearch#3027 Indeed, PQ sizes with nbits > 8 are good tradeoffs, so it is interesting to support them. Reviewed By: pemazare Differential Revision: D48860659 fbshipit-source-id: 6f3c642e0902e1523bef36db6be3af3688d529a5
Summary
For IndexHNSWPQ, I see the value for
nbits
is hardcoded to 8. I wanted to know if this could possibly be made configurable?I saw this issue from several years ago: #259, where reasoning for not going above 8 nbits on CPU was over concerns of keeping table in l1/l2 cache. However, I am wondering if improved recall may be worth the tradeoff in additional latency. Additionally, for graph-based algorithms, where fewer distance computations are made, I am wondering if the latency impact from not fitting table in l1 cache may not be as pronounced.
The text was updated successfully, but these errors were encountered: