-
Notifications
You must be signed in to change notification settings - Fork 22
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
support in-place update operation for hnsw #196
Conversation
ShawnShawnYou
commented
Dec 9, 2024
•
edited
Loading
edited
- support in-place update operation for hnsw Support in-place update #225
tests/test_index_old.cpp
Outdated
@@ -637,6 +637,90 @@ TEST_CASE("remove vectors from the index", "[ft][index]") { | |||
} | |||
} | |||
|
|||
TEST_CASE("update vectors from the index", "[ft][index]") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add thread-safe testing for hnsw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
7b2ac3e
to
9bce756
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/algorithm/hnswlib/hnswalg.cpp
Outdated
if (iter == label_lookup_.end()) { | ||
throw std::runtime_error("no label in HNSW"); | ||
} else { | ||
internal_id = iter->second; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge internal_id define to here
InnerIdType internal_id = iter->second;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/algorithm/hnswlib/hnswalg.cpp
Outdated
std::unique_lock<std::mutex> lock(global_); | ||
auto iter = label_lookup_.find(label); | ||
if (iter == label_lookup_.end()) { | ||
throw std::runtime_error("no label in HNSW"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: add the label id content to error message ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/index/hnsw.cpp
Outdated
} | ||
|
||
try { | ||
std::unique_lock lock(rw_mutex_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the lock is not necessary ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
9bce756
to
5bc7f48
Compare
b67a25d
to
7b01e1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: zhongxiaoyao.zxy <[email protected]>
7b01e1f
to
c81a417
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM