Skip to content

hgraph support extra info#486

Merged
wxyucs merged 2 commits intoantgroup:mainfrom
lyxiong0:dev_extra_info
Mar 25, 2025
Merged

hgraph support extra info#486
wxyucs merged 2 commits intoantgroup:mainfrom
lyxiong0:dev_extra_info

Conversation

@lyxiong0
Copy link
Collaborator

@lyxiong0 lyxiong0 commented Mar 7, 2025

  1. Add new datacell typeExtraInfoDataCell
  2. HGraph supports a new parameter extra_info_size
  3. Modify HGraph related interface, including KnnSearch, Add etc.

related to issue #277

dists[j] = search_result.top().first;
ids[j] = this->label_table_->GetLabelById(search_result.top().second);
if (extra_infos != nullptr) {
this->extra_infos_->GetExtraInfoById(search_result.top().second, tmp_extra_info.get());
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

dists[j] = search_result.top().first;
ids[j] = this->label_table_->GetLabelById(search_result.top().second);
if (extra_infos != nullptr) {
this->extra_infos_->GetExtraInfoById(search_result.top().second, tmp_extra_info.get());
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not pass the extra_infos directly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

estimate_memory += block_memory_ceil(precise_memory, block_size);
}

if (extra_info_size_ > 0 && this->extra_infos_->InMemory()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is best to use whether this->extra_infos_ is nullptr as the condition to avoid core dumps.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

this->io_->Deserialize(reader);
}

} // namespace vsag No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

add new line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@lyxiong0 lyxiong0 force-pushed the dev_extra_info branch 2 times, most recently from a7a58f5 to fd4fc30 Compare March 13, 2025 13:31

public:
InnerIdType total_count_{0};
InnerIdType max_capacity_{1000000};
Copy link
Collaborator

Choose a reason for hiding this comment

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

why init the capacity as 1000000

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Refer to the setting of FlattenDataCell, modify it to 800

vsag::Options::Instance().set_block_size_limit(origin_size);
}
}
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

add new line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

}

public:
std::shared_ptr<BasicIO<MemoryBlockIO>> io_{nullptr};
Copy link
Collaborator

@inabao inabao Mar 14, 2025

Choose a reason for hiding this comment

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

Hardcoding the MemoryBlockIO in this part might not be the best design, as it would raise challenges for subsequent expansion of disk-based extroinfo. It is recommended to employ template, similar to how other data_cell implementations work, to resolve this issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As discussed earlier, Extra Info considers only the MemoryBlockIO type currently.
But we can reserve interfaces for other types by raising a std::invaliargument exception on initialization for types other than MemoryBlockIO.

@lyxiong0 lyxiong0 force-pushed the dev_extra_info branch 2 times, most recently from 6501119 to 1be97eb Compare March 17, 2025 03:57
@codecov
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

Attention: Patch coverage is 87.02703% with 24 lines in your changes missing coverage. Please review.

@@            Coverage Diff             @@
##             main     #486      +/-   ##
==========================================
- Coverage   90.66%   90.61%   -0.05%     
==========================================
  Files         177      182       +5     
  Lines       10846    11030     +184     
==========================================
+ Hits         9833     9995     +162     
- Misses       1013     1035      +22     
Flag Coverage Δ
cpp 90.61% <87.02%> (-0.05%) ⬇️

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

Components Coverage Δ
common 95.28% <100.00%> (+0.03%) ⬆️
datacell 92.89% <83.68%> (-0.60%) ⬇️
index 88.63% <97.14%> (+0.07%) ⬆️
simd 87.27% <ø> (ø)

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 4a227a2...69df18b. Read the comment docs.

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

@lyxiong0 lyxiong0 force-pushed the dev_extra_info branch 2 times, most recently from 885ec7b to 08f7182 Compare March 19, 2025 06:33
Copy link
Collaborator

@wxyucs wxyucs left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@inabao inabao left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@LHT129 LHT129 left a 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: lyxiong0 <bear507@163.com>
Signed-off-by: lyxiong0 <bear507@163.com>
@wxyucs wxyucs merged commit 015c091 into antgroup:main Mar 25, 2025
47 of 52 checks passed
@wxyucs wxyucs added the kind/feature New feature or request label Mar 26, 2025
@wxyucs wxyucs linked an issue Mar 26, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support extra info in index

4 participants