diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b1d103f..2649d66d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) -project(RaBitQLib VERSION 0.8.2 LANGUAGES CXX) +project(RaBitQLib VERSION 0.8.3 LANGUAGES CXX) include(CMakePackageConfigHelpers) include(GNUInstallDirs) diff --git a/README.md b/README.md index a339c09b..bcaa815f 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,14 @@ approximate nearest-neighbor search. See the [research papers](https://vectordb- ## News +- **v0.8.3:** provisional `rabitqlib.quant` module: rotate, quantize, pack and score + RaBitQ codes stored outside an index + ([notes](https://vectordb-ntu.github.io/RaBitQ-Library/releases/0.8.3/)). - **v0.8.2:** three lines to an index: the first `add` trains, `nbits` defaults to 7 and search settings are optional; faster IVF-RaBitQ `add` ([notes](https://vectordb-ntu.github.io/RaBitQ-Library/releases/0.8.2/)). - **v0.8.1:** the default `num_threads=0` respects `OMP_NUM_THREADS`, fixing a macOS crash alongside Faiss and PyTorch ([notes](https://vectordb-ntu.github.io/RaBitQ-Library/releases/0.8.1/)). -- **v0.8.0:** Faiss-style `train`, `add` and `search` for all Python indexes; 0.7 calls - stay as deprecated forms until 0.9 ([notes](https://vectordb-ntu.github.io/RaBitQ-Library/releases/0.8.0/)). Earlier versions: [all releases](https://github.com/VectorDB-NTU/RaBitQ-Library/releases). @@ -61,7 +62,7 @@ settings, and limitations. ### Python ```bash -python -m pip install --upgrade "rabitqlib>=0.8.2" +python -m pip install --upgrade "rabitqlib>=0.8.3" ``` Wheels support CPython 3.11–3.14 on Linux x86-64/ARM64, Windows x86-64, diff --git a/docs/docs/cpp_integration.md b/docs/docs/cpp_integration.md index 9083df75..0ee29128 100644 --- a/docs/docs/cpp_integration.md +++ b/docs/docs/cpp_integration.md @@ -58,12 +58,12 @@ The core example is built as the `core_example` CMake target. For the GIST bench The [core quantization v1 API](rabitq/core_api.md) has a C++ source-compatibility contract. Other C++ APIs may evolve, and no cross-version C++ binary ABI is promised. -Pin the `v0.8.2` release and include RaBitQ-Library as a Git submodule: +Pin the `v0.8.3` release and include RaBitQ-Library as a Git submodule: ```bash git submodule add https://github.com/VectorDB-NTU/RaBitQ-Library.git third_party/rabitqlib git submodule update --init --recursive -git -C third_party/rabitqlib checkout v0.8.2 +git -C third_party/rabitqlib checkout v0.8.3 git add third_party/rabitqlib ``` diff --git a/docs/docs/index.md b/docs/docs/index.md index b4d22a87..526ff20d 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -26,7 +26,7 @@ estimation into your own C++ search engine.

```bash -python -m pip install "rabitqlib>=0.8.2" +python -m pip install "rabitqlib>=0.8.3" ``` [Installation and supported platforms](installation.md) · @@ -112,5 +112,5 @@ on your own dataset when choosing an index. ## Explore further - [Algorithm overview](rabitq/rabitq.md) for the rotation, encoding, and scoring workflow. -- [RaBitQ Library 0.8.2 release notes](releases/0.8.2.md) for the latest changes and upgrade guidance. +- [RaBitQ Library 0.8.3 release notes](releases/0.8.3.md) for the latest changes and upgrade guidance. - [Papers and citations](papers.md) for the original RaBitQ method, its multi-bit extension, and SymphonyQG. diff --git a/docs/docs/installation.md b/docs/docs/installation.md index e58411e2..bebed9f3 100644 --- a/docs/docs/installation.md +++ b/docs/docs/installation.md @@ -1,6 +1,6 @@ # Installation -Platform requirements and source installation for RaBitQ Library **0.8.2**. +Platform requirements and source installation for RaBitQ Library **0.8.3**. For the first Python example, see [Quick Start](quick_start.md). ## Requirements @@ -40,7 +40,7 @@ build can use scalar kernels without the FastScan CPU baseline. ## Python wheels ```bash -python -m pip install "rabitqlib>=0.8.2" +python -m pip install "rabitqlib>=0.8.3" ``` For changes from 0.6.0, see the [0.7.0 upgrade notes](releases/0.7.0.md). @@ -61,11 +61,11 @@ importing those classes. Array shapes and parameter ranges are still checked at ## Get the source -For Python source builds or C++ use, obtain the 0.8.2 checkout once. With Git +For Python source builds or C++ use, obtain the 0.8.3 checkout once. With Git installed, run: ```bash -git clone --branch v0.8.2 --depth 1 https://github.com/VectorDB-NTU/RaBitQ-Library.git +git clone --branch v0.8.3 --depth 1 https://github.com/VectorDB-NTU/RaBitQ-Library.git cd RaBitQ-Library ``` diff --git a/docs/docs/quick_start.md b/docs/docs/quick_start.md index b573bcfd..99032928 100644 --- a/docs/docs/quick_start.md +++ b/docs/docs/quick_start.md @@ -1,14 +1,14 @@ # Quick start Build, search, save and reload a small IVF-RaBitQ index with Python. This guide describes -**0.8.2** and uses synthetic data, so no dataset download is required. Coming from 0.7? +**0.8.3** and uses synthetic data, so no dataset download is required. Coming from 0.7? See the [migration guide](python_migration.md). For C++, go directly to [C++ integration](cpp_integration.md). ## Install ```bash -python -m pip install "rabitqlib>=0.8.2" +python -m pip install "rabitqlib>=0.8.3" ``` Wheels support CPython 3.11–3.14 on Linux x86-64/ARM64, Windows x86-64 and diff --git a/docs/docs/releases/0.8.3.md b/docs/docs/releases/0.8.3.md new file mode 100644 index 00000000..3c807ef3 --- /dev/null +++ b/docs/docs/releases/0.8.3.md @@ -0,0 +1,62 @@ +# RaBitQ Library 0.8.3 + +This release adds `rabitqlib.quant`, a provisional Python module with the +quantization building blocks behind the indexes. Use it to store RaBitQ codes in +your own database or file format and to score them with your own candidate +selection, without building an index. Existing APIs, defaults, results and index +files are unchanged. + +```python +from rabitqlib import quant + +rot = quant.Rotator(dim, seed=42) +residuals = rot.rotate(data) - centroid # centroid in the rotated space +codes = quant.quantize(residuals, nbits=4) +factors = quant.code_factors(residuals, codes, nbits=4, metric="l2", centroid=centroid) +``` + +See [Python building blocks](../rabitq/quant_python.md) for encoding, two-stage +estimation with error bounds, refinement and FastScan. + +## Python changes + +- New module `rabitqlib.quant`, imported explicitly with + `from rabitqlib import quant`; `import rabitqlib` does not load it. + - Rotation: `Rotator` (seeded FHT-Kac or matrix rotation) with `rotate`, + `to_bytes`/`from_bytes`, copying and pickling; `padded_dim`. + - Encoding: `quantize`, `split` (prefix and extra bits), `code_factors`, + `pack_codes`/`unpack_codes`. + - Estimation: `Query` with `estimate_bitset`, `estimate_codes`, `refine`, + `refine_packed` and `set_centroid`; `query_terms` and `estimate_from_ip` for + inner products from your own kernel. + - FastScan: `pack_fastscan_blocks` and `Query.estimate_fastscan`, which need + AVX2 with FMA, AVX-512 or NEON. +- The module is provisional in the sense of + [PEP 411](https://peps.python.org/pep-0411/): any minor release may change it, + with a note in the release notes. +- Its byte formats (packed codes, factor records, FastScan blocks and rotator + blobs) are versioned from the start and frozen by golden files. Bytes of an + unknown version raise `quant.FormatError`, a subclass of `ValueError`. +- Every array-returning call accepts `out=` and `num_threads` (all CPUs by + default for build-side calls, one for scoring calls), and the GIL is released + during computation. Invalid inputs raise + `ValueError` and name the first failing row whatever the thread count; values + not representable in float32 raise `OverflowError`. + +## C++ changes + +- New provisional header `rabitqlib/core/provisional/quantize.hpp` with + `rabitqlib::quant::provisional::combined_code` and `code_factors`, which back + `rabitqlib.quant`. It is not part of the stable v1 API and may change in any + minor release. +- `quant::v1` results are unchanged. + +## Upgrading + +From 0.8.2, index file formats, the stable core API v1 and existing Python +signatures are unchanged; this release only adds the module and header above. +Rebuild C++ consumers with matching headers and libraries; no cross-version C++ +binary ABI is promised. + +When upgrading from 0.7, follow the [0.8.0 release notes](0.8.0.md) and the +[migration guide](../python_migration.md). diff --git a/docs/docs/releases/unreleased.md b/docs/docs/releases/unreleased.md deleted file mode 100644 index d2ec380a..00000000 --- a/docs/docs/releases/unreleased.md +++ /dev/null @@ -1,10 +0,0 @@ -# Unreleased - -## Python changes - -- New provisional module `rabitqlib.quant` with the quantization building blocks behind the indexes: `Rotator` (seeded FHT/Kac or matrix rotation, persisted with `to_bytes`/`from_bytes`), `quantize`, `split`, `code_factors`, `pack_codes`/`unpack_codes`, the `Query` estimators and refinement, `query_terms`/`estimate_from_ip`, and FastScan blocks with `pack_fastscan_blocks`/`Query.estimate_fastscan`. It is provisional in the sense of PEP 411: any minor release may change it, with a note here. Import it explicitly with `from rabitqlib import quant`. See [Python building blocks](../rabitq/quant_python.md). -- Its byte formats (packed codes, factor records, FastScan blocks and rotator blobs) are versioned from the start and frozen by golden files; bytes of an unknown version raise `quant.FormatError`, a subclass of `ValueError`. - -## C++ changes - -- New provisional header `rabitqlib/core/provisional/quantize.hpp` with `rabitqlib::quant::provisional::combined_code` and `code_factors`, which back `rabitqlib.quant`. It is not part of the stable v1 API and may change in any minor release. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index ec9001d2..a1dfd332 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -14,8 +14,8 @@ nav: - C++ Integration: cpp_integration.md # Group by minor version: nested groups stay collapsed except the current page's. - Release notes: - - Unreleased: releases/unreleased.md - "0.8": + - "0.8.3": releases/0.8.3.md - "0.8.2": releases/0.8.2.md - "0.8.1": releases/0.8.1.md - "0.8.0": releases/0.8.0.md diff --git a/pyproject.toml b/pyproject.toml index c5bc4c9c..b49a9106 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build" [project] name = "rabitqlib" -version = "0.8.2" +version = "0.8.3" description = "Official RaBitQ library for vector quantization and approximate nearest-neighbor search" readme = "README.md" requires-python = ">=3.11"