octex
octex (Octa Explosion) is billion-scale approximate nearest-neighbor search on NVIDIA GPUs by precomputed lattice
neighbor lists. It holds hundreds of randomly projected copies of the dataset in GPU memory. Every copy rounds its
vectors to the eight-dimensional E8 lattice and stores, for every populated cell, the list of vectors nearest to its
center. A query reads the lists of its cells in all copies at once and then, in a fixed number of waves, the precomputed
neighbor lists of its best hits. An int8 sketch ranks every candidate before one exact fp16 rerank, and the whole search
of a batch runs as CUDA graphs over all GPUs of a server. octex is pure CUDA C++ laid out as a cuVS module
(cuvs::neighbors::octex), with a Python package that keeps the calls of cuVS and Faiss.
Benchmarks
Throughput at recall@10 >= 0.99 on four H100 GPUs (NVLink), batches of 10,000 queries (1,000 for GIST1M, 6,980 for MS MARCO), k = 10, against the best CAGRA configuration of cuVS 26.10 on the same GPUs at the same recall:
| Dataset | Vectors | Dimension | Queries per second | Over CAGRA |
|---|---|---|---|---|
| SIFT1M | 1M | 128 | 9.44 M | 6.3x |
| GIST1M | 1M | 960 | 1.03 M | 14.2x |
| DINOv2 (ImageNet) | 1.28M | 768 | 2.53 M | 12.8x |
| MS MARCO passages | 8.8M | 768 | 2.20 M | 32.6x |
| Deep10M | 10M | 96 | 3.82 M | 3.5x |
| Deep100M | 100M | 96 | 1.97 M | 2.3x |
| SIFT100M | 100M | 128 | 2.52 M | 2.6x |
| Deep1B | 1B | 96 | 297 k | 1.9x |
| SIFT1B | 1B | 128 | 437 k | 1.5x |
Both systems are timed with the queries resident on the GPUs, median of five runs after a warm-up. Deep1B and SIFT1B keep
their fp16 vectors in pinned host memory. The runs are bench/paper_frontier.sh; the paper has the full recall and
throughput fronts and the other baselines.
Installation
pip install . # Linux, Python >= 3.11, CUDA 12, an NVIDIA GPU of compute capability >= 8.0
The build compiles the CUDA library against the libcuvs-cu12 26.10 wheel, which pip installs with its
dependencies. The package needs only numpy; CuPy and PyTorch arrays are accepted when installed.
Usage
Native:
import octex
index = octex.build(xb) # numpy, CuPy, or PyTorch; float32 or float16
D, I = index.search(xq, k=10) # squared distances and int64 ids, nearest first
index.save("index_dir"); index = octex.load("index_dir", devices=[0, 1], placement="shard")
cuVS (cuvs.neighbors.cagra calls):
from octex import cuvs as cagra # was: from cuvs.neighbors import cagra
index = cagra.build(cagra.IndexParams(), dataset)
distances, neighbors = cagra.search(cagra.SearchParams(), index, queries, k=10)
Faiss (GPU index calls):
from octex import faiss # was: import faiss
index = faiss.IndexOctex(d) # or faiss.GpuIndexCagra(faiss.StandardGpuResources(), d)
index.add(xb)
D, I = index.search(xq, 10)
Results are (distances, neighbors) everywhere, as in Faiss (D, I) and cuVS: float32 squared Euclidean distances
and int64 ids, nearest first, in the framework of the queries (numpy for host arrays; arrays on the same GPU for CuPy,
PyTorch, or anything with DLPack or __cuda_array_interface__). Inputs are read without copies. The search knobs
are read (list entries per copy), starts (first-round hits kept), and waves (rounds over the neighbor table):
D, I = index.search(xq, k=10, read=8, starts=32, waves=1)
Only the squared Euclidean metric is supported; other metrics raise ValueError.
Billion-scale builds use octex_build --fast, which builds the Deep1B index in 44 minutes on four H100 GPUs
(guide).
Index directory
An index is a directory of .npy arrays plus meta.json (format in docs/design.md). build
writes it, load places it on one or more GPUs: placement="shard" splits the copies and the neighbor table over
the GPUs, placement="replicate" gives every GPU the whole index and a slice of the queries, and
vectors_on_host=True keeps the fp16 vectors in pinned host memory.
C++
#include <cuvs/neighbors/octex.hpp>
namespace octex = cuvs::neighbors::octex;
octex::build(res, octex::index_params{}, dataset_view, "index_dir");
auto index = octex::load(res, "index_dir");
octex::search(res, octex::search_params{}, index, queries_view, neighbors_view, distances_view);
Documentation and examples
- docs/guide.md: installation, the three interfaces, every build, load, and search parameter with what it trades, placements, memory sizing, and how to choose parameters for a recall target.
- docs/design.md: the algorithm and the index directory format.
- examples/python/quickstart.py: build and search, natively and through the cuVS and Faiss calls.
- examples/cpp/search.cu: load an index directory and search it from C++
(
cmake --build build --target octex_example_search). - examples/c/search.c: build, load, and search through the C API (
cuvsOctex*, the conventions of the cuVS C API;cmake --build build --target octex_example_c).
Tests
pip install -e ".[test]"
python -m pytest tests
Citation
@article{zhao2026octex,
title = {{OctEx}: Billion-Scale Vector Search by Precomputed Lattice Neighbor Lists on {GPUs}},
author = {Zhao, Dongfang},
journal = {arXiv preprint arXiv:2611.02556},
year = {2026}
}
License
Metadata
Release files for octex 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| octex-0.1.0.tar.gz | 131.6 kB | Without provenance | Details for octex-0.1.0.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| octex-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details for octex-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
| octex-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details for octex-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
| octex-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details for octex-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
Total release size: 18.9 MB
Release files / octex-0.1.0.tar.gz
| Download URL | octex-0.1.0.tar.gz |
|---|---|
| Size | 131.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
119c698eb5393aea424cafcabfc2cf57917b3492f911759d88e7b87717df8254
|
|
BLAKE2b-256 checksum How to use checksums |
7eccd2ed0b7e86e25b444b566066172a2c1a490e5faf10db884cc0857b6d4e93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / octex-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | octex-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b6dbcf3da59ee14fc223b19aa9daa50e9364f5415e0924ed4ac7de73cf9dcafe
|
|
BLAKE2b-256 checksum How to use checksums |
e2fbb32b6ffe04c036f06994c5dabf43965f530468feeb0ae493a2ced52cce9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / octex-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | octex-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d688036619b291329c83e0e3442a3b4f3acc3cd2300c98f559f9be5d0ea07824
|
|
BLAKE2b-256 checksum How to use checksums |
da681337712b4ced743329e9351136ce27f65a4cbb6c89fb6d8905b8e61db9e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / octex-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | octex-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
f6094d96086b0cd94693e2a9646193a4618e1919330acafa3c70576e6294754f
|
|
BLAKE2b-256 checksum How to use checksums |
70ccfdd14408a152feeb0c6a38f349132c8c921c89326a6c3062e8fbb01308ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for octex 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.