Skip to content

extract the pruning strategy from HGraph#373

Merged
inabao merged 1 commit into
mainfrom
pruning-strategy
Feb 18, 2025
Merged

extract the pruning strategy from HGraph#373
inabao merged 1 commit into
mainfrom
pruning-strategy

Conversation

@inabao

@inabao inabao commented Feb 6, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@inabao inabao added the kind/improvement Optimizations, UX polish, or minor improvements 性能优化、体验打磨或细节改良 label Feb 6, 2025
@inabao inabao self-assigned this Feb 6, 2025
GraphInterfacePtr graph,
const FlattenInterfacePtr flatten,
MutexStrategyPtr neighbors_mutexs,
Allocator* allocator);

Copy link
Copy Markdown
Collaborator Author

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

codecov Bot commented Feb 6, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 95.65217% with 5 lines in your changes missing coverage. Please review.

@@            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     
Flag Coverage Δ
cpp 91.31% <95.65%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
common 95.61% <97.50%> (+0.07%) ⬆️
datacell 92.50% <ø> (+0.07%) ⬆️
index 91.47% <100.00%> (-0.04%) ⬇️
simd 81.72% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update acc0815...97a611d. Read the comment docs.

@wxyucs wxyucs added the version/0.13 1. Add bruteforce 2. Implement pyramid 1. 新增 bruteforce 2. pyramid 功能实现 label Feb 8, 2025
Comment thread src/lock_strategy.cpp Outdated

void
PointsMutex::Unlock(uint32_t i) {
neighbors_mutex_[i].unlock_shared();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neighbors_mutex_[i].unlock() ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@wxyucs wxyucs added version/0.14 1. Add IVF 2. Add Sparse 3. Async IO 1. 新增 IVF 2. 增加 Sparse 3. 异步 IO and removed version/0.13 1. Add bruteforce 2. Implement pyramid 1. 新增 bruteforce 2. pyramid 功能实现 labels Feb 11, 2025
@inabao
inabao requested a review from jiaweizone February 11, 2025 11:56
Comment thread src/lock_strategy.cpp

void
PointsMutex::Resize(uint32_t new_element_num) {
neighbors_mutex_.resize(new_element_num);

Copy link
Copy Markdown
Collaborator

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 ?

Copy link
Copy Markdown
Collaborator Author

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

Comment thread src/algorithm/hgraph.cpp Outdated
void
HGraph::resize(uint64_t new_size) {
auto cur_size = this->neighbors_mutex_.size();
auto cur_size = this->labels_.size();

Copy link
Copy Markdown
Collaborator

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; ?

Copy link
Copy Markdown
Collaborator Author

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.

Comment thread src/lock_strategy.h Outdated

private:
Vector<std::shared_ptr<std::shared_mutex>> neighbors_mutex_;
Allocator* allocator_{nullptr};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>

@LHT129 LHT129 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jiaweizone jiaweizone left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wxyucs wxyucs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@inabao
inabao merged commit 0877ef1 into main Feb 18, 2025
@inabao
inabao deleted the pruning-strategy branch February 18, 2025 03:54
jiacai2050 pushed a commit to jiacai2050/vsag that referenced this pull request Mar 6, 2025
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Co-authored-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
LHT129 pushed a commit to LHT129/vsag that referenced this pull request Apr 16, 2026
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Co-authored-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
LHT129 pushed a commit that referenced this pull request May 11, 2026
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Co-authored-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: LHT129 <tianlan.lht@antgroup.com>
Sia-Sheerland pushed a commit to Sia-Sheerland/vsag that referenced this pull request Jun 26, 2026
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Co-authored-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: Sia Sheerland <x1075956441x@163.com>

Signed-off-by: Sia Sheerland <x1075956441x@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/improvement Optimizations, UX polish, or minor improvements 性能优化、体验打磨或细节改良 size/L version/0.14 1. Add IVF 2. Add Sparse 3. Async IO 1. 新增 IVF 2. 增加 Sparse 3. 异步 IO

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants