Skip to content

Commit

Permalink
Minor speedup of HNSW (facebookresearch#2832)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebookresearch#2832

Switch to `omp schedule(guided)` in HNSW::search() call

Reviewed By: mdouze

Differential Revision: D45360510

fbshipit-source-id: 5230429748c0e1e12d8fc2ea7184e273dee76bdf
  • Loading branch information
Alexandr Guzhva authored and facebook-github-bot committed May 4, 2023
1 parent 29318b3 commit f276c47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion faiss/IndexHNSW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void IndexHNSW::search(
DistanceComputer* dis = storage_distance_computer(storage);
ScopeDeleter1<DistanceComputer> del(dis);

#pragma omp for reduction(+ : n1, n2, n3, ndis, nreorder)
#pragma omp for reduction(+ : n1, n2, n3, ndis, nreorder) schedule(guided)
for (idx_t i = i0; i < i1; i++) {
idx_t* idxi = labels + i * k;
float* simi = distances + i * k;
Expand Down

0 comments on commit f276c47

Please sign in to comment.