Skip to content

[MOD-9384] [SVS] Fix CI builds #658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Apr 28, 2025
Merged

[MOD-9384] [SVS] Fix CI builds #658

merged 32 commits into from
Apr 28, 2025

Conversation

rfsaliev
Copy link
Collaborator

@rfsaliev rfsaliev commented Apr 10, 2025

Enable and fix SVS Index build

A clear and concise description of what the PR is solving.

Which issues this PR fixes

  1. This PR fixes SVS integration build issues in GitHub actions
  2. This PR also fixes svs.h compilation error introduced by Refactor Info Report - [MOD-9321] #650

Main objects this PR modified

  1. Added cmake/svs.cmake - which is included in CMakeLists.txt and enables SVS Index support depending on OS/Platform, CPU and compiler compatibilities:
    • SVS disabled for non-x86 platforms (ARM, MacOS)
    • SVS disabled for GCC compiler version < 11.0 (e.g debian:bullseye)
  2. Added CMake cache variables:
    • USE_SVS - Enable SVSIndex. Default: ON, forced to OFF for non-compatible platforms
    • SVS_SHARED_LIB - Download and use SVS pre-compiled shared library for LVQ/LeanVec support. Default: ON, forced to OFF if USE_SVS is OFF or non-GLIBC build environment (e.g. Alpine Linux with libc MUSL).
    • SVS_URL - url to SVS shared library package
  3. If SVS_SHARED_LIB is off, then SVSIndex is compiled using ScalableVectorSearch public code without LVQ/LeanVec support.

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

@rfsaliev rfsaliev requested a review from alonre24 April 10, 2025 16:25
Copy link

codecov bot commented Apr 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.33%. Comparing base (8c89d72) to head (35cd71c).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #658      +/-   ##
==========================================
+ Coverage   96.25%   96.33%   +0.07%     
==========================================
  Files         107      112       +5     
  Lines        5772     6225     +453     
==========================================
+ Hits         5556     5997     +441     
- Misses        216      228      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@rfsaliev rfsaliev force-pushed the rfsaliev/install-mkl branch 3 times, most recently from 08d6ce0 to 6b8485e Compare April 10, 2025 17:39
@rfsaliev rfsaliev force-pushed the rfsaliev/install-mkl branch from 6b8485e to 92eae96 Compare April 10, 2025 18:16
@meiravgri meiravgri changed the title [SVS] Fix CI builds [MOD-9384] [SVS] Fix CI builds Apr 15, 2025
@rfsaliev rfsaliev force-pushed the rfsaliev/install-mkl branch from 9b08296 to 8223385 Compare April 15, 2025 08:30
Copy link
Collaborator

@meiravgri meiravgri left a comment

Choose a reason for hiding this comment

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

Thank you :)
see my comments along the code

Adiitionaly, as discussed, we should have tests for un supported platforms, verifying that vecsim fatory should returns NULL, including mac (since case VecSimAlgo_SVS: is reachble on this platform)
The tests should simulate the user exprience.

Thanks again

find_package(svs REQUIRED)
set(SVS_LVQ_HEADER "svs/extensions/vamana/lvq.h")
set(SVS_TARGET_NAME "svs::svs_shared_library")
else()
Copy link
Collaborator

Choose a reason for hiding this comment

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

in which case we expect to enter the else?

Copy link
Collaborator Author

@rfsaliev rfsaliev Apr 16, 2025

Choose a reason for hiding this comment

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

when SVS_SHARED_LIB=OFF
e.g. when user provided -DSVS_SHARED_LIB=OFF in CMAKE_FLAGS or MKL library is not installed on the system.

Copy link
Collaborator

Choose a reason for hiding this comment

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

so why do we need to compile this in this case? what capabilities are added to the library ?
add_subdirectory(
${root}/deps/ScalableVectorSearch
deps/ScalableVectorSearch
)
set(SVS_LVQ_HEADER "svs/quantization/lvq/impl/lvq_impl.h")

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This option allows to compile SVSIndex without shared library from public sources without LVQ.
But also allows to compile with LVQ using SVS private sources which contain lvq_impl.h.

find_package(svs REQUIRED)
set(SVS_LVQ_HEADER "svs/extensions/vamana/lvq.h")
set(SVS_TARGET_NAME "svs::svs_shared_library")
else()
Copy link
Collaborator

Choose a reason for hiding this comment

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

so why do we need to compile this in this case? what capabilities are added to the library ?
add_subdirectory(
${root}/deps/ScalableVectorSearch
deps/ScalableVectorSearch
)
set(SVS_LVQ_HEADER "svs/quantization/lvq/impl/lvq_impl.h")

# Valgrind does not support AVX512 and Valgrind in running in Debug
# so disable it if we are in Debug mode
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
Copy link
Collaborator

Choose a reason for hiding this comment

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

please prompt here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added status message.

@rfsaliev rfsaliev requested a review from meiravgri April 28, 2025 09:03
@meiravgri meiravgri added this pull request to the merge queue Apr 28, 2025
Merged via the queue into main with commit ed35da4 Apr 28, 2025
17 checks passed
@meiravgri meiravgri deleted the rfsaliev/install-mkl branch April 28, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants