-
Notifications
You must be signed in to change notification settings - Fork 26
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
extract the pruning strategy from HGraph #373
base: main
Are you sure you want to change the base?
Conversation
GraphInterfacePtr graph, | ||
const FlattenInterfacePtr flatten, | ||
MutexStrategyPtr neighbors_mutexs, | ||
Allocator* allocator); |
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 is_update parameter has been removed (currently, there are no uses where it would be set to true)
Codecov ReportAttention: Patch coverage is @@ Coverage Diff @@
## main #373 +/- ##
==========================================
+ Coverage 91.28% 91.31% +0.03%
==========================================
Files 140 143 +3
Lines 8968 8997 +29
==========================================
+ Hits 8186 8216 +30
+ Misses 782 781 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
37474da
to
7311f86
Compare
src/lock_strategy.cpp
Outdated
|
||
void | ||
PointsMutex::Unlock(uint32_t i) { | ||
neighbors_mutex_[i].unlock_shared(); |
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.
neighbors_mutex_[i].unlock() ?
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
704cf9e
to
d2f280a
Compare
|
||
void | ||
PointsMutex::Resize(uint32_t new_element_num) { | ||
neighbors_mutex_.resize(new_element_num); |
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 Resize
is not thread-safe implement ?
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 control for thread-safety will be handled externally
src/algorithm/hgraph.cpp
Outdated
@@ -849,11 +722,11 @@ HGraph::add_one_point(const float* data, int level, InnerIdType inner_id) { | |||
|
|||
void | |||
HGraph::resize(uint64_t new_size) { | |||
auto cur_size = this->neighbors_mutex_.size(); | |||
auto cur_size = this->labels_.size(); |
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.
auto cur_size = this->neighbors_mutex_ ? this->neighbors_mutex_->Size() : 0;
?
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.
Here, the size represents the capacity, and it has been switched to use max_capacity_
to record it.
src/lock_strategy.h
Outdated
|
||
private: | ||
Vector<std::shared_ptr<std::shared_mutex>> neighbors_mutex_; | ||
Allocator* allocator_{nullptr}; |
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.
const
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
64b396a
to
c3c1e8f
Compare
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
c3c1e8f
to
97a611d
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
No description provided.