Conversation
|
Hi!
Instead I would propose to setup block size in a
|
rfsaliev
left a comment
There was a problem hiding this comment.
Please also read my standalone comment to the PR as well.
|
Thanks for comments. I have modified the PR, according to your request:
|
rfsaliev
left a comment
There was a problem hiding this comment.
LGFM
just few comments/suggestions
|
@razdoburdin could you give an example how this is used in a comment or the PR description? |
I have updated the PR description |
|
@razdoburdin it makes sense, the missing symbol is svs::runtime::v0::DynamicVamanaIndex::build(svs::runtime::v0::DynamicVamanaIndex**, unsigned long, svs::runtime::v0::MetricType, svs::runtime::v0::StorageKind, svs::runtime::v0::VamanaIndex::BuildParams const&, svs::runtime::v0::VamanaIndex::SearchParams const&)This is the function you modified and added a new parameter. It has a default value, but I guess for ABI compatibility it is required to do this instead static Status build(
DynamicVamanaIndex** index,
size_t dim,
MetricType metric,
StorageKind storage_kind,
const VamanaIndex::BuildParams& params = {},
const VamanaIndex::SearchParams& default_search_params = {},
const VamanaIndex::DynamicIndexParams& dynamic_index_params = {}
) noexcept;
static Status build(
DynamicVamanaIndex** index,
size_t dim,
MetricType metric,
StorageKind storage_kind,
const VamanaIndex::BuildParams& params = {},
const VamanaIndex::SearchParams& default_search_params = {}
) noexcept {
build(index, dim, metric, storage_kind, params, default_search_params, {});
} |
but the code with this overload wouldn't compile :( |
|
Right, we'd have to remove the default arguments and replicate the original ABI. |
As a workaround, for ABI compatibility I would declare: static Status build(
DynamicVamanaIndex** index,
size_t dim,
MetricType metric,
StorageKind storage_kind,
const VamanaIndex::BuildParams& params = {},
const VamanaIndex::SearchParams& default_search_params = {}
) noexcept;
static Status build(
DynamicVamanaIndex** index,
size_t dim,
MetricType metric,
StorageKind storage_kind,
const VamanaIndex::BuildParams& params,
const VamanaIndex::SearchParams& default_search_params,
const VamanaIndex::DynamicIndexParams& dynamic_index_params
) noexcept;The first declaration is for ABI compatibility. Implementation code should look like: // ABI backward compatibility
static Status build(
DynamicVamanaIndex** index,
size_t dim,
MetricType metric,
StorageKind storage_kind,
const VamanaIndex::BuildParams& params,
const VamanaIndex::SearchParams& default_search_params
) noexcept {
build(index, dim, metric, storage_kind, params, default_search_params, VamanaIndex::DynamicIndexParams{});
}
// Real implementation with new parameter
static Status build(
DynamicVamanaIndex** index,
size_t dim,
MetricType metric,
StorageKind storage_kind,
const VamanaIndex::BuildParams& params,
const VamanaIndex::SearchParams& default_search_params,
const VamanaIndex::DynamicIndexParams& dynamic_index_params
) noexcept {
// Full implementation
}
|
ahuber21
left a comment
There was a problem hiding this comment.
LGTM. Follow-up request: Could you please experiment with rss_increase in runtime_test.cpp? The function rss_threshold() accepts a parameter allocator_block_size. Could you add new test cases where you have a small blocksize value and see if the tests still pass? And then please add them in a new PR.
This PR adds ability to set custom index blocksize
Reopening of #235
The new parameter structure for build method of
DynamicVamanaIndexandDynamicVamanaIndexLeanVecis introduced.Example of building a LeanVec index with block_size = 2^12