Metadata-Version: 2.2
Name: faiss-cuda
Version: 1.14.3
Summary: GPU-enabled FAISS wheels (CUDA 12.8, Taylor Geospatial).
Keywords: faiss,similarity-search,nearest-neighbors,cuda,gpu
Author-Email: Taylor Geospatial <support@taylorgeospatial.org>
License: MIT License
         
         Copyright (c) 2026 Taylor Geospatial
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
         ----------------------------------------------------------------------------
         
         The wheels published by this project bundle compiled binaries built from
         FAISS (https://github.com/facebookresearch/faiss), distributed under its
         own MIT License:
         
         MIT License
         
         Copyright (c) Facebook, Inc. and its affiliates.
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Environment :: GPU :: NVIDIA CUDA
Classifier: Environment :: GPU :: NVIDIA CUDA :: 12
Project-URL: Homepage, https://github.com/taylorgeospatial/faiss-cuda
Project-URL: Source, https://github.com/taylorgeospatial/faiss-cuda
Project-URL: Issues, https://github.com/taylorgeospatial/faiss-cuda/issues
Requires-Python: <3.15,>=3.11
Requires-Dist: numpy<3,>=2
Requires-Dist: packaging
Requires-Dist: nvidia-cuda-runtime-cu12>=12.8
Requires-Dist: nvidia-cublas-cu12>=12.8
Provides-Extra: fix-cuda
Requires-Dist: nvidia-cuda-runtime-cu12==12.8.*; extra == "fix-cuda"
Requires-Dist: nvidia-cublas-cu12==12.8.*; extra == "fix-cuda"
Description-Content-Type: text/markdown

# faiss-cuda

GPU-enabled [FAISS](https://github.com/facebookresearch/faiss) wheels published to
PyPI, maintained by [Taylor Geospatial](https://taylorgeospatial.org).

```bash
pip install faiss-cuda
```

Built against CUDA 12.8. Your only host prerequisite is an NVIDIA driver
(R525+). No system CUDA toolkit required — the CUDA runtime libraries install
from PyPI (`nvidia-cuda-runtime-cu12`, `nvidia-cublas-cu12`) and are preloaded
by a small loader shipped in the wheel.

## What's in the wheel

- `faiss` Python package, GPU-enabled, built against FAISS upstream **v1.14.3**.
- CUDA arch `70;80;86;89;90` — V100, A100, A10/A30/RTX-30, RTX-40, H100/H200.
  T4 (sm_75), B100/B200 (sm_100) and RTX-50 (sm_120) return in the next
  `.post` release once PyPI grants a larger file limit
  ([pypi/support#11444](https://github.com/pypi/support/issues/11444)).
- Works on GPU-less machines too: the wheel contains the full CPU
  implementation of FAISS and loading the CUDA runtime does not require a
  driver.
- `manylinux_2_28_x86_64`, CPython 3.11–3.14. libstdc++ is statically linked so
  no GCC 11+ runtime is required on the host — works on RHEL 8 / glibc 2.28 out
  of the box.
- CUDA libs (`libcudart`, `libcublas`, `libcublasLt`) are *excluded* from the
  wheel — they install transitively from PyPI as `nvidia-*` packages, which
  keeps the wheel small and avoids ABI clashes if you also have PyTorch
  installed.

To pin the runtime CUDA libs to the same minor as the build (reproducibility):

```bash
pip install 'faiss-cuda[fix-cuda]'
```

## Verify

```python
import faiss, numpy as np
res = faiss.StandardGpuResources()
xb = np.random.random((10000, 64)).astype("float32")
xq = np.random.random((5,     64)).astype("float32")
index = faiss.GpuIndexFlatL2(res, 64)
index.add(xb)
D, I = index.search(xq, 4)
print("GPU OK", I.shape)
```

## CUDA 13

A CUDA 13 variant (`packages/cuda13`, arch `75;80;86;89;90;100;103;120`) is
maintained in this repo but not published to PyPI — CUDA 12.8 already covers
V100 through Blackwell B200/RTX-50, and CUDA 13 dropped Volta/V100 support
entirely. Build it from source if you need sm_103 (GB300) or a pure cu13
dependency stack.

## Deprecated: faiss-cuda-cu128

Before 1.14.3, `faiss-cuda` shipped CUDA 13 and `faiss-cuda-cu128` carried the
CUDA 12.8 build. `faiss-cuda` is now the CUDA 12.8 build; `faiss-cuda-cu128`
remains on PyPI only as an empty shim depending on `faiss-cuda>=1.14.3` so old
pins keep resolving.

## Build from source

Wheels are built natively on TGI RAILS (no container). The build script uses
the cluster CUDA toolkit and system gcc via modules, and runs
`auditwheel repair` to certify the result as `manylinux_2_28_x86_64`. ccache
persists builds across SLURM jobs.

Prereqs on the build host: CUDA 12.8 toolkit (13.x for the cuda13 variant),
RHEL 8 / glibc 2.28 baseline, gcc 11+, `uv`, `openblas-devel`.

```bash
scripts/submit_matrix.sh --account <PROJECT>   # all (variant, python) pairs
ls wheelhouse/
```

Or directly on a node:

```bash
scripts/rails_build.sh cuda12         # one package
scripts/rails_build.sh                # both
```

## Releasing

1. Build wheels on RAILS: `scripts/submit_matrix.sh --account <PROJECT>`.
2. Build the cu128 shim: `python -m build --wheel packages/cu128-shim -o wheelhouse/`.
3. Tag and create a GitHub release, attaching every `.whl` from `wheelhouse/`:
   ```bash
   gh release create v1.14.3 wheelhouse/*.whl --notes "..."
   ```
4. The `release.yml` workflow fires on `release: published`, downloads the wheel
   assets, and runs `uv publish` with OIDC trusted publishing into the `pypi`
   environment. Both `faiss-cuda` and `faiss-cuda-cu128` need trusted-publisher
   configs on PyPI pointing at `release.yml` + environment `pypi`.

## Versioning

Package version follows upstream FAISS: `<faiss_version>` on a fresh upstream
bump, then `<faiss_version>.postN` for packaging-only changes (e.g. FAISS
1.14.3 → `1.14.3`, next packaging fix → `1.14.3.post0`). The `faiss/`
git submodule is the source of truth for the upstream version.

## License

MIT. See [`LICENSE`](LICENSE).

The wheels redistribute compiled binaries built from
[FAISS](https://github.com/facebookresearch/faiss) (Meta, MIT-licensed); the
LICENSE file includes Meta's copyright and license text alongside ours.
