[C API] Implement memory estimation functions for index builders and tests - #364
Draft
rfsaliev wants to merge 2 commits into
Draft
[C API] Implement memory estimation functions for index builders and tests#364rfsaliev wants to merge 2 commits into
rfsaliev wants to merge 2 commits into
Conversation
…namic index memory breakdown
Member
Author
|
This PR contains number of workarounds/TODOs which should be resolved out-of the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for estimating the memory usage of an index (both static and dynamic Vamana) based on the builder configuration and number of vectors, and implements the necessary logic and API functions in the C bindings. It introduces new estimation methods in the C API, adds implementations for memory estimation in the builder and dispatcher classes, and updates data builders to support size estimation for various data types.
API Additions:
svs_index_builder_estimate_memoryandsvs_index_builder_estimate_memory_dynamicto estimate the memory usage of an index and a dynamic index, respectively, based on the builder configuration and number of vectors.Core Logic and Implementation:
estimate_memory_breakdownandestimate_memory_breakdown_dynamicmethods in theIndexBuilderclass to provide memory usage estimates for static and dynamic Vamana indexes.dispatch_vamana_memory_estimateanddispatch_dynamic_vamana_memory_estimateto calculate the memory breakdown for static and dynamic Vamana indexes, including graph, data, and metadata sizes. [1] [2]data_builder.cppsource file.Data Builder Enhancements:
estimate_sizemethods to all data builder classes (SimpleDataBuilder,LVQDataBuilder,LeanVecDataBuilder,SQDataBuilder) to support size estimation for different data types. [1] [2] [3] [4] [5]data_builder.cppimplementation file with logic for dispatching and estimating data sizes for various data builder specializations, including handling for blocked and non-blocked allocators.Header and Dependency Updates:
These changes collectively provide a robust mechanism for clients to estimate index memory requirements before actually building an index, improving usability and resource planning.