Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
guangzegu authored Oct 24, 2024
2 parents f556407 + 9c3cd77 commit ed7b184
Show file tree
Hide file tree
Showing 714 changed files with 2,833 additions and 1,667 deletions.
6 changes: 1 addition & 5 deletions .github/actions/build_cmake/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ runs:
: # skip torch install via conda, we need to install via pip to get
# ROCm-enabled version until it's supported in conda by PyTorch
elif [ "${{ inputs.gpu }}" = "ON" ]; then
conda install -y -q pytorch pytorch-cuda=12.4 -c pytorch -c nvidia/label/cuda-12.4.0
conda install -y -q "pytorch<2.5" pytorch-cuda=12.4 -c pytorch -c nvidia/label/cuda-12.4.0
else
conda install -y -q pytorch -c pytorch
fi
Expand Down Expand Up @@ -101,10 +101,6 @@ runs:
sudo apt-get -qq autoclean >/dev/null
sudo apt-get -qq clean >/dev/null
sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
- name: ROCm - Hipify
if: inputs.rocm == 'ON'
shell: bash
run: ./faiss/gpu/hipify.sh
- name: Symblink system dependencies
if: inputs.raft == 'ON' || inputs.rocm == 'ON'
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
jobs:
linux-x86_64-nightly:
name: Linux x86_64 nightlies
runs-on: ubuntu-latest
runs-on: 4-core-ubuntu
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# @lint-ignore-every LICENSELINT
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
Expand Down Expand Up @@ -73,6 +74,7 @@ if(FAISS_ENABLE_GPU)
find_package(HIP REQUIRED)
find_package(hipBLAS REQUIRED)
set(GPU_EXT_PREFIX "hip")
execute_process(COMMAND ${PROJECT_SOURCE_DIR}/faiss/gpu/hipify.sh)
else ()
set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER})
enable_language(CUDA)
Expand Down
9 changes: 4 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ Several options can be passed to CMake, among which:
- `-DCMAKE_BUILD_TYPE=Release` in order to enable generic compiler
optimization options (enables `-O3` on gcc for instance),
- `-DFAISS_OPT_LEVEL=avx2` in order to enable the required compiler flags to
generate code using optimized SIMD instructions (possible values are `generic`,
`avx2` and `avx512`, by increasing order of optimization),
generate code using optimized SIMD/Vector instructions. Possible values are below:
- On x86-64, `generic`, `avx2` and `avx512`, by increasing order of optimization,
- On aarch64, `generic` and `sve`, by increasing order of optimization,
- `-DFAISS_USE_LTO=ON` in order to enable [Link-Time Optimization](https://en.wikipedia.org/wiki/Link-time_optimization) (default is `OFF`, possible values are `ON` and `OFF`).
- BLAS-related options:
- `-DBLA_VENDOR=Intel10_64_dyn -DMKL_LIBRARIES=/path/to/mkl/libs` to use the
Expand All @@ -151,9 +152,7 @@ Several options can be passed to CMake, among which:
to build against (see [CUDA docs](https://developer.nvidia.com/cuda-gpus) to
determine which architecture(s) you should pick),
- `-DFAISS_ENABLE_ROCM=ON` in order to enable building GPU indices for AMD GPUs.
The hipify script must be executed before using this option.
Invoke `./faiss/gpu/hipify.sh` to execute. `-DFAISS_ENABLE_GPU` must be `ON`
when using this option. (possible values are `ON` and `OFF`),
`-DFAISS_ENABLE_GPU` must be `ON` when using this option. (possible values are `ON` and `OFF`),
- python-related options:
- `-DPython_EXECUTABLE=/path/to/python3.7` in order to build a python
interface for a different python than the default one (see
Expand Down
5 changes: 2 additions & 3 deletions benchs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the BSD-style license found in the
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.


Expand Down
4 changes: 2 additions & 2 deletions benchs/bench_6bit_codec.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_all_ivf/bench_all_ivf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_all_ivf/bench_kmeans.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_all_ivf/cmp_with_scann.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_all_ivf/datasets_oss.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_all_ivf/make_groundtruth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_all_ivf/parse_bench_all_ivf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_big_batch_ivf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
4 changes: 2 additions & 2 deletions benchs/bench_cppcontrib_sa_decode.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Expand Down
3 changes: 1 addition & 2 deletions benchs/bench_for_interrupt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
3 changes: 1 addition & 2 deletions benchs/bench_gpu_1bn.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python2

# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_gpu_sift1m.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
4 changes: 2 additions & 2 deletions benchs/bench_hamming_computer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_hamming_knn.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
4 changes: 2 additions & 2 deletions benchs/bench_heap_replace.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_hnsw.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_hybrid_cpu_gpu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
3 changes: 1 addition & 2 deletions benchs/bench_index_flat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_index_pq.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_ivf_fastscan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_ivf_fastscan_single_query.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
4 changes: 2 additions & 2 deletions benchs/bench_ivf_selector.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Expand Down
3 changes: 2 additions & 1 deletion benchs/bench_ivfflat_raft.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# @lint-ignore-every LICENSELINT
# Copyright (c) Meta Platforms, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
5 changes: 3 additions & 2 deletions benchs/bench_ivfpq_raft.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# @lint-ignore-every LICENSELINT
# Copyright (c) Meta Platforms, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -165,4 +166,4 @@ def bench_search_milliseconds(index, addVecs, queryVecs, nprobe, k, use_raft):
classical_gpu_search_time = bench_search_milliseconds(
index, xb, queryVecs, args.nprobe, args.k, False)
print("Method: IVFPQ, Operation: SEARCH, dim: %d, n_centroids: %d, numSubQuantizers %d, bitsPerCode %d, numVecs: %d, numQuery: %d, nprobe: %d, k: %d, classical GPU search time: %.3f milliseconds, RAFT enabled GPU search time: %.3f milliseconds" % (
n_cols, nlist, M, args.bits_per_code, n_add, n_rows, args.nprobe, args.k, classical_gpu_search_time, raft_gpu_search_time))
n_cols, nlist, M, args.bits_per_code, n_add, n_rows, args.nprobe, args.k, classical_gpu_search_time, raft_gpu_search_time))
3 changes: 1 addition & 2 deletions benchs/bench_pairwise_distances.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_partition.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_polysemous_1bn.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
3 changes: 1 addition & 2 deletions benchs/bench_polysemous_sift1m.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
3 changes: 1 addition & 2 deletions benchs/bench_pq_tables.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
3 changes: 1 addition & 2 deletions benchs/bench_pq_transposed_centroid_table.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_quantizer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/bench_scalar_quantizer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
3 changes: 1 addition & 2 deletions benchs/bench_vector_ops.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python2

# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/datasets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
3 changes: 1 addition & 2 deletions benchs/distributed_ondisk/combined_index.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
3 changes: 1 addition & 2 deletions benchs/distributed_ondisk/distributed_kmeans.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/distributed_ondisk/distributed_query_demo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/distributed_ondisk/make_index_vslice.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/distributed_ondisk/make_trained_index.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/distributed_ondisk/merge_to_ondisk.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
3 changes: 1 addition & 2 deletions benchs/distributed_ondisk/run_on_cluster.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /bin/bash

# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion benchs/distributed_ondisk/search_server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
3 changes: 1 addition & 2 deletions benchs/kmeans_mnist.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python2

# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Expand Down
5 changes: 2 additions & 3 deletions c_api/AutoTune_c.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

// Copyright 2004-present Facebook. All Rights Reserved.
// -*- c++ -*-

#include "AutoTune_c.h"
Expand Down
Loading

0 comments on commit ed7b184

Please sign in to comment.