[SVS] Refactor SVS element size calculations and block size handling#980
[SVS] Refactor SVS element size calculations and block size handling#980rfsaliev wants to merge 4 commits into
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #980 +/- ##
=======================================
Coverage 97.12% 97.13%
=======================================
Files 141 141
Lines 8245 8260 +15
=======================================
+ Hits 8008 8023 +15
Misses 237 237 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
alonre24
left a comment
There was a problem hiding this comment.
LGTM - did we confirm that there is no regression in terms of memory consumption in benchmarks?
| if(GLIBC_VERSION VERSION_GREATER_EQUAL "2.28") | ||
| if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "14.0") | ||
| set(SVS_URL "https://github.com/intel/ScalableVectorSearch/releases/download/v0.3.0/svs-shared-library-0.3.0-reduced-gcc14.tar.gz" CACHE STRING "SVS URL") | ||
| set(SVS_URL "https://github.com/intel/ScalableVectorSearch/releases/download/nightly/svs-shared-library-reduced-gcc14-2026-06-18-1414.tar.gz" CACHE STRING "SVS URL") |
There was a problem hiding this comment.
Do we want to merge it as it is (using the nightly version) or bump to an official svs release?
There was a problem hiding this comment.
@alonre24, now there is SVS v.0.3.2 release used in this change.
FYI: SVS v.0.3.2 = v.0.3.1 + LVQ exports required to compute 'Residual' element size.
465995d to
fcc801d
Compare
fcc801d to
48ce76c
Compare
| set(SVS_URL "https://github.com/intel/ScalableVectorSearch/releases/download/v0.3.2/svs-shared-library-reduced.tar.gz" CACHE STRING "SVS URL") | ||
| endif() | ||
| elseif(GLIBC_VERSION VERSION_GREATER_EQUAL "2.26") | ||
| set(SVS_URL "https://github.com/intel/ScalableVectorSearch/releases/download/v0.3.0/svs-shared-library-0.3.0-reduced-glibc2_26.tar.gz" CACHE STRING "SVS URL") |
There was a problem hiding this comment.
Note to Redis team: we dropped support for amazonlinux builds, so up to you on whether we keep this at the v0.3.0 or drop it entirely.
|
I didn't realize my approval would trigger a merge - I'll leave that decision up to @alonre24 etc. |
Describe the changes in the pull request
This pull request refactors and improves the way element sizes and block sizes are calculated and used in the SVS storage traits, enhancing clarity and modularity in the code. The changes introduce clearer separation between primary, residual, and secondary element sizes, update the block size calculation to use a new structure, and simplify related test logic.
Which issues this PR fixes
This PR fixes index size estimation issues for SVSIndex by using new
blocksize_elementsparameter introduced in intel/ScalableVectorSearch#344.TODO:
Main objects this PR modified
Mark if applicable
Note
Medium Risk
Changes affect SVS memory layout, blocking, and size estimation for quantized indexes; risk is mitigated by test updates and a dependency bump rather than API changes.
Overview
SVS index size estimation and blocked storage are updated to match Intel ScalableVectorSearch v0.3.2 (shared library URLs in
cmake/svs.cmakebumped from v0.3.1 to v0.3.2).SVSBlockSizenow returnssvs::data::BlockingParameterswith both byte block size and element-count block size (blocksize_elementsfrom upstream #344), instead of a singlePowerOfTwo.For LVQ and LeanVec traits, element sizing is split into primary, residual, and secondary helpers; blocked allocators use the max of the relevant component sizes when computing blocks. Total
element_sizeis the sum of those parts.Tests:
testSizeEstimationdrops the old LVQ dimension fudge and uses 1% tolerance for per-block growth estimates; tieredrunGCAPIsetsblockSizetothreshold/2so deletes span at least two blocks (workaround for SVS keeping one empty block on shrink).Reviewed by Cursor Bugbot for commit 7e7d646. Bugbot is set up for automated code reviews on this repo. Configure here.