Skip to content

Commit 12e9571

Browse files
authored
Remove non IVF runtime bindings branching (#316)
Build cpp runtime bindings with IVF in all github workflows now that it is stabilized. Set to ON anywhere the CMake flag is passed, and remove any higher level branches in .github workflows, scripts, and conda-recipe files
1 parent c563257 commit 12e9571

7 files changed

Lines changed: 69 additions & 56 deletions

File tree

.github/scripts/build-cpp-runtime-bindings.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ set -e # Exit on error
1818
# Source environment setup (for compiler)
1919
source /etc/bashrc || true
2020

21-
# Source MKL environment if IVF is enabled
22-
if [ "${ENABLE_IVF:-OFF}" = "ON" ]; then
23-
if [ -f /opt/intel/oneapi/setvars.sh ]; then
24-
source /opt/intel/oneapi/setvars.sh --include-intel-llvm 2>/dev/null || true
25-
echo "MKL sourced: MKLROOT=${MKLROOT}"
26-
else
27-
echo "ERROR: IVF enabled but MKL setvars.sh not found"
28-
exit 1
29-
fi
21+
# Source MKL environment (required for IVF)
22+
if [ -f /opt/intel/oneapi/setvars.sh ]; then
23+
source /opt/intel/oneapi/setvars.sh --include-intel-llvm 2>/dev/null || true
24+
echo "MKL sourced: MKLROOT=${MKLROOT}"
25+
else
26+
echo "ERROR: MKL setvars.sh not found"
27+
exit 1
3028
fi
3129

3230
# Create build+install directories for cpp runtime bindings
@@ -42,7 +40,7 @@ CMAKE_ARGS=(
4240
"-DCMAKE_INSTALL_PREFIX=/workspace/install_cpp_bindings"
4341
"-DCMAKE_INSTALL_LIBDIR=lib"
4442
"-DSVS_RUNTIME_ENABLE_LVQ_LEANVEC=${ENABLE_LVQ_LEANVEC:-ON}"
45-
"-DSVS_RUNTIME_ENABLE_IVF=${ENABLE_IVF:-OFF}"
43+
"-DSVS_RUNTIME_ENABLE_IVF=ON"
4644
)
4745

4846
if [ -n "$SVS_URL" ]; then
@@ -64,7 +62,7 @@ find /workspace/bindings/cpp/build_cpp_bindings -name '*.a' -delete 2>/dev/null
6462
find /workspace/bindings/cpp/build_cpp_bindings -name '*.so*' -not -path '*/tests/*' -not -name 'libsvs_runtime*' -delete 2>/dev/null || true
6563
# Use /workspace for temp files to avoid filling up /tmp during LTO compilation
6664
mkdir -p /workspace/tmp
67-
TMPDIR=/workspace/tmp ENABLE_LVQ_LEANVEC=${ENABLE_LVQ_LEANVEC:-ON} ENABLE_IVF=${ENABLE_IVF:-OFF} SVS_URL="${SVS_URL}" SUFFIX="${SUFFIX}" conda build bindings/cpp/conda-recipe --output-folder /workspace/conda-bld
65+
TMPDIR=/workspace/tmp ENABLE_LVQ_LEANVEC=${ENABLE_LVQ_LEANVEC:-ON} SVS_URL="${SVS_URL}" SUFFIX="${SUFFIX}" conda build bindings/cpp/conda-recipe --output-folder /workspace/conda-bld
6866

6967
# Create tarball with symlink for compatibility
7068
cd /workspace/install_cpp_bindings && \

.github/scripts/test-cpp-runtime-bindings.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,8 @@ conda install -y mkl=2025.3 mkl-devel=2025.3
3535
conda install -y /runtime_conda/libsvs-runtime-*.conda
3636

3737
# Validate python and C++ tests against FAISS CI
38-
ENABLE_IVF="${ENABLE_IVF:-OFF}"
39-
if [ "${ENABLE_IVF}" = "ON" ]; then
40-
echo "IVF enabled: cloning forked FAISS with IVF support"
41-
git clone --branch ib/svs_ivf https://github.com/ibhati/faiss.git
42-
else
43-
echo "IVF disabled: cloning upstream FAISS"
44-
git clone https://github.com/facebookresearch/faiss.git
45-
fi
38+
# TODO: clone main branch upon merge of https://github.com/facebookresearch/faiss/pull/4801
39+
git clone --branch ib/svs_ivf https://github.com/ibhati/faiss.git
4640
cd faiss
4741

4842
echo "==============================================="
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
# Copyright 2026 Intel Corporation
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -e
17+
18+
# Source environment setup (for compiler and MKL)
19+
source /etc/bashrc || true
20+
if [ -f /opt/intel/oneapi/setvars.sh ]; then
21+
source /opt/intel/oneapi/setvars.sh 2>/dev/null || true
22+
fi
23+
24+
CTEST_DIR="bindings/cpp/build_cpp_bindings/tests"
25+
26+
# Check if running on Intel hardware or if LVQ/LeanVec is not enabled
27+
if grep -q "GenuineIntel" /proc/cpuinfo || [ "${ENABLE_LVQ_LEANVEC}" != "ON" ]; then
28+
ctest --test-dir $CTEST_DIR --output-on-failure --no-tests=error --verbose
29+
else
30+
echo "Non-Intel CPU detected - running tests with LVQ/LeanVec XFAIL"
31+
# Run non-LVQ/LeanVec tests normally
32+
ctest --test-dir $CTEST_DIR --output-on-failure --no-tests=error --verbose -E "(LVQ|LeanVec)"
33+
34+
# Run LVQ/LeanVec tests expecting failure on non-Intel hardware
35+
set +e
36+
ctest --test-dir $CTEST_DIR --output-on-failure --verbose -R "(LVQ|LeanVec)"
37+
exit_code=$?
38+
set -e
39+
40+
if [ $exit_code -ne 0 ]; then
41+
echo "XFAIL: LVQ/LeanVec ctest tests failed as expected on non-Intel hardware"
42+
else
43+
echo "UNEXPECTED: LVQ/LeanVec ctest tests passed on non-Intel hardware"
44+
exit 1
45+
fi
46+
fi

.github/workflows/build-cpp-runtime-bindings.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,10 @@ jobs:
3838
include:
3939
- name: "with static library"
4040
enable_lvq_leanvec: "ON"
41-
enable_ivf: "OFF"
4241
suffix: ""
4342
- name: "public only"
4443
enable_lvq_leanvec: "OFF"
45-
enable_ivf: "OFF"
4644
suffix: "-public-only"
47-
- name: "IVF public only"
48-
enable_lvq_leanvec: "OFF"
49-
enable_ivf: "ON"
50-
suffix: "-ivf"
5145
fail-fast: false
5246

5347
steps:
@@ -63,7 +57,6 @@ jobs:
6357
-v ${{ github.workspace }}:/workspace \
6458
-w /workspace \
6559
-e ENABLE_LVQ_LEANVEC=${{ matrix.enable_lvq_leanvec }} \
66-
-e ENABLE_IVF=${{ matrix.enable_ivf }} \
6760
-e SUFFIX=${{ matrix.suffix }} \
6861
svs-manylinux228:latest \
6962
/bin/bash .github/scripts/build-cpp-runtime-bindings.sh
@@ -88,11 +81,9 @@ jobs:
8881
docker run --rm \
8982
-v ${{ github.workspace }}:/workspace \
9083
-w /workspace \
91-
-e ENABLE_IVF=${{ matrix.enable_ivf }} \
84+
-e ENABLE_LVQ_LEANVEC=${{ matrix.enable_lvq_leanvec }} \
9285
svs-manylinux228:latest \
93-
/bin/bash -c "source /etc/bashrc || true && \
94-
if [ \"\${ENABLE_IVF}\" = 'ON' ] && [ -f /opt/intel/oneapi/setvars.sh ]; then source /opt/intel/oneapi/setvars.sh 2>/dev/null || true; fi && \
95-
ctest --test-dir bindings/cpp/build_cpp_bindings/tests --output-on-failure --no-tests=error --verbose"
86+
/bin/bash /workspace/.github/scripts/test-cpp-runtime-unit.sh
9687
9788
# Run full test script using the built artifacts
9889
test:
@@ -104,13 +95,8 @@ jobs:
10495
include:
10596
- name: "with static library"
10697
suffix: ""
107-
enable_ivf: "OFF"
10898
- name: "public only"
10999
suffix: "-public-only"
110-
enable_ivf: "OFF"
111-
- name: "IVF public only"
112-
suffix: "-ivf"
113-
enable_ivf: "ON"
114100
fail-fast: false
115101

116102
steps:
@@ -138,6 +124,5 @@ jobs:
138124
-v ${{ github.workspace }}/runtime_conda:/runtime_conda \
139125
-w /workspace \
140126
-e SUFFIX=${{ matrix.suffix }} \
141-
-e ENABLE_IVF=${{ matrix.enable_ivf }} \
142127
svs-manylinux228:latest \
143128
/bin/bash .github/scripts/test-cpp-runtime-bindings.sh

bindings/cpp/conda-recipe/build.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,21 @@ else
2525
echo "WARNING: gcc-toolset-11 not found, proceeding without sourcing it"
2626
fi
2727

28-
# Source MKL environment if IVF is enabled (IVF requires MKL)
29-
if [ "${ENABLE_IVF:-OFF}" = "ON" ]; then
30-
if [ -f /opt/intel/oneapi/setvars.sh ]; then
31-
source /opt/intel/oneapi/setvars.sh --include-intel-llvm 2>/dev/null || true
32-
echo "MKL sourced for IVF build: MKLROOT=${MKLROOT}"
33-
else
34-
echo "ERROR: IVF enabled but MKL setvars.sh not found"
35-
exit 1
36-
fi
28+
# Source MKL environment (required for IVF)
29+
if [ -f /opt/intel/oneapi/setvars.sh ]; then
30+
source /opt/intel/oneapi/setvars.sh --include-intel-llvm 2>/dev/null || true
31+
echo "MKL sourced: MKLROOT=${MKLROOT}"
32+
else
33+
echo "ERROR: MKL setvars.sh not found"
34+
exit 1
3735
fi
3836

3937
# build runtime tests flag?
4038
CMAKE_ARGS=(
4139
"-DCMAKE_INSTALL_PREFIX=${PREFIX}"
4240
"-DSVS_BUILD_RUNTIME_TESTS=OFF"
4341
"-DSVS_RUNTIME_ENABLE_LVQ_LEANVEC=${ENABLE_LVQ_LEANVEC:-ON}"
44-
"-DSVS_RUNTIME_ENABLE_IVF=${ENABLE_IVF:-OFF}"
42+
"-DSVS_RUNTIME_ENABLE_IVF=ON"
4543
)
4644

4745
# Add SVS_URL if specified (for fetching static library)

bindings/cpp/conda-recipe/meta.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ build:
3030
skip: true # [not linux]
3131
include_recipe: False
3232
script_env:
33-
- ENABLE_IVF
3433
- ENABLE_LVQ_LEANVEC
3534
- SUFFIX
3635
- SVS_URL

bindings/cpp/tests/CMakeLists.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,8 @@ endif()
7979
include(CTest)
8080
enable_testing()
8181

82-
# Add the test to CTest
83-
add_test(NAME svs_runtime_test COMMAND svs_runtime_test)
84-
85-
# Set test properties
86-
set_tests_properties(svs_runtime_test PROPERTIES
87-
LABELS "runtime_bindings"
88-
)
89-
90-
# Optional: Add Catch2's automatic test discovery
82+
# Use Catch2's automatic test discovery to register individual test cases.
83+
# This allows ctest -E/-R filters to target specific tests (e.g., LVQ/LeanVec).
9184
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
9285
include(Catch)
9386
catch_discover_tests(svs_runtime_test)

0 commit comments

Comments
 (0)