Skip to content

support sparse vector in HGraph#604

Merged
inabao merged 8 commits into
mainfrom
hgraph_sparse
May 6, 2025
Merged

support sparse vector in HGraph#604
inabao merged 8 commits into
mainfrom
hgraph_sparse

Conversation

@inabao

@inabao inabao commented Apr 20, 2025

Copy link
Copy Markdown
Collaborator

close: #659
image

@inabao inabao added kind/feature Brand-new functionality or capabilities 引入全新的功能、新特性或新能力 version/0.15 1. Add Attribute Filter 2. Quantization and transformation 1. 新增 Attribute Filter 2. 量化与变换 labels Apr 20, 2025
@inabao inabao self-assigned this Apr 20, 2025
Comment thread src/algorithm/hgraph.h
get_data(const DatasetPtr& dataset, uint32_t index = 0) const {
if (data_type_ == DataTypes::DATA_TYPE_FLOAT) {
return dataset->GetFloat32Vectors() + index * dim_;
} else if (data_type_ == DataTypes::DATA_TYPE_SPARSE) {

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.

current not support int8 ?

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.

there is no need for int8 in sparse vector now

PARAMETER_DTYPE,
DATATYPE_FLOAT32,
DATATYPE_INT8,
DATATYPE_SPARSE,

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.

format string not change

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

Comment thread tools/eval/eval_dataset.cpp Outdated
size_t data_size,
std::vector<SparseVector>& parsed_vectors) {
std::vector<SparseVector>& parsed_vectors,
int64_t& dim) {

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 dim is output param ?
we can define an sparse_vector struct to hold sparse_vector data and dim information ?

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.

I have changed the dim to max_len to denote the maximum value of valid dim.

@inabao
inabao force-pushed the hgraph_sparse branch 2 times, most recently from 55542d4 to 843fbed Compare April 27, 2025 03:15
inabao added 3 commits April 28, 2025 11:28
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
inabao added 2 commits April 28, 2025 19:34
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
@codecov

codecov Bot commented Apr 28, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 94.91525% with 3 lines in your changes missing coverage. Please review.

@@            Coverage Diff             @@
##             main     #604      +/-   ##
==========================================
+ Coverage   91.05%   91.30%   +0.24%     
==========================================
  Files         180      182       +2     
  Lines       10658    10865     +207     
==========================================
+ Hits         9705     9920     +215     
+ Misses        953      945       -8     
Flag Coverage Δ
cpp 91.30% <94.91%> (+0.24%) ⬆️

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

Components Coverage Δ
common 93.28% <ø> (ø)
datacell 92.05% <100.00%> (+0.45%) ⬆️
index 89.40% <93.61%> (+0.02%) ⬆️
simd 100.00% <ø> (ø)

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 d6fcd91...911e526. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread .circleci/config.yml
command: make test_parallel
no_output_timeout: 50m
no_output_timeout: 60m

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.

I think 50m is enough, I have speedup some disk-based test

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

Comment thread src/algorithm/hgraph.cpp
route_graphs_(common_param.allocator_.get()),
dim_(common_param.dim_),
data_type_(common_param.data_type_),
use_reorder_(hgraph_param->use_reorder),

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.

dim and data_type should place on InnerIndexInterface

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

inabao added 2 commits April 29, 2025 15:38
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
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

Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Comment thread extern/cpr/cpr.cmake Outdated
Comment thread extern/diskann/diskann.cmake Outdated
Comment thread extern/diskann/diskann.cmake Outdated

@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 a7e0c06 into main May 6, 2025
@inabao
inabao deleted the hgraph_sparse branch May 6, 2025 03:38
LHT129 pushed a commit to LHT129/vsag that referenced this pull request Apr 16, 2026
Signed-off-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>
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>
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/feature Brand-new functionality or capabilities 引入全新的功能、新特性或新能力 module/testing module/tools size/L version/0.15 1. Add Attribute Filter 2. Quantization and transformation 1. 新增 Attribute Filter 2. 量化与变换

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support sparse vector search in HGraph

5 participants