faiss

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

MIT License

Downloads
5.1K
Stars
27.9K
Committers
172

Bot releases are visible (Hide)

faiss - V1.8.0 Latest Release

Published by junjieqi 8 months ago

Added

  • Added a new conda package faiss-gpu-raft alongside faiss-cpu and faiss-gpu
  • Integrated IVF-Flat and IVF-PQ implementations in faiss-gpu-raft from RAFT by Nvidia [thanks @cjnolet and @tarang-jain]
  • Added a context parameter to InvertedLists and InvertedListsIterator
  • Added Faiss on Rocksdb demo to showing how inverted lists can be persisted in a key-value store
  • Introduced Offline IVF framework powered by Faiss big batch search
  • Added SIMD NEON Optimization for QT_FP16 in Scalar Quantizer. [thanks @naveentatikonda]
  • Generalized ResultHandler and supported range search for HNSW and FastScan
  • Introduced avx512 optimization mode and FAISS_OPT_LEVEL env variable [thanks @alexanderguzhva]
  • Added search parameters for IndexRefine::search() and IndexRefineFlat::search()
  • Supported large two-level clustering
  • Added support for Python 3.11 and 3.12
  • Added support for CUDA 12

Changed

  • Used the benchmark to find Pareto optimal indices. Intentionally limited to IVF(Flat|HNSW),PQ|SQ indices
  • Splitted off RQ encoding steps to another file
  • Supported better NaN handling
  • HNSW speedup + Distance 4 points [thanks @alexanderguzhva]

Fixed

  • Fixed DeviceVector reallocations in Faiss GPU
  • Used efSearch from params if provided in HNSW search
  • Fixed warp synchronous behavior in Faiss GPU CUDA 12

Full Changelog: https://github.com/facebookresearch/faiss/compare/v1.7.4...v1.8.0

faiss - v1.7.4

Published by mlomeli1 over 1 year ago

Added

  • Added big batch IVF search for conducting efficient search with big batches of queries
  • Checkpointing in big batch search support
  • Precomputed centroids support
  • Support for iterable inverted lists for eg. key value stores
  • 64-bit indexing arithmetic support in FAISS GPU
  • IndexIVFShards now handle IVF indexes with a common quantizer
  • Jaccard distance support
  • CodePacker for non-contiguous code layouts
  • Approximate evaluation of top-k distances for ResidualQuantizer and IndexBinaryFlat
  • Added support for 12-bit PQ / IVFPQ fine quantizer decoders for standalone vector codecs (faiss/cppcontrib)
  • Conda packages for osx-arm64 (Apple M1) and linux-aarch64 (ARM64) architectures
  • Support for Python 3.10

Removed

  • CUDA 10 is no longer supported in precompiled packages
  • Removed Python 3.7 support for precompiled packages
  • Removed constraint for using fine quantizer with no greater than 8 bits for IVFPQ, for example, now it is possible to use IVF256,PQ10x12 for a CPU index

Changed

  • Various performance optimizations for PQ / IVFPQ for AVX2 and ARM for training (fused distance+nearest kernel), search (faster kernels for distance_to_code() and scan_list_*()) and vector encoding
  • A magnitude faster CPU code for LSQ/PLSQ training and vector encoding (reworked code)
  • Performance improvements for Hamming Code computations for AVX2 and ARM (reworked code)
  • Improved auto-vectorization support for IP and L2 distance computations (better handling of pragmas)
  • Improved ResidualQuantizer vector encoding (pooling memory allocations, avoid r/w to a temporary buffer)

Fixed

  • HSNW bug fixed which improves the recall rate! Special thanks to zh Wang @hhy3 for this.
  • Faiss GPU IVF large query batch fix
  • Faiss + Torch fixes, re-enable k = 2048
  • Fix the number of distance computations to match max_codes parameter
  • Fix decoding of large fast_scan blocks
faiss - v1.7.3

Published by mlomeli1 almost 2 years ago

Added

  • Sparse k-means routines and moved the generic kmeans to contrib
  • FlatDistanceComputer for all FlatCodes indexes
  • Support for fast accumulation of 4-bit LSQ and RQ
  • Product additive quantization support
  • Support per-query search parameters for many indexes + filtering by ids
  • write_VectorTransform and read_vectorTransform were added to the public API (by @AbdelrahmanElmeniawy)
  • Support for IDMap2 in index_factory by adding "IDMap2" to prefix or suffix of the input String (by @AbdelrahmanElmeniawy)
  • Support for merging all IndexFlatCodes descendants (by @AbdelrahmanElmeniawy)
  • Remove and merge features for IndexFastScan (by @AbdelrahmanElmeniawy)
  • Performance improvements: 1) specialized the AVX2 pieces of code speeding up certain hotspots, 2) specialized kernels for vector codecs (this can be found in faiss/cppcontrib)

Fixed

  • Fixed memory leak in OnDiskInvertedLists::do_mmap when the file is not closed (by @AbdelrahmanElmeniawy)
  • LSH correctly throws error for metric types other than METRIC_L2 (by @AbdelrahmanElmeniawy)
faiss - Faiss 1.7.2

Published by beauby almost 3 years ago

ADDED

  • Support LSQ on GPU (by @KinglittleQ)
  • Support for exact 1D kmeans (by @KinglittleQ)
  • LUT-based search for additive quantizers
  • Autogenerated Python docstrings from Doxygen comments

CHANGED

  • Cleanup of index_factory parsing
faiss - Faiss 1.7.1

Published by beauby over 3 years ago

faiss - Faiss 1.7.0

Published by beauby over 3 years ago

faiss - Faiss 1.6.5

Published by beauby almost 4 years ago

faiss - Faiss 1.6.4

Published by beauby almost 4 years ago

Features

  • Arbitrary dimensions per sub-quantizer now allowed for GpuIndexIVFPQ.
  • Brute-force kNN on GPU (bfKnn) now accepts int32 indices.
  • Faiss CPU now supports Windows. Conda packages are available from the nightly channel.
faiss - Faiss 1.6.3

Published by beauby about 4 years ago

faiss - Faiss 1.5.3

Published by beauby over 5 years ago

Bugfixes:

  • slow scanning of inverted lists (#836).

Features:

  • add basic support for 6 new metrics in CPU IndexFlat and IndexHNSW (#848);
  • add support for IndexIDMap/IndexIDMap2 with binary indexes (#780).

Misc:

  • throw python exception for OOM (#758);
  • make DistanceComputer available for all random access indexes;
  • gradually moving from long to int64_t for portability.
faiss - Faiss 1.5.2

Published by beauby over 5 years ago

The license was changed from BSD+Patents to MIT.

Changelog:

  • propagates exceptions raised in sub-indexes of IndexShards and IndexReplicas;
  • support for searching several inverted lists in parallel (parallel_mode != 0);
  • better support for PQ codes where nbit != 8 or 16;
  • IVFSpectralHash implementation: spectral hash codes inside an IVF;
  • 6-bit per component scalar quantizer (4 and 8 bit were already supported);
  • combinations of inverted lists: HStackInvertedLists and VStackInvertedLists;
  • configurable number of threads for OnDiskInvertedLists prefetching (including 0=no prefetch);
  • more test and demo code compatible with Python 3 (print with parentheses);
  • refactored benchmark code: data loading is now in a single file.
faiss - Faiss 1.5.1

Published by beauby over 5 years ago

Changelog:

  • a MatrixStats object, which reports useful statistics about a dataset;
  • an option to round coordinates during k-means optimization;
  • an alternative option for search in HNSW;
  • moved stats() and imbalance_factor() from IndexIVF to InvertedLists object;
  • range search is now available for IVFScalarQuantizer;
  • support for direct uint_8 codec in ScalarQuantizer;
  • renamed IndexProxy to IndexReplicas (now ;
  • better support for PQ code assignment with external index;
  • support for IMI2x16 (4B virtual centroids!);
  • support for k = 2048 search on GPU (instead of 1024);
  • most CUDA mem alloc failures now throw exceptions instead of terminating on an assertion;
  • support for renaming an ondisk invertedlists;
  • interrupt computations with interrupt signal (ctrl-C) in python;
  • simplified build system (with --with-cuda/--with-cuda-arch options);
  • updated example Dockerfile;
  • conda packages now depend on the cudatoolkit packages, which fixes some interferences with pytorch. Consequentially, faiss-gpu should now be installed by conda install -c pytorch faiss-gpu cudatoolkit=10.0.
faiss - Faiss 1.5.0

Published by beauby over 5 years ago

Changelog:

  • GpuIndexBinaryFlat
  • IndexBinaryHNSW
faiss - v1.4.0

Published by beauby about 6 years ago

Faiss 1.4.0

Features:

  • automatic tracking of C++ references in Python
  • non-intel platforms supported -- some functions optimized for ARM
  • override nprobe for concurrent searches
  • support for floating-point quantizers in binary indexes

Bug fixes:

  • no more segfaults in python (I know it's the same as the first feature but it's important!)
  • fix GpuIndexIVFFlat issues for float32 with 64 / 128 dims
  • fix sharding of flat indexes on GPU with index_cpu_to_gpu_multiple

The Python interface of Faiss closely mimics the C++ interface. This means that all C++ functions, objects, fields and methods are visible and accessible in Python. This is done thanks to SWIG, that automatically generates Python classes from the C++ headers. The downside is that this low-level access means that there is no automatic tracking of C++ references in Python. For example:

index = IndexIVFFlat(IndexFlatL2(10), 10, 100) 

would crash. Python does not know that the IndexFlatL2 is referenced by the IndexIVFFlat, so the garbage collector deallocates the IndexFlatL2 while IndexIVFFlat still references it. In Faiss 1.4.0, we added code to all such constructors that adds a Python-level reference to the object and prevents deallocation. With this upgrade, there should be no crashes in pure Python any more, you can report them right away as issues.

Faiss was developed on 64-bit x86 platforms, Linux and Mac OS. There were quite a few locations in the code that shamelessly assumed that they were compiled with SSE support. Faiss 1.4.0 is portable to other hardware, it has pure C++ code for all operations, and SSE/AVX is only enabled if the appropriate macro are set. This was tested on an ARM platform and also a few operations were optimized for the ARM SIMD operations (in utils_simd.cpp).

To compile on a non-x86 platform, you will need to provide a BLAS library (OpenBLAS works for aarch64) and remove x86-specific flags from the makefile.inc (manually for now). Faiss is not portable to other compilers than g++/clang though.

The search-time parameters like nprobe for IndexIVF are set in the index object. What if you want to perform concurrent searches from several threads with different search parameters? This was not possible so far. Now there is an IVFSearchParameters object that can override the parameters set at the object level. See tests/test_params_override.cpp

Faiss' support for binary indexes is recent, and not so many index types are supported. To work around this, we added IndexBinaryFromFloat, a binary index that wraps around any floating-point index. This makes it possible, for example, to use an IndexHNSW as a quantizer for an IndexBinaryIVF. See tests/test_index_binary_from_float.py

We also fixed a few bugs that correspond to github issues.

faiss - v1.3.0

Published by beauby over 6 years ago

Features:

  • Support for binary indexes (IndexBinaryFlat, IndexBinaryIVF)
  • Support fp16 encoding in scalar quantizer
  • Support for deduplication in IndexIVFFlat
  • Support for index serialization

Bugs:

  • Fix MMAP bug for normal indexes
  • Fix propagation of io_flags in read func
  • Fix k-selection for CUDA 9
  • Fix race condition in OnDiskInvertedLists
faiss -

Published by mdouze over 6 years ago

Features

  • Support for on-disk storage of IndexIVF data.

  • C API

  • extended tutorial to GPU indexes

Package Rankings
Top 18.06% on Formulae.brew.sh
Top 3.65% on Proxy.golang.org
Top 0.93% on Pypi.org
Top 14.56% on Spack.io
Top 7.28% on Conda-forge.org