Conversation
Signed-off-by: aaronzuo <anarionzuo@outlook.com>
|
@Anarion-zuo thanks for raising the PR. This is way better solution than mine. I had to make changes at multiple places. But this far more cleaner |
| ndis += stats.ndis; | ||
| nhops += stats.nhops; | ||
| res.end(); | ||
| vt.advance(); |
There was a problem hiding this comment.
why this is needed? just for understanding?
There was a problem hiding this comment.
VisitedTable vt is reused across queries inside the same parallel region for performance (to avoid reallocating/clearing a large visited array for every query). vt.advance() is what “resets” the visited state between queries in O(1) by bumping an epoch counter (or clearing the hashset variant), so each query starts with an empty visited set.
Without vt.advance(), nodes visited while processing query i would remain marked as visited for query i+1, which can cause the search to skip almost everything and return incorrect / empty results.
This is the same pattern used elsewhere in HNSW search code, e.g. in the main search loop that shares a VisitedTable across queries and calls advance() after each query.
|
@navneet1v Hi. It's been some time. Do I need a maintainer's approval to trigger the CI tests? |
|
@navneet1v Hi. Are you a maintainer? Someone should trigger the CI on this one. |
I am not the maintainer |
|
taggin @mdouze |
|
@mnorris11 has imported this pull request. If you are a Meta employee, you can view this in D97766638. |
|
@Anarion-zuo would you be able to fix the unit tests? Are the logs visible to you? |
|
@mnorris11 I fixed the visible part of the CI. |
|
@mnorris11 gentle ping |
| } | ||
|
|
||
| template <> | ||
| struct simd512bit_tpl<SIMDLevel::AVX512_SPR> |
There was a problem hiding this comment.
Why did the template have to change for AVX512 if the issue is related to CAGRA / HNSW? #5015 added SIMD dispatch for HNSW.
Summary
Resolved #4927.
IndexHNSWCagra::range_searchto return results without an entry point.Changes
IndexHNSWCagrausing per-query range handlers.Tests
docker build -f docker/Dockerfile.dev -t faiss-dev:local --build-arg UID="$(id -u)" --build-arg GID="$(id -g)" .docker run --rm -v "$PWD:/workspace" -w /workspace faiss-dev:local bash -lc "cmake -B build-docker -G Ninja -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=ON -DBUILD_TESTING=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo . && cmake --build build-docker -j --target faiss faiss_test swigfaiss && ./build-docker/tests/faiss_test --gtest_filter=HNSW.Test_IndexHNSWCagra_BaseLevelOnly_RangeSearch"Notes