Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
b182f54
Initial implementation of SVS Runtime package
rfsaliev Oct 30, 2025
af23806
Initial support for private source
ethanglaser Oct 31, 2025
2e820ed
Point SVS_URL to LTO-enabled tarball
ethanglaser Oct 31, 2025
d35d7e3
Improve svs_runtime CMakeLists.txt to use pre-defined LVQ heades and …
rfsaliev Oct 31, 2025
55095a2
Fixup C++ runtime CMakeLists for internal build
rfsaliev Oct 31, 2025
dd1324d
Apply formatting
rfsaliev Oct 31, 2025
40177d8
Re-add private source build condition
ethanglaser Oct 31, 2025
9d9643b
Add pipeline to build cpp bindings
ethanglaser Oct 31, 2025
88032d3
rename bash script
ethanglaser Oct 31, 2025
c9d2170
add steps to fix yaml error
ethanglaser Oct 31, 2025
2968bb1
Change runs-on to ubuntu-22.04
ethanglaser Oct 31, 2025
a409a4a
Add missing repo checkout
ethanglaser Nov 3, 2025
3549b4e
clean up copyright/docker files
ethanglaser Nov 3, 2025
3510961
set CMAKE_INSTALL_LIBDIR
ethanglaser Nov 3, 2025
d1918a5
Add flexibility to gcc version check 11.2.*
ethanglaser Nov 3, 2025
5622713
Add resuable function for linking statically to MKL
ethanglaser Nov 4, 2025
07bebdd
Initial faiss python test validation
ethanglaser Nov 4, 2025
aa5c4d9
Improved runtime API draft in new header
rfsaliev Nov 4, 2025
ce44171
Update API header with comments
rfsaliev Nov 4, 2025
e4cf769
Fix upload path
ethanglaser Nov 4, 2025
0dfacfc
Actually fix upload path
ethanglaser Nov 4, 2025
7fd8e81
Add conda env creation
ethanglaser Nov 4, 2025
7ac6519
Add faiss c++ tests
ethanglaser Nov 5, 2025
da8ce1a
First implementation of the improved runtime Vamana API
rfsaliev Nov 19, 2025
9c2aaa0
Fix `LeanVecTrainingData` API
rfsaliev Nov 6, 2025
454b682
Refactored VamanaIndex implementation code
rfsaliev Nov 6, 2025
a834e5a
Fix non-filtered case in `DynamicVamanaIndex::search()`
rfsaliev Nov 6, 2025
851e1ce
Add new `FlatIndex` API and fix abstract interface descructors
rfsaliev Nov 6, 2025
e11e3d3
Update static library tarball
ethanglaser Nov 6, 2025
e3ae09c
feature: add version namespace
yuejiaointel Nov 7, 2025
9e5e09d
fix: add version.h to cmake
yuejiaointel Nov 7, 2025
2ee3c71
Replace macros with runtime_error_wrapper() for error handling (#214)
ahuber21 Nov 7, 2025
260bd38
Clang-format
rfsaliev Nov 7, 2025
96410aa
Fix Flat index wrapper and LeanVec Training
rfsaliev Nov 7, 2025
876e1b8
Inline versioning namespace
rfsaliev Nov 7, 2025
463e4f3
Remove outdated SVS Runtime code
rfsaliev Nov 7, 2025
f2151fe
Improve Status structure to avoid potential memory leaks
rfsaliev Nov 7, 2025
c36101c
Move public headers to svs/runtime subdir
rfsaliev Nov 7, 2025
50e88dd
Fix Status linkage visibility
rfsaliev Nov 7, 2025
a60b330
Fix non-LVQ failures on non-Intel platforms
rfsaliev Nov 7, 2025
45ac2db
Update static library/tarball to latest
ethanglaser Nov 7, 2025
d390fda
Avoid passing exact same LeanVecMatricesType args
ethanglaser Nov 7, 2025
13737cc
Fix "<mkl.h> not found" compilation error
rfsaliev Nov 7, 2025
f954ce6
Update static library tarball link
ethanglaser Nov 7, 2025
e7cf948
Clean up docker and pipeline
ethanglaser Nov 8, 2025
bbb8c7f
Pull svs-io branch for validation
ethanglaser Nov 10, 2025
026dc53
Code review s1e1
rfsaliev Nov 12, 2025
02e3d5b
Add supported storage kind query for index and remove "fallback" mode…
rfsaliev Nov 17, 2025
295134a
test(runtime): add initial set of runtime tests (#218)
ahuber21 Nov 17, 2025
d1a5155
fix is_supported_storage_kind() implementation
ahuber21 Nov 19, 2025
48f2d5f
update SVS_URL
ahuber21 Nov 19, 2025
16428b4
Fixup gitignore
rfsaliev Nov 19, 2025
e099248
fixup tests according svs::runtime::v0::ResultsAllocator changes
rfsaliev Nov 19, 2025
0566ca4
Update comments according to code review
rfsaliev Nov 19, 2025
dff0b96
Update tarball
ethanglaser Nov 19, 2025
eafc674
update test filter
ahuber21 Nov 20, 2025
1d6d23f
fix DynamicVamanaIndex::check_storage_kind() implementation
ahuber21 Nov 20, 2025
ee0168d
Add runtime tests to pipeline
ethanglaser Nov 21, 2025
618a449
remove custom allocator for assemble
ahuber21 Nov 26, 2025
e643504
fix loader forwarding
ahuber21 Nov 26, 2025
adcd2cb
Refactor SVS runtime to support public sources-only build.
rfsaliev Nov 27, 2025
2284227
Address default index parameters code review issue
rfsaliev Nov 27, 2025
f9df456
Add fully public build + validation to pipeline
ethanglaser Dec 1, 2025
702c4ee
Merge branch 'main' into rfsaliev/cpp-runtime-binding
ethanglaser Dec 3, 2025
9e9c5f3
Add SetIfSpecifiedUtility test
rfsaliev Dec 4, 2025
ce0e957
Clean up CI scripts
ethanglaser Dec 10, 2025
d4ad7f4
Merge branch 'main' into rfsaliev/cpp-runtime-binding
ethanglaser Dec 10, 2025
b15037f
fix codefactor warnings
ahuber21 Dec 10, 2025
9f301eb
Minor updates and cleanup
ethanglaser Dec 11, 2025
fa29dc3
Merge branch 'rfsaliev/cpp-runtime-binding' of https://github.com/int…
ethanglaser Dec 11, 2025
862c6aa
revert specifying deps versions
ethanglaser Dec 11, 2025
c14fa9b
Add newline to eof
ethanglaser Dec 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions bindings/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ set(SVS_RUNTIME_HEADERS
set(SVS_RUNTIME_SOURCES
src/svs_runtime_utils.h
src/dynamic_vamana_index_impl.h
src/dynamic_vamana_index_leanvec_impl.h
src/training_impl.h
src/flat_index_impl.h
src/api_defs.cpp
src/training.cpp
Expand Down Expand Up @@ -72,16 +74,16 @@ set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON)
set_target_properties(${TARGET_NAME} PROPERTIES CXX_EXTENSIONS OFF)
set_target_properties(${TARGET_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} )

if(DEFINED SVS_LVQ_HEADER AND DEFINED SVS_LEANVEC_HEADER)
# expected that pre-defined headers are implementation headers
message(STATUS "Using pre-defined LVQ header: ${SVS_LVQ_HEADER}")
message(STATUS "Using pre-defined LeanVec header: ${SVS_LEANVEC_HEADER}")
else()
set(SVS_LVQ_HEADER "svs/extensions/vamana/lvq.h")
set(SVS_LEANVEC_HEADER "svs/extensions/vamana/leanvec.h")
endif()

if (SVS_RUNTIME_ENABLE_LVQ_LEANVEC)
if(DEFINED SVS_LVQ_HEADER AND DEFINED SVS_LEANVEC_HEADER)
# expected that pre-defined headers are implementation headers
message(STATUS "Using pre-defined LVQ header: ${SVS_LVQ_HEADER}")
message(STATUS "Using pre-defined LeanVec header: ${SVS_LEANVEC_HEADER}")
else()
set(SVS_LVQ_HEADER "svs/extensions/vamana/lvq.h")
set(SVS_LEANVEC_HEADER "svs/extensions/vamana/leanvec.h")
endif()

if(RUNTIME_BINDINGS_PRIVATE_SOURCE_BUILD)
message(STATUS "Building directly from private sources")
target_link_libraries(${TARGET_NAME} PRIVATE
Expand Down Expand Up @@ -117,7 +119,7 @@ if (SVS_RUNTIME_ENABLE_LVQ_LEANVEC)
FetchContent_Declare(
svs
URL ${SVS_URL}
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_MakeAvailable(svs)
list(APPEND CMAKE_PREFIX_PATH "${svs_SOURCE_DIR}")
Expand Down
40 changes: 40 additions & 0 deletions bindings/cpp/include/svs/runtime/api_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,46 @@ struct SVS_RUNTIME_API Status {
}
}

Status(const Status& other)
: code(other.code)
, message_storage_(nullptr) {
if (other.message_storage_ != nullptr) {
store_message(other.message_storage_);
}
}

Status& operator=(const Status& other) {
if (this != &other) {
code = other.code;
if (message_storage_ != nullptr) {
destroy_message();
}
message_storage_ = nullptr;
if (other.message_storage_ != nullptr) {
store_message(other.message_storage_);
}
}
return *this;
}

Status(Status&& other) noexcept
: code(other.code)
, message_storage_(other.message_storage_) {
other.message_storage_ = nullptr;
}

Status& operator=(Status&& other) noexcept {
if (this != &other) {
code = other.code;
if (message_storage_ != nullptr) {
destroy_message();
}
message_storage_ = other.message_storage_;
other.message_storage_ = nullptr;
}
return *this;
}

constexpr ~Status() noexcept {
if (message_storage_ != nullptr) {
destroy_message();
Expand Down
53 changes: 35 additions & 18 deletions bindings/cpp/src/dynamic_vamana_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#include "dynamic_vamana_index_impl.h"
#include "svs_runtime_utils.h"

#ifdef SVS_LEANVEC_HEADER
#include "dynamic_vamana_index_leanvec_impl.h"
#endif

#include <algorithm>
#include <memory>
#include <variant>
Expand All @@ -27,15 +31,11 @@
#include <svs/core/data.h>
#include <svs/core/distance.h>
#include <svs/core/query_result.h>
#include <svs/cpuid.h>
#include <svs/extensions/vamana/scalar.h>
#include <svs/lib/float16.h>
#include <svs/orchestrators/dynamic_vamana.h>
#include <svs/quantization/scalar/scalar.h>

#include SVS_LVQ_HEADER
#include SVS_LEANVEC_HEADER

namespace svs {
namespace runtime {

Expand Down Expand Up @@ -117,11 +117,6 @@ struct DynamicVamanaIndexManagerBase : public DynamicVamanaIndex {
return runtime_error_wrapper([&] { impl_->save(out); });
}
};

using DynamicVamanaIndexManager = DynamicVamanaIndexManagerBase<DynamicVamanaIndexImpl>;
using DynamicVamanaIndexLeanVecImplManager =
DynamicVamanaIndexManagerBase<DynamicVamanaIndexLeanVecImpl>;

} // namespace

// DynamicVamanaIndex interface implementation
Expand Down Expand Up @@ -149,12 +144,13 @@ Status DynamicVamanaIndex::build(
const DynamicVamanaIndex::BuildParams& params,
const DynamicVamanaIndex::SearchParams& default_search_params
) noexcept {
using Impl = DynamicVamanaIndexImpl;
*index = nullptr;
return runtime_error_wrapper([&] {
auto impl = std::make_unique<DynamicVamanaIndexImpl>(
auto impl = std::make_unique<Impl>(
dim, metric, storage_kind, params, default_search_params
);
*index = new DynamicVamanaIndexManager{std::move(impl)};
*index = new DynamicVamanaIndexManagerBase<Impl>{std::move(impl)};
});
}

Expand All @@ -168,14 +164,15 @@ Status DynamicVamanaIndex::load(
MetricType metric,
StorageKind storage_kind
) noexcept {
using Impl = DynamicVamanaIndexImpl;
*index = nullptr;
return runtime_error_wrapper([&] {
std::unique_ptr<DynamicVamanaIndexImpl> impl{
DynamicVamanaIndexImpl::load(in, metric, storage_kind)};
*index = new DynamicVamanaIndexManager{std::move(impl)};
std::unique_ptr<Impl> impl{Impl::load(in, metric, storage_kind)};
*index = new DynamicVamanaIndexManagerBase<Impl>{std::move(impl)};
});
}

#ifdef SVS_LEANVEC_HEADER
// Specialization to build LeanVec-based Vamana index with specified leanvec dims
Status DynamicVamanaIndexLeanVec::build(
DynamicVamanaIndex** index,
Expand All @@ -186,12 +183,13 @@ Status DynamicVamanaIndexLeanVec::build(
const DynamicVamanaIndex::BuildParams& params,
const DynamicVamanaIndex::SearchParams& default_search_params
) noexcept {
using Impl = DynamicVamanaIndexLeanVecImpl;
*index = nullptr;
return runtime_error_wrapper([&] {
auto impl = std::make_unique<DynamicVamanaIndexLeanVecImpl>(
auto impl = std::make_unique<Impl>(
dim, metric, storage_kind, leanvec_dims, params, default_search_params
);
*index = new DynamicVamanaIndexLeanVecImplManager{std::move(impl)};
*index = new DynamicVamanaIndexManagerBase<Impl>{std::move(impl)};
});
}

Expand All @@ -205,16 +203,35 @@ Status DynamicVamanaIndexLeanVec::build(
const DynamicVamanaIndex::BuildParams& params,
const DynamicVamanaIndex::SearchParams& default_search_params
) noexcept {
using Impl = DynamicVamanaIndexLeanVecImpl;
*index = nullptr;
return runtime_error_wrapper([&] {
auto training_data_impl =
static_cast<const LeanVecTrainingDataManager*>(training_data)->impl_;
auto impl = std::make_unique<DynamicVamanaIndexLeanVecImpl>(
auto impl = std::make_unique<Impl>(
dim, metric, storage_kind, training_data_impl, params, default_search_params
);
*index = new DynamicVamanaIndexLeanVecImplManager{std::move(impl)};
*index = new DynamicVamanaIndexManagerBase<Impl>{std::move(impl)};
});
}

#else // SVS_LEANVEC_HEADER
// LeanVec storage kind is not supported in this build configuration
Status DynamicVamanaIndexLeanVec::
build(DynamicVamanaIndex**, size_t, MetricType, StorageKind, size_t, const DynamicVamanaIndex::BuildParams&, const DynamicVamanaIndex::SearchParams&) noexcept {
return Status(
ErrorCode::NOT_IMPLEMENTED,
"DynamicVamanaIndexLeanVec is not supported in this build configuration."
);
}

Status DynamicVamanaIndexLeanVec::
build(DynamicVamanaIndex**, size_t, MetricType, StorageKind, const LeanVecTrainingData*, const DynamicVamanaIndex::BuildParams&, const DynamicVamanaIndex::SearchParams&) noexcept {
return Status(
ErrorCode::NOT_IMPLEMENTED,
"DynamicVamanaIndexLeanVec is not supported in this build configuration."
);
}
#endif // SVS_LEANVEC_HEADER
} // namespace runtime
} // namespace svs
Loading
Loading