feat: add high-performance HNSW RaBitQ index #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Unit Test | |
| # This workflow is triggered on pushes or pull request to the repository. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| # File paths to consider in the event. Optional; defaults to all. | |
| paths: | |
| - "include/**" | |
| - "python/**" | |
| - "src/**" | |
| - "thirdparty/**" | |
| - "benchmark/**" | |
| - "cmake/**" | |
| - "!cmake/libs/libcardinal.cmake" | |
| - ".github/workflows/ut.yaml" | |
| - ".github/actions/**" | |
| - "CMakeLists.txt" | |
| - "Makefile" | |
| - "conanfile.py" | |
| - "scripts/**" | |
| - "!**.md" | |
| - "tests/**" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| ut-linux: | |
| name: ut on ubuntu-22.04 | |
| runs-on: self-hosted | |
| timeout-minutes: 120 | |
| strategy: | |
| fail-fast: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'none' | |
| - name: Install Dependency | |
| run: | | |
| bash scripts/install_deps.sh | |
| sudo pip3 install cmake==3.28.1 | |
| - name: Restore Cache | |
| uses: ./.github/actions/cache-restore | |
| with: | |
| os: ubuntu-22.04 | |
| - name: Build | |
| run: | | |
| make WITH_UT=True WITH_ASAN=True | |
| make test | |
| - name: Save Cache | |
| uses: ./.github/actions/cache-save | |
| with: | |
| os: ubuntu-22.04 | |
| ut-macos: | |
| name: ut on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 180 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-15] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'none' | |
| - name: Install Dependency | |
| run: | | |
| bash scripts/install_deps.sh | |
| - name: Restore Cache | |
| uses: ./.github/actions/cache-restore | |
| with: | |
| os: ${{ matrix.os }} | |
| - name: Build | |
| run: | | |
| # CMake 4.x (Homebrew) removed compat with cmake_minimum_required < 3.5; | |
| # some Conan recipes (e.g. bzip2/1.0.8) still use older values. | |
| export CMAKE_POLICY_VERSION_MINIMUM=3.5 | |
| make WITH_UT=True | |
| - name: Test | |
| run: | | |
| make test | |
| - name: Save Cache | |
| uses: ./.github/actions/cache-save | |
| with: | |
| os: ${{ matrix.os }} | |
| swig-build: | |
| name: python3 wheel | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 180 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'none' | |
| - name: Setup Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: "3.10" | |
| - name: Install Dependency | |
| run: | | |
| bash scripts/install_deps.sh | |
| python -m pip install pytest 'numpy>=2,<3' ml-dtypes faiss-cpu | |
| - name: Install GCC 12 | |
| # GCC 11 (ubuntu-22.04 default) has incomplete C++20 support: | |
| # std::partial_ordering, std::strong_ordering, std::weak_ordering | |
| # from <compare> are not available, causing abseil build failures. | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-12 g++-12 | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 120 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 120 | |
| conan profile detect --force | |
| - name: Restore Cache | |
| uses: ./.github/actions/cache-restore | |
| with: | |
| os: ubuntu-22.04 | |
| - name: Build | |
| run: | | |
| make | |
| - name: Save Cache | |
| uses: ./.github/actions/cache-save | |
| with: | |
| os: ubuntu-22.04 | |
| - name: Build Portable Wheel | |
| run: | | |
| cd python && ./build_portable_wheel.sh | |
| - name: Install Wheel | |
| run: | | |
| cd python && pip3 install dist/*-manylinux*.whl | |
| - name: Test | |
| run: | | |
| python -m pytest tests/python/test_index_with_random.py |