1065 Commits

Author SHA1 Message Date
Matthijs Douze
b9ea339617 support range search from GPU (#2860)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2860

Optimized range search function where the GPU computes by default and falls back on gpu for queries where there are too many results.

Parallelize the CPU to GPU cloning, it seems to work.

Support range_search_preassigned in Python

Fix long-standing issue with SWIG exposed functions that did not release the GIL (in particular the MapLong2Long).

Adds a MapInt64ToInt64 that is more efficient than MapLong2Long.

Reviewed By: algoriddle

Differential Revision: D45672301

fbshipit-source-id: 2e77397c40083818584dbafa5427149359a2abfd
2023-05-16 00:27:53 -07:00
Matthijs Douze
54d331ee22 Update INSTALL.md (#2853)
Summary:
Update the INSTALL to get a recipe "that works" to install GPU faiss (which is not obvious).

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2853

Reviewed By: algoriddle

Differential Revision: D45652590

Pulled By: mdouze

fbshipit-source-id: fededbdfda33e7a44d279e6bf16da316cff6fcb0
2023-05-15 06:55:00 -07:00
Gergely Szilvasy
f809cf0d51 fix osx openmp (#2857)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2857

Reviewed By: alexanderguzhva

Differential Revision: D45791625

Pulled By: algoriddle

fbshipit-source-id: 52ec30f0ec66812f60a08843947aabe8be876afa
2023-05-12 09:07:50 -07:00
Gergely Szilvasy
eea4a48b97 pin mkl to 2023 (#2856)
Summary:
This fixes the build, except for MacOS, where there's a problem with cmake + OpenMP. We can fix it separately.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2856

Reviewed By: mlomeli1

Differential Revision: D45704458

Pulled By: algoriddle

fbshipit-source-id: 0c09036ae5fa34ab114b857f407a35603986613a
2023-05-09 12:20:54 -07:00
Alexandr Guzhva
81f27099ec enable RAFT under the hood of GPU FAISS (#2840)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2840

Reviewed By: wickedfoo, mdouze

Differential Revision: D45054274

fbshipit-source-id: 87889a30e209431908f488035bcf01a4b2bb2eee
2023-05-09 11:14:03 -07:00
Matthijs Douze
3219e3d12e Support Selector for IDMap (#2848)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2848

Add selector support for IDMap wrapped indices.
Caveat: this requires to wrap the IDSelector with another selector. Since the params are const, the const is casted away.

This is a problem if the same params are used from multiple execution threads with different selectors. However, this seems rare enough to take the risk.

Reviewed By: alexanderguzhva

Differential Revision: D45598823

fbshipit-source-id: ec23465c13f1f8273a6a46f9aa869ccae2cdb79c
2023-05-08 15:06:22 -07:00
Alexandr Guzhva
5b172252ef HNSW speedup + Distance 4 points (#2841)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2841

* Add virtual void DistanceComputer::distances_to_four_indices()
* Add the infrastructure
* HNSW::search() uses DistanceComputer::distances_to_four_indices()
* Add IndexFlatL2::sync_l2norms() and IndexFlatL2::clear_l2norms() that allow to precompute L2 cache for stored vectors and compute L2 distance using dot product
* Add downcasting of IndexFlatL2 and IndexFlatIP in swig
* Add general-purpose prefetch utilities

Reviewed By: mdouze

Differential Revision: D45427064

fbshipit-source-id: d23b34fe080dbff951d34cdc1323813bd3b828e0
2023-05-05 16:13:16 -07:00
Alexandr Guzhva
f276c47c76 Minor speedup of HNSW (#2832)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2832

Switch to `omp schedule(guided)` in HNSW::search() call

Reviewed By: mdouze

Differential Revision: D45360510

fbshipit-source-id: 5230429748c0e1e12d8fc2ea7184e273dee76bdf
2023-05-04 16:01:21 -07:00
Alexandr Guzhva
29318b34a3 improve PQ/IVFPQ code_distance() for avx2 for 4 and 8 subquantizers (#2831)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2831

Reviewed By: mdouze

Differential Revision: D45329803

fbshipit-source-id: 627be46036b313f4be05e9a54b13562b414d2789
2023-05-04 13:25:02 -07:00
Alexandr Guzhva
bc120154fa Fix PR problems (#2839)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2839

Reviewed By: algoriddle

Differential Revision: D45054275

fbshipit-source-id: 7eca136a6baff97e244d570c3ba7ab3171ccca48
2023-05-04 12:26:59 -07:00
Alexandr Guzhva
1fb696838e upgrade raft version to 23.06 (#2847)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2847

Addresses https://github.com/facebookresearch/faiss/issues/2844

Reviewed By: algoriddle

Differential Revision: D45569204

fbshipit-source-id: 75c00ebb6d835107f8ba029b4e98ae247fff77a6
2023-05-04 10:23:46 -07:00
Matthijs Douze
2d8886cd4f IVF sorting routine (#2846)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2846

Adds a function to ivf_contrib to sort the inverted lists by size without changing the results. Also moves big_batch_search to its own module.

Reviewed By: algoriddle

Differential Revision: D45565880

fbshipit-source-id: 091a1c1c074f860d6953bf20d04523292fb55e1a
2023-05-04 09:59:06 -07:00
Corey J. Nolet
4f574d59b0 Integrate RAFT FlatIndex / Distances (#2707)
Summary:
I've broken out the FlatIndex / Distances changes from https://github.com/facebookresearch/faiss/issues/2521 into a separate PR to make things a litle easier to review. This does also include a couple other minor changes to the IVF Flat index which I used to make it easier to dispatch to the RAFT version. I can revert that change too if desired.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2707

Reviewed By: wickedfoo

Differential Revision: D44758912

Pulled By: algoriddle

fbshipit-source-id: b2544990b4e941a2558f5004bceec4af4fa1ad09
2023-05-03 13:13:45 -07:00
Gergely Szilvasy
cbff63e3b7 addn_query_subset_with_ids float index bug (#2834)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2834

Index stored in float results in buffer overflow and corrupts search results.

Reviewed By: mdouze

Differential Revision: D45388883

fbshipit-source-id: bee696495b323a13350550d1928d25202539b1f0
2023-04-28 05:14:18 -07:00
Gergely Szilvasy
155065c8c4 stop expensive osx arm64 builds on every diff (#2835)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2835

I don't think this provides much extra signal on top of Linux arm64, and we will still have the nightly. It's by far the most expensive to run, so let's save the $$$ and the planet.

Reviewed By: mlomeli1

Differential Revision: D45389825

fbshipit-source-id: 63fa6b37f3f7505f118c75f03605c065f1ad51f1
2023-04-28 03:53:20 -07:00
Matthijs Douze
3704bbe4a7 Add GIST1M to datasets
Summary: GIST1M is on the fair cluster but was not added to the datsets.py

Reviewed By: alexanderguzhva

Differential Revision: D45276664

fbshipit-source-id: 8db41d61b78983f5d01dedca1790618f80f6bc78
2023-04-26 02:07:11 -07:00
Alexandr Guzhva
1cb1e54442 upgrade horizontal sum in distance_single_code for PQ/IVFPQ (#2830)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2830

17 cycles per AVX2 horizontal sum instead of 19

Reviewed By: mdouze

Differential Revision: D45244153

fbshipit-source-id: 15accba2e8b4f12725dba41696c302e72f61c2db
2023-04-25 07:00:39 -07:00
Alexandr Guzhva
d0ba4c04ca Faster versions of fvec_op_ny_Dx for AVX2 (#2811)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2811

Use transpose_AxB kernels to speedup computations.

Reviewed By: mdouze

Differential Revision: D44726814

fbshipit-source-id: a1dd3e289f4ed564a5bece699bee0af88c9925b0
2023-04-24 15:03:45 -07:00
Maria Lomeli
d87888b13e Prepare for v1.7.4 release (#2820)
Summary:
Updated the changelog with features since last release, see https://github.com/facebookresearch/faiss/compare/1.7.3_release...main for details. Please comment if you want to highlight anything that I've missed.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2820

Reviewed By: mdouze

Differential Revision: D44922916

Pulled By: mlomeli1

fbshipit-source-id: db16754698af4dd0fb8dddff7ec9885170a3d5c4
v1.7.4
2023-04-19 06:18:30 -07:00
Alexandr Guzhva
dc2b0081b6 Improve GenHammingDistance for ARM (#2816)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2816

Reviewed By: mdouze

Differential Revision: D44817943

fbshipit-source-id: 02e383edb2ee1d458df11196527065203bd7092c
2023-04-18 12:56:58 -07:00
Alexandr Guzhva
d407d3fd03 Improve GenHammingDistance for AVX2 (#2815)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2815

Reviewed By: mdouze

Differential Revision: D44817810

fbshipit-source-id: 3d392a6a87ef0192b9ae06fc934fe980596d96a7
2023-04-18 12:56:58 -07:00
Alexandr Guzhva
3b13c625c6 Reduces OMP overhead single query search (#2825)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2825

Includes ProductQuantizer::search

Reviewed By: mdouze

Differential Revision: D45028415

fbshipit-source-id: 088b10af18e89088bbd8367ed5e0a266cef5c29d
2023-04-18 07:01:30 -07:00
Zhiyong Wang
c5834c92be Fixed a unit test
Summary: This diff removed some unused import.

Reviewed By: bixue2010

Differential Revision: D44921327

fbshipit-source-id: f60385517126876b4a4f6ca6200d5b42446b3c82
2023-04-13 11:00:56 -07:00
zh Wang
159641a06c Fix bug of HNSW (#2771)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2771

Test Plan:
A DEFINITE BUG. Fixing it improves the recall rate.

Reproduce with the following code:
```
MinimaxHeap heap(1);
heap.push(1, 1.0);

float v1 = 0;
heap.pop(&v1);

heap.push(1, 1.0);
assert(heap.nvalid == 1);
```

Baseline
```
[aguzhva@devgpu005.ftw6 ~/fbsource/buck-out/v2/gen/fbcode/faiss/benchs (064c246e0)]$ taskset -c 72-95 ./bench_hnsw.par 16 hnsw
load data
Testing HNSW Flat
add
hnsw_add_vertices: adding 1000000 elements on top of 0 (preset_levels=0)
  max_level = 4
Adding 1 elements at level 4
Adding 26 elements at level 3
Adding 951 elements at level 2
Adding 30276 elements at level 1
Adding 968746 elements at level 0
Done in 14893.718 ms
search
efSearch 16 bounded queue True 	   0.007 ms per query, R@1 0.8823, missing rate 0.0000
efSearch 16 bounded queue False 	   0.008 ms per query, R@1 0.9120, missing rate 0.0000
efSearch 32 bounded queue True 	   0.012 ms per query, R@1 0.9565, missing rate 0.0000
efSearch 32 bounded queue False 	   0.011 ms per query, R@1 0.9641, missing rate 0.0000
efSearch 64 bounded queue True 	   0.018 ms per query, R@1 0.9889, missing rate 0.0000
efSearch 64 bounded queue False 	   0.019 ms per query, R@1 0.9896, missing rate 0.0000
efSearch 128 bounded queue True 	   0.036 ms per query, R@1 0.9970, missing rate 0.0000
efSearch 128 bounded queue False 	   0.037 ms per query, R@1 0.9970, missing rate 0.0000
efSearch 256 bounded queue True 	   0.062 ms per query, R@1 0.9991, missing rate 0.0000
efSearch 256 bounded queue False 	   0.067 ms per query, R@1 0.9991, missing rate 0.0000

[aguzhva@devgpu005.ftw6 ~/fbsource/buck-out/v2/gen/fbcode/faiss/benchs (fc6e9b938|remote/fbsource/stable...)]$ taskset -c 72-95 ./bench_hnsw.par 4 hnsw_sq
load data
Testing HNSW with a scalar quantizer
training
add
hnsw_add_vertices: adding 1000000 elements on top of 0 (preset_levels=0)
  max_level = 5
Adding 1 elements at level 5
Adding 15 elements at level 4
Adding 194 elements at level 3
Adding 3693 elements at level 2
Adding 58500 elements at level 1
Adding 937597 elements at level 0
Done in 8900.962 ms
search
efSearch 16 	   0.003 ms per query, R@1 0.7365, missing rate 0.0000
efSearch 32 	   0.006 ms per query, R@1 0.8712, missing rate 0.0000
efSearch 64 	   0.011 ms per query, R@1 0.9415, missing rate 0.0000
efSearch 128 	   0.018 ms per query, R@1 0.9778, missing rate 0.0000
efSearch 256 	   0.036 ms per query, R@1 0.9917, missing rate 0.0000
```

Candidate:
```
[aguzhva@devgpu005.ftw6 ~/fbsource/buck-out/v2/gen/fbcode/faiss/benchs (064c246e0)]$ taskset -c 72-95 ./bench_hnsw.par 16 hnsw
load data
I0408 09:45:20.949554 3024612 ContainerResourceMonitor.cpp:68] devserver cgroup2Reader creation is successful
Testing HNSW Flat
add
hnsw_add_vertices: adding 1000000 elements on top of 0 (preset_levels=0)
  max_level = 4
Adding 1 elements at level 4
Adding 26 elements at level 3
Adding 951 elements at level 2
Adding 30276 elements at level 1
Adding 968746 elements at level 0
Done in 14243.637 ms
search
efSearch 16 bounded queue True 	   0.006 ms per query, R@1 0.9122, missing rate 0.0000
efSearch 16 bounded queue False 	   0.006 ms per query, R@1 0.9122, missing rate 0.0000
efSearch 32 bounded queue True 	   0.011 ms per query, R@1 0.9643, missing rate 0.0000
efSearch 32 bounded queue False 	   0.011 ms per query, R@1 0.9644, missing rate 0.0000
efSearch 64 bounded queue True 	   0.018 ms per query, R@1 0.9880, missing rate 0.0000
efSearch 64 bounded queue False 	   0.020 ms per query, R@1 0.9880, missing rate 0.0000
efSearch 128 bounded queue True 	   0.036 ms per query, R@1 0.9969, missing rate 0.0000
efSearch 128 bounded queue False 	   0.035 ms per query, R@1 0.9969, missing rate 0.0000
efSearch 256 bounded queue True 	   0.064 ms per query, R@1 0.9994, missing rate 0.0000
efSearch 256 bounded queue False 	   0.062 ms per query, R@1 0.9994, missing rate 0.0000

[aguzhva@devgpu005.ftw6 ~/fbsource/buck-out/v2/gen/fbcode/faiss/benchs (6de3a2d76)]$ taskset -c 72-95 ./bench_hnsw.par 4 hnsw_sq
load data
Testing HNSW with a scalar quantizer
training
add
hnsw_add_vertices: adding 1000000 elements on top of 0 (preset_levels=0)
  max_level = 5
Adding 1 elements at level 5
Adding 15 elements at level 4
Adding 194 elements at level 3
Adding 3693 elements at level 2
Adding 58500 elements at level 1
Adding 937597 elements at level 0
Done in 8451.601 ms
search
efSearch 16 	   0.004 ms per query, R@1 0.8025, missing rate 0.0000
efSearch 32 	   0.006 ms per query, R@1 0.8925, missing rate 0.0000
efSearch 64 	   0.011 ms per query, R@1 0.9480, missing rate 0.0000
efSearch 128 	   0.019 ms per query, R@1 0.9793, missing rate 0.0000
efSearch 256 	   0.035 ms per query, R@1 0.9919, missing rate 0.0000

```

Reviewed By: mdouze

Differential Revision: D44815702

Pulled By: alexanderguzhva

fbshipit-source-id: ca7c7e83a6560316af543bde125ac703bf2e1dac
2023-04-11 08:32:06 -07:00
Alexandr Guzhva
c22b980942 Faster version of fvec_L2sqr_ny_nearest_Dx for AVX2 (#2810)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2810

A faster implementation for fvec_L2sqr_ny_nearest_Dx() (used in ProductQuantizer.compute_codes()) for the mode without transposed centroids enabled.

Uses in-register transposing rather than gather ops.

Reviewed By: mdouze

Differential Revision: D44631863

fbshipit-source-id: 026fdb4c133e238271c65a766d8eaa20be777033
2023-04-07 12:05:24 -07:00
Gergely Szilvasy
a3d6212983 upgrade cmake to 3.23.1 (#2808)
Summary:
RAFT requires cmake 3.23.1, pulling it from conda-forge. We continue to keep the dependency on conda-forge minimal, hence the ordering of the channels and the pinning of sysroot to a specific version.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2808

Test Plan:
contbuild

Imported from GitHub, without a `Test Plan:` line.

Reviewed By: mlomeli1

Differential Revision: D44746827

Pulled By: algoriddle

fbshipit-source-id: ad576b11b257203bd0cafd57c2c2e7fd8d10ca98
2023-04-06 06:25:51 -07:00
Gergely Szilvasy
d5ca6f0a79 implement range search + nprobe (#2806)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2806

Adding `range_search()` and setting `nprobe`.

Differential Revision: D44624454

fbshipit-source-id: f5a9202082f1e40ea57e1df31bcc2c22c616a964
2023-04-03 07:39:09 -07:00
Gergely Szilvasy
7bf645e344 GPU builds without Docker (#2803)
Summary:
1. GPU builds use CircleCI base image, no docker
2. Switched to CUDA 11.4 (used to be 11.3)
3. Merged all build jobs into two parameterized targets: `build_cmake` and `build_conda`.
4. Cleaned up test execution, fixed bug of Python GPU tests not running on PRs

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2803

Reviewed By: mlomeli1

Differential Revision: D44541714

Pulled By: algoriddle

fbshipit-source-id: aa09ae638ecb6ef556d42f27a4bfaddad7355e50
2023-03-30 10:45:54 -07:00
Gergely Szilvasy
2686183ee5 refactor contbuild, add new GPU targets, support Linux arm64 conda packages (#2798)
Summary:
# Refactor
- Extract executors and merge all conda builds (that run on diffs) and conda package builds (that run nightly and on release) into two parameterized targets (`build_conda`, `deploy_conda`), except for GPU builds (at least for now)
- Similarly, introduce a `build_cmake` target that can be parameterized with executor, although run it for Linux x86_64 only (for now)
- Keep GPU targets separate (both conda package build and cmake) for now. Introduce "v2" targets that will eventually replace the current GPU build targets (we need to resolve GPU test failures).
- Removed `beauby/faiss-circleci:cpu` docker container, use the miniconda docker for Linux and machine images everywhere else. v2 GPU targets use the latest circleci images (see https://discuss.circleci.com/t/cuda-11-8-gpu-cuda-image-any-plans/47240/3)

# New/changed functionality
- Dropped CUDA 10
- Support for Linux arm64 conda packages
- Workflows have a consistent naming scheme, `OSX arm64 (conda)`,  `Linux x86_64 (cmake)` etc.
- No cmake build for Linux or OSX arm64, replaced both with a conda build target only. We can reintroduce arm64 cmake workflows for both if needed (via additional parameterized build_cmake workflows), but it seemed unnecessary to me.

# Next steps
- Make v2 GPU builds work, deprecate v1, get rid of all docker stuff
- Merge GPU builds into cmake/conda build targets
- Possibly further unify package build and conda build targets

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2798

Test Plan: contbuild

Reviewed By: mlomeli1

Differential Revision: D44469783

Pulled By: algoriddle

fbshipit-source-id: 8489942fb7a4e4de1dd2d4466790e550191d15a1
2023-03-29 06:56:27 -07:00
Alexandr Guzhva
5840c17332 enable approx top-k for hamming_kc() and IndexBinaryFlat (#2787)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2787

Approximate top-k facilities allow to speedup IndexBinaryFlat search / hamming_knn_hc() search a bit, if the number k of needed nearest neighbors is small (no more than NB * BD for `ApproxTopK_mode_t::APPROX_TOPK_BUCKETS_NB_BD`, otherwise an exception is thrown)

Use case:
```
approx_mode: int = 0, 1, 2, 3 or 4

subq = faiss.downcast_IndexBinary(index.quantizer)
subq.approx_topk_mode
subq.approx_topk_mode = approx_mode
```
Please reference `faiss/utils/approx_topk/mode.h` for more detailed explanation of modes.

Reviewed By: mdouze

Differential Revision: D44398992

fbshipit-source-id: aac7c35c88d567ba73c88614a1c86f3e8b254ef3
2023-03-28 18:46:53 -07:00
Alexandr Guzhva
2023b3f548 Introduce approx top-k facilities for Hamming Distance (#2785)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2785

Reviewed By: mdouze

Differential Revision: D44398450

fbshipit-source-id: f964d58531b7caf4f908c2b77efe58ec9fc9d38f
2023-03-28 17:58:41 -07:00
Alexandr Guzhva
bca5486d7f add __restrict keywords to hamming.cpp (#2786)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2786

A compiler seems to be sensitive

Reviewed By: mdouze

Differential Revision: D44398428

fbshipit-source-id: 4edce0751d5ead4cb961d94037bd420347417f74
2023-03-28 16:56:01 -07:00
Alexandr Guzhva
5b62535330 expose approx top-k mode to a separate header file (#2784)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2784

Reviewed By: mdouze

Differential Revision: D44398351

fbshipit-source-id: c57ed63a72484f0e32f2f4dcb4c143058a8e3cd0
2023-03-28 15:34:07 -07:00
Alexandr Guzhva
f3d3a96a97 Add __restrict keywords to IndexBinaryIVF.cpp (#2788)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2788

Compiler seems to be sensitive

Reviewed By: mdouze

Differential Revision: D44398233

fbshipit-source-id: 4dc751e3ed7353944a85038a2bc3900a51147d68
2023-03-28 14:15:27 -07:00
Alexandr Guzhva
04ba8f97e0 Additional comparison facilities in simdlib (#2783)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2783

Add needed facilities for future top-k needs

Reviewed By: mdouze

Differential Revision: D44397732

fbshipit-source-id: 001f9baff0bd234e33f7d0a1da6dc6cb990b1844
2023-03-28 14:01:59 -07:00
Alexandr Guzhva
8d82d24b89 Hamming distance refactoring & ARM version (#2782)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2782

Add a separate branch for ARM Hamming Distance computations. Also, improves a benchmark for hamming computer.

Reviewed By: mdouze

Differential Revision: D44397463

fbshipit-source-id: 1e44e8e7dd1c5b92e95e8afc754170b501d0feed
2023-03-28 13:44:48 -07:00
Matthijs Douze
016aa04602 make balanced clusters the default (#2796)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2796

This diff makes balanced clusters the default for 2-level clustering. This seems to improve a bit over the default uniform clusters, see

https://github.com/fairinternal/faiss_improvements/blob/master/better_coarse_quantizer/two_level_clustering.ipynb

Warning: the nc2 argument of two_level_clustering becomes the *total* number of clusters.

Reviewed By: algoriddle

Differential Revision: D44421222

fbshipit-source-id: 951b7fc043be4a41762a7e6f7a6fcfb71e303832
2023-03-28 07:23:30 -07:00
Matthijs Douze
c78b18cdb2 remove setNumProbes (#2797)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2797

This is the last code instance of setNumProbes
Removing because some people still seem run into errors due to this.

Reviewed By: algoriddle

Differential Revision: D44421600

fbshipit-source-id: fbc1a9d49a0175ddf24c32dab5c1bdb5f1bbbac6
2023-03-28 07:02:53 -07:00
zh Wang
4012a788ee Fix bug of NNDescent (#2762)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2762

Reviewed By: alexanderguzhva

Differential Revision: D44366557

Pulled By: mdouze

fbshipit-source-id: 7e869dd004060ac4a8933df24be4e8b2c90c1cd7
2023-03-28 03:09:05 -07:00
Gergely Szilvasy
766f9c8e93 add python 3.10 (#2791)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2791

Removed building for 3.7 (D44373285 - not supported for M1), adding 3.10 with this diff.

The only change that matters is in `conda_build_config.yaml`, the others are about making the configs consistent between CPU and GPU.

Reviewed By: mlomeli1

Differential Revision: D44405573

fbshipit-source-id: ad933e08834593e55a35075c602e5f509a813e73
2023-03-27 04:41:14 -07:00
Matthijs Douze
581760302f evaluation script + IVF block search (#2781)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2781

This is a benchmarking script for keypoint matching with labelled ground-truth.

Reviewed By: alexanderguzhva

Differential Revision: D44036091

fbshipit-source-id: d9d7c089c4d172b66f33dc968c00713a1b79c2d1
2023-03-24 13:54:08 -07:00
Gergely Szilvasy
770250b68d add m1 conda support (#2780)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2780

Reviewed By: mlomeli1

Differential Revision: D44373285

Pulled By: algoriddle

fbshipit-source-id: 91f22b6e92f9ef0e72e0b8a7c892566f12d0d48c
2023-03-24 13:41:44 -07:00
Ikko Eltociear Ashimine
71ffe3f424 Fix typo in test_gpu_basics.py (#2736)
Summary:
resutls -> results

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2736

Reviewed By: alexanderguzhva

Differential Revision: D44366701

Pulled By: mdouze

fbshipit-source-id: 8ee58dfb72a4fb33a0d117d11c7128b4ed6025be
2023-03-24 12:06:44 -07:00
zh Wang
a45b80d4e2 Fix potential integer overflow (#2423)
Summary:
Signed-off-by: zh Wang <rekind133@outlook.com>

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2423

Reviewed By: mlomeli1

Differential Revision: D44366857

Pulled By: mdouze

fbshipit-source-id: f70189db2da5037098edcc64fdfe67ab1b6ee765
2023-03-24 09:50:46 -07:00
Kaelen Haag
aae6ff5129 Id selector c api (#2755)
Summary:
Implements c_api interfaces for IDSelectorNot, IDSelectorAnd, IDSelectorOr, IDSelectorXOr

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2755

Reviewed By: alexanderguzhva

Differential Revision: D44366433

Pulled By: mdouze

fbshipit-source-id: b28eb32852188888f51b7ba08b37f76e174dcf3c
2023-03-24 09:25:48 -07:00
moscicky
0f07e8525c Add info about building C API to INSTALL.md (#2706)
Summary:
This PR adds missing info about building C API to installation guide

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2706

Reviewed By: alexanderguzhva

Differential Revision: D44366748

Pulled By: mdouze

fbshipit-source-id: 0553571b7187ee9712c8dc73cc66e8839345912d
2023-03-24 08:16:47 -07:00
lsb
3b7dec8d76 Minor typo (#2728)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2728

Reviewed By: alexanderguzhva

Differential Revision: D44366689

Pulled By: mdouze

fbshipit-source-id: 286778ceed6f6b4029d646a5363977c1a9034ec6
2023-03-24 08:14:09 -07:00
I
5dcd282ef6 Support SIMD Histogram Subroutines on aarch64 (#2447)
Summary:
Currently SIMD histogram subroutines are written with `simdlib` **and AVX2 intrinsics** .
This PR adds some functions to `simdlib` and removes AVX2 intrinsics from SIMD histogram subroutines, so faiss with this PR can execute histogram using ARM SIMD on aarch64.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2447

Reviewed By: alexanderguzhva

Differential Revision: D39461155

Pulled By: mdouze

fbshipit-source-id: 63a664e3e2ed462b451acc346ea58a2532f294c9
2023-03-24 05:08:02 -07:00
Matthijs Douze
547fe78c68 Support M1 in circleCI (#2774)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2774

Reviewed By: algoriddle

Differential Revision: D44215129

Pulled By: mdouze

fbshipit-source-id: 62266b214186684eaf49ab1b9a39971b324fd52b
2023-03-23 15:09:32 -07:00
Y.Imaizumi
82d63c7006 Fix Debug Build on aarch64 (#2768)
Summary:
related: https://github.com/facebookresearch/faiss/issues/1916, https://github.com/facebookresearch/faiss/issues/1979, https://github.com/facebookresearch/faiss/issues/2009, https://github.com/facebookresearch/faiss/issues/2013, https://github.com/facebookresearch/faiss/issues/2195, https://github.com/facebookresearch/faiss/issues/2210

After my PR https://github.com/facebookresearch/faiss/issues/1815 had been merged `-DCMAKE_BUILD_TYPE=Debug` has been invalid on aarch64, and many people have been hit the problem. (sorry to inconvenience...)
This PR fixes this.

### Details:

Using the function pointers of intrinsics on run-time context causes the link errors.
`-DCMAKE_BUILD_TYPE=Release` has been available because compiler optimizer can propagate and collapse the function pointers as constant.
However, when the pointers doesn't collapsed the link errors occurred, so `-DCMAKE_BUILD_TYPE=Debug` has been unavailable.
To prevent the link errors, I've replaced the function pointers of intrinsics on run-time context to on compile-time context explicitly.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2768

Reviewed By: mdouze

Differential Revision: D44296147

Pulled By: alexanderguzhva

fbshipit-source-id: 81fa013c5e05a486b6b82cb85d76eeefdefca891
2023-03-23 01:55:59 -07:00