Skip to main content

A library for efficient similarity search and clustering of dense vectors.

Project description

faiss-wheels

This repository is based on kyamagu/faiss-wheels.

PyPI PyPI

Overview

This repository provides scripts to build gpu wheels for the faiss library. Distribute the faiss-gpu-cuXX package to PyPI using the contents of this repository.

  • Builds CUDA 11.8+/CUDA 12.1+ compatible wheels.
    • Support Pascal~Hopper architecture GPU (Compute Capability 6.0~9.0).
    • Dynamically linked to CUDA Runtime and cuBLAS libraries published in PyPI.
  • Bundles OpenBLAS in Linux.

Installation

The faiss-gpu-cu11 and faiss-gpu-cu12 wheels built for CUDA11 and CUDA12 are available on PyPI. Install one or the other depending on your environment. These wheels dynamically link to the CUDA Runtime and cuBLAS shared libraries. This approach helps to reduce the file size of the wheels.

faiss-gpu-cuXX(XX=11 or 12) has dependencies on CUDA Runtime (nvidia-cuda-runtime-cuXX) and cuBLAS (nvidia-cublas-cuXX) released by PyPI, and links shared libraries in these packages. Therefore, there is no need to install CUDA on your host(system).

Caution

The published faiss-gpu-cuXX package requires proper setup of system, hardware, and other dependencies that cannot be managed by the package manager (e.g. pip). It is the responsibility of the user of this package to prepare an environment suitable for its operation.

Here are the main requirements that such an environment should meet (Other conditions may be hidden.)

  1. the host environment must have a CUDA-compatible Nvidia Driver installed, as required by faiss-gpu-cuXX (see below for details)
  2. the GPU architecture of the execution environment must be compatible with faiss-gpu-cuXX (see below for details)
  3. if you install faiss-gpu-cuXX and another library (e.g. Pytorch) that uses dynamically linked CUDA in the same environment, they must be linked to the same CUDA shared library.

Wheel for CUDA12

faiss-gpu-cu12 is a package built using CUDA Toolkit 12.1. The following command will install faiss and the CUDA Runtime and cuBLAS for CUDA 12.1 used at build time.

# install CUDA 12.1 at the same time
pip install faiss-gpu-cu12[fix-cuda]

Requirements

  • OS: Linux
    • arch: x86_64
    • glibc >=2.28
  • Nvidia driver: >=R530 (specify fix-cuda extra during installation)
  • GPU architectures: Pascal~Hopper (Compute Capability: 6.0~9.0)

Advanced

The faiss-gpu-cu12 package (the binaries contained in it) is minor version compatible with CUDA and will work dynamically linked with CUDA 12.X (X>=1).

Installation of the CUDA runtime and cuBLAS is allowed to the extent that minor version compatibility is maintained by excluding the fix-cuda extra.

This is useful when coexisting this package with a package that has a dependency on the CUDA Toolkit used at build time, such as Pytorch or Tensorflow.

The installation commands are as follows.

# install CUDA 12.X(X>=1) at the same time
pip install faiss-gpu-cu12

If you install the faiss-gpu-cuXX package in this way, CUDA may be updated due to lock file updates, etc.

Please note that this may cause an error depending on the compatibility with the driver. (Basically, to use a new CUDA, the driver must also be updated).

Wheel for CUDA11

faiss-gpu-cu11 is a package built using CUDA Toolkit 11.8. The following command will install faiss and the CUDA Runtime and cuBLAS for CUDA 11.8 used at build time.

# install CUDA 11.8 at the same time
pip install faiss-gpu-cu11[fix-cuda]

Requirements

  • OS: Linux
    • arch: x86_64
    • glibc >=2.28
  • Nvidia driver: >=R520 (specify fix-cuda extra during installation)
  • GPU architectures: Pascal~Hopper (Compute Capability: 6.0~9.0)

Advanced

Since CUDA 11.8 is the final version of the CUDA 11 series, the results are the same with or without the fix-cuda extras.

# install CUDA 11.X(X>=8) at the same time
pip install faiss-gpu-cu11

Versioning rule

Packages to be published from this repository are "{A}.{B}.{C}.{D}" format. A, B, and C are the versions of faiss used for builds. D is the version used to manage changes specific to this repository.

Usage

Build wheels

You can build faiss-gpu-cu11 and faiss-gpu-cu12 wheels using dagger.

# build wheel for CUDA 11.8
dagger call build-gpu-wheels --cuda-major-version 11 --host-directory=.:build-view --output ./wheelhouse/gpu/cuda11

# build wheel for CUDA 12.1
dagger call build-gpu-wheels --cuda-major-version 12 --host-directory=.:build-view --output ./wheelhouse/gpu/cuda12

When executed, a wheel is created under "{repository root}/wheelhouse/gpu/cuXX".

Requirements

  • OS: Linux
    • arch: x86_64
  • Dagger: v0.13.5

Test wheels

You can test faiss-gpu-cu11 and faiss-gpu-cu12 wheels using dagger.

# test for faiss-gpu-cu11 wheels
_EXPERIMENTAL_DAGGER_GPU_SUPPORT=1 dagger call test-gpu-wheels --cuda-major-version 11 --host-directory=.:test-view --wheel-directory=./wheelhouse/gpu/cuda11/

# test for faiss-gpu-cu12 wheels
_EXPERIMENTAL_DAGGER_GPU_SUPPORT=1 dagger call test-gpu-wheels --cuda-major-version 12 --host-directory=.:test-view --wheel-directory=./wheelhouse/gpu/cuda12/

Requirements

  • OS: Linux
    • arch: x86_64
  • Dagger: v0.13.5
  • Nvidia container toolkit
  • Nvidia driver: >=R530

Build & Test wheels

You can build andtest faiss-gpu-cu11 and faiss-gpu-cu12 wheels using dagger.

# test for faiss-gpu-cu11 & cu12 wheels
_EXPERIMENTAL_DAGGER_GPU_SUPPORT=1 dagger call faiss-gpu-ci --cuda-major-versions 11 --cuda-major-versions 12 --host-directory=.:ci-view --output=./wheelhouse

Requirements

  • OS: Linux
    • arch: x86_64
  • Dagger: v0.13.5
  • Nvidia container toolkit
  • Nvidia driver: >=R530

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

faiss_gpu_cu11-1.9.0.0-cp312-cp312-manylinux_2_28_x86_64.whl (65.9 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.28+ x86-64

faiss_gpu_cu11-1.9.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (64.8 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

faiss_gpu_cu11-1.9.0.0-cp311-cp311-manylinux_2_28_x86_64.whl (65.9 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

faiss_gpu_cu11-1.9.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (64.9 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

faiss_gpu_cu11-1.9.0.0-cp310-cp310-manylinux_2_28_x86_64.whl (65.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

faiss_gpu_cu11-1.9.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (64.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

faiss_gpu_cu11-1.9.0.0-cp39-cp39-manylinux_2_28_x86_64.whl (65.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

faiss_gpu_cu11-1.9.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (64.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

File details

Details for the file faiss_gpu_cu11-1.9.0.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for faiss_gpu_cu11-1.9.0.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c376dd288365e9b52793ce2e3bb641460292b2933593f6c26790e91b31210b3f
MD5 a904160037aade997324c53219929c57
BLAKE2b-256 483e92625d79507f657c666badff405be6ede48653d270e38ea276feb59244b5

See more details on using hashes here.

File details

Details for the file faiss_gpu_cu11-1.9.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for faiss_gpu_cu11-1.9.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5e7ceaa29df863b5a3e395980a5a2eb2babb2f389799ea235c5c44dbacba965d
MD5 98e9b03ceb2867cf7092bc688f74b1c7
BLAKE2b-256 a84fc74d6a5b384fcbcc5d6364b63d6538a476fad07746000f2fd24322ef97db

See more details on using hashes here.

File details

Details for the file faiss_gpu_cu11-1.9.0.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for faiss_gpu_cu11-1.9.0.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fc41d2c60b86bd5b1dd1a0128c5e698090c93595bec3fd4ba809ed32e46c6a4e
MD5 ea5d0afbc304feca21fbe39b24e3c6fe
BLAKE2b-256 41488255b23050d847dcbcb3ee6bdd243c942c034d98de9fb240d897426626f4

See more details on using hashes here.

File details

Details for the file faiss_gpu_cu11-1.9.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for faiss_gpu_cu11-1.9.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b07a23232f96aee1f0f030be25cd2f96b774436106af2993c38827bc3f5bb541
MD5 6bbed4e5f49453bd00a1136562a98dc6
BLAKE2b-256 4d2a02d143480840afc8415bf9cefb51114d7a22443c52f8676d975496aef43b

See more details on using hashes here.

File details

Details for the file faiss_gpu_cu11-1.9.0.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for faiss_gpu_cu11-1.9.0.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3fb071a76d47972dc474d3769c37ae462893a7a3177d7dbdea18bbe00ce1bea5
MD5 b965c8c0869f764a799e075f0ea830d4
BLAKE2b-256 a1a72eb18931b7b4eae634e632ddde25858d027f1d510faa0211401f970024c5

See more details on using hashes here.

File details

Details for the file faiss_gpu_cu11-1.9.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for faiss_gpu_cu11-1.9.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a8edb7657a5c490daf0e24d3c1ec067eef07916b26964a5bacb3ea4066da6327
MD5 1c1609f15f84d6b2a1f75b837d91774a
BLAKE2b-256 12269e5dc4e4967465505a7e3bdc34f301de05ec0cc62233279f348923ffe820

See more details on using hashes here.

File details

Details for the file faiss_gpu_cu11-1.9.0.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for faiss_gpu_cu11-1.9.0.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f4373fabe502f36d3834f671b4268cb4c2196014446fec50d5ff25ae12821678
MD5 0192961363ea419018aa610d17b16395
BLAKE2b-256 aea65ba5684dc2bb603309def2f9fc2c7524ed283ab10fdd85aff74305dd3466

See more details on using hashes here.

File details

Details for the file faiss_gpu_cu11-1.9.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for faiss_gpu_cu11-1.9.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4b482320f13839459c51c8ff0c7499e2fb6fec792ad7cdf18a507ad11b396a54
MD5 cb273cfeb1afe1f50986e45949719ad7
BLAKE2b-256 e7f9f3ecd22c48fe8126dd4afbb9a79411264c11a249a5f6afbf0e1e4721caf8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page