Skip to content

Commit 6533a60

Browse files
author
Mark Hildebrand
authored
SVS v0.0.3 (#19)
1 parent b7e5488 commit 6533a60

File tree

264 files changed

+30867
-4989
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+30867
-4989
lines changed
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
# SPDX-FileCopyrightText: 2020 Intel Corporation
4+
#
5+
# SPDX-License-Identifier: MIT
6+
#
7+
# Taken from: https://github.com/oneapi-src/oneapi-ci
8+
9+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
10+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
11+
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
12+
sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/oneAPI.list" -o APT::Get::List-Cleanup="0"

.github/workflows/build-docs.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ jobs:
2828

2929
- name: Install Dependencies
3030
run: |
31-
sudo apt install -y doxygen
31+
.github/scripts/setup_apt_repo_linux.sh
32+
sudo apt install -y doxygen intel-oneapi-mkl intel-oneapi-mkl-devel
33+
# See notes in `build_linux.yml` about persisting MKL environment variables.
34+
source /opt/intel/oneapi/setvars.sh
35+
printenv >> $GITHUB_ENV
3236
pip install \
3337
archspec \
3438
scikit-build \

.github/workflows/build-linux.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
build_type: [Release]
23+
build_type: [RelWithDebugInfo]
2424
cxx: [g++-11, g++-12, clang++-15]
2525
include:
2626
- cxx: g++-11
@@ -32,6 +32,16 @@ jobs:
3232

3333
steps:
3434
- uses: actions/checkout@v4
35+
- name: Install MKL
36+
timeout-minutes: 5
37+
run: |
38+
.github/scripts/setup_apt_repo_linux.sh
39+
sudo apt install intel-oneapi-mkl intel-oneapi-mkl-devel
40+
# Setup environment variables for building against MKL.
41+
# Persist the environment variables for use across multiple subsequent actions.
42+
source /opt/intel/oneapi/setvars.sh
43+
printenv >> $GITHUB_ENV
44+
3545
- name: Configure build
3646
working-directory: ${{ runner.temp }}
3747
env:
@@ -44,6 +54,7 @@ jobs:
4454
-DSVS_BUILD_BINARIES=YES \
4555
-DSVS_BUILD_TESTS=YES \
4656
-DSVS_BUILD_EXAMPLES=YES \
57+
-DSVS_EXPERIMENTAL_LEANVEC=YES \
4758
-DSVS_NO_AVX512=NO
4859
4960
- name: Build Tests and Utilities

.github/workflows/cibuildwheel.yml

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17+
- name: Build Container
18+
run: |
19+
cd ${GITHUB_WORKSPACE}/docker/x86_64/manylinux2014
20+
./build.sh
21+
1722
- name: Install cibuildwheel
1823
run: python -m pip install cibuildwheel
1924

.github/workflows/deploy-docs.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ jobs:
3434

3535
- name: Install Dependencies
3636
run: |
37-
sudo apt install -y doxygen
37+
.github/scripts/setup_apt_repo_linux.sh
38+
sudo apt install -y doxygen intel-oneapi-mkl intel-oneapi-mkl-devel
3839
pip install \
3940
archspec \
4041
scikit-build \

CMakeLists.txt

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.18)
1+
cmake_minimum_required(VERSION 3.21)
22

33
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")
44

@@ -9,7 +9,7 @@ project(svs
99
# - /bindings/python/tests/test_common.py
1010
# Manually keep in-sync with:
1111
# - /bindings/python/setup.py
12-
VERSION 0.0.1
12+
VERSION 0.0.3
1313
)
1414

1515
set(SVS_LIB svs_devel)
@@ -57,6 +57,14 @@ include("cmake/robin-map.cmake")
5757
include("cmake/fmt.cmake")
5858
include("cmake/toml.cmake")
5959

60+
# LeanVec requires MKL support
61+
if(SVS_EXPERIMENTAL_LEANVEC)
62+
include("cmake/mkl.cmake")
63+
target_compile_options(${SVS_LIB} INTERFACE "-DSVS_HAVE_MKL=1")
64+
else()
65+
target_compile_options(${SVS_LIB} INTERFACE "-DSVS_HAVE_MKL=0")
66+
endif()
67+
6068
#####
6169
##### Build Objects
6270
#####
@@ -82,7 +90,7 @@ endif()
8290
#
8391
# If only the unit tests are enabled, then the benchmark will be built as a minimal
8492
# component to avoid excessive compilation time.
85-
if(SVS_BUILD_BENCHMARK OR SVS_BUILD_TESTS)
93+
if(SVS_BUILD_BENCHMARK OR SVS_BUILD_TESTS OR SVS_BUILD_BENCHMARK_TEST_GENERATORS)
8694
add_subdirectory(benchmark)
8795
endif()
8896

HISTORY.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# SVS 0.0.2 Release Notes
2+
3+
## `pysvs` (Python)
4+
5+
* Deprecated `num_threads` keyword argument from `pysvs.VamanaBuildParameters` and added
6+
`num_threads` keyword to `pysvs.Vamana.build`.
7+
* Exposed the `prune_to` parameter for `pysvs.VamanaBuildParameters` (see description below
8+
for an explanation of this change).
9+
* Added preliminary support for building `pysvs.Flat` and `pysvs.Vamana` directly from
10+
`np.float16` arrays.
11+
12+
## `libsvs` (C++)
13+
14+
### Breaking Changes
15+
16+
* Removed `nthreads` member of `VamanaBuildParameters` and added the number of threads as
17+
an argument to `svs::Vamana::build`/`svs::Vamana::build`.
18+
* Added a `prune_to` argument to `VamanaBuildParameters`. This can be set to a value less
19+
than graph_max_degree (heuristically, setting this to be 4 less is a good trade-off
20+
between accuracy and speed). When pruning is performed, this parameter is used to
21+
determine the number of candidates to generate after pruning. Setting this less than
22+
`graph_max_degree` greatly reduces the time spent when managing backedges.
23+
* Improved pruning rules for Euclidean and InnerProduct. Vamana index construction should
24+
be faster and yield slightly improved indexes.
25+
* Added an experimental external-threading interface to `svs::index::VamanaIndex`.
26+
* Overhauled extension mechanisms using a `tag_invoke` style approach. This decouples the
27+
`svs::index::VamanaIndex` implementation from extensions like LVQ, reducing header
28+
dependence and improving precision of algorithm customization.
29+
30+
### Save/Load API
31+
* Enabled context-free saving and loading of simple data structures. This allows simple
32+
data structures to be saved and reloaded from TOML files without requiring access to the
33+
saving/loading directory. Classes implementing this saving and loading allow for more
34+
flexible storage.
35+
* Overhauled the implementation of saving and loading to enable more scalable implementation.
36+
* `svs::data::SimpleData` family of data structures are now directly saveable and loadable
37+
and no longer require proxy-classes.
38+
39+
**Breaking Serialization Changes**
40+
41+
* Changed LVQ-style datasets from `v0.0.1` to `v0.0.2`: Removed centroids from being stored
42+
with the ScaledBiasedCompressedDataset. Centroids are now stored in the higher level LVQ
43+
dataset.
44+
45+
### Back-end Changes
46+
47+
Changes to library internals that do not necessarily affect the top level API but could
48+
affect performance or users relying on internal APIs.
49+
50+
* Improved the performance of the LVQ inner-product implementation.
51+
* Moved dynamic uispatcher from the Python bindings into `libsvs`.
52+
* Data structure loading has been augmented with the `svs::lib::Lazy` class, allowing for
53+
arbitrary deferred work to be executed when loading data structures.
54+
* Removed the old "access mode" style API for multi-level datasets, instead using
55+
`tag_invoke` for customization.
56+
* Reduced binary footprint by removing `std::function` use for general multi-threaded
57+
functions.
58+
* Updated `ANNException` to use `fmtlib` style message directly rather than `std::ostream`
59+
style overloading. The new syntax turns
60+
```c++
61+
ANNEXCEPTION("Expected ", a, ", got ", b, "!");
62+
```
63+
to
64+
```c++
65+
ANNEXCEPTION("Expected {}, got {}!", a, b);
66+
```
67+
68+
## Binaries and Utilities
69+
70+
* Added a benchmarking framework in `/benchmark` to automatically run and aggregate index
71+
construction and search for large scale benchmarks. Documentation is currently sparse
72+
but planned.
73+
74+
## Third Party
75+
76+
* Bump [fmtlib](https://github.com/fmtlib/fmt) from 9.1.0 to 10.1.1.
77+

0 commit comments

Comments
 (0)