Git Product home page Git Product logo

faiss-wheels's Introduction

faiss-wheels

Build PyPI

faiss python wheel packages.

Overview

This repository provides scripts to build wheel packages for the faiss library.

  • Builds CPU-only version with cibuildwheel.
  • Bundles OpenBLAS in Linux/Windows
  • Uses Accelerate framework in macOS

There is also a source package to customize the build process.

Note GPU package has been supported until version 1.7.2, but is not available since version 1.7.3 due to the PyPI limitation.

Install

Install a binary package by:

pip install faiss-cpu

Building source package

If there is a custom built faiss library in the system, build source package for the best performance.

Prerequisite

The source package assumes faiss is already built and installed in the system. Build and install the faiss library first.

cd faiss
cmake . -B build -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DFAISS_OPT_LEVEL=avx512
cmake --build build --config Release -j
cmake --install build install
cd ..

See the official faiss installation instruction for more on how to build and install faiss.

For building sdist, swig 3.0.12 or later needs to be available.

Building a source distribution

The following builds and installs the faiss-cpu source package with AVX512.

export FAISS_OPT_LEVEL=avx512
pip install --no-binary :all: faiss-cpu

The following example builds a GPU wheel.

export FAISS_ENABLE_GPU=ON
pip install --no-binary :all: faiss-cpu

There are a few environment variables that specifies build-time options.

  • FAISS_INSTALL_PREFIX: Specifies the install location of faiss library, default to /usr/local.
  • FAISS_OPT_LEVEL: Faiss SIMD optimization, one of generic, avx2, avx512. Note that AVX option is only available in x86_64 arch.
  • FAISS_ENABLE_GPU: Setting this variable to ON builds GPU wrappers. Set this variable if faiss is built with GPU support.
  • CUDA_HOME: Specifies CUDA install location for building GPU wrappers, default to /usr/local/cuda.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.