Commit Graph

31 Commits (debug_ivfrq_reconstruct_failures)

Author SHA1 Message Date
Xiao Fu a900cfa9f1 Add cpp tutorial for index factory refine index construction (#3494)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3494

This tasks focus on the refine index construction tutorial with different index refinement on fp16/sq8 quantization. The python version was added a while ago.

Reviewed By: junjieqi

Differential Revision: D58161983

fbshipit-source-id: 1c598fe612b5dee3952c5f7398e6802e117f141d
2024-06-04 19:44:27 -07:00
Xiao Fu 6e423cc649 Add python tutorial on different indexs refinement and respect accuracy measurement (#3480)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3480

This tutorial summarize the methods to construct different indexs for PQFastScan refinement. It shows how the choice can impact on accuracy.

Reviewed By: junjieqi

Differential Revision: D57799598

fbshipit-source-id: a75c52c60a5217366f3361676da8f03f0c4a9feb
2024-05-27 11:55:06 -07:00
Xiao Fu 414fd1e3b7 Add tutorial for FastScan with refinement for cpp (#3474)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3474

This commit focus on the cpp version of PQfastscan tutorial with index refinement by defining the k factor.

Reviewed By: junjieqi

Differential Revision: D57680905

fbshipit-source-id: 980c2990172f24ec9a4f870685e706195883408f
2024-05-22 13:01:37 -07:00
Xiao Fu 7d7fef0b58 Add FastScan refinement tutorial for python (#3469)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3469

Reviewed By: junjieqi

Differential Revision: D57650807

fbshipit-source-id: 5e642a8140455e4a3f1f21afe2f06771462e61f4
2024-05-22 09:30:18 -07:00
Xiao Fu f38e52c1e2 Add tutorial on PQFastScan for cpp (#3468)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3468

This commit includes the tutorial for PQFastScan in the cpp environment.

Reviewed By: junjieqi

Differential Revision: D57631441

fbshipit-source-id: f5e17eee2a584ebfc9ff63868d741d0da6b3b413
2024-05-21 16:42:15 -07:00
Saarth Deshpande 59e3ee1e30 Missed printing 'D' (#3433)
Summary:
'I' was printed twice and 'D' (distance vector) was not printed. Fixed.

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

Reviewed By: fxdawnn

Differential Revision: D57451544

Pulled By: junjieqi

fbshipit-source-id: fc17b3b467f8b2c4ad7d80b44866456d9146e530
2024-05-21 13:02:25 -07:00
Xiao Fu 4489773fd4 Add tutorial for FastScan (#3465)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3465

This commit include python version of tutorial for FastScan. It includes all the parameters enabled within PQFastScan.

Reviewed By: junjieqi

Differential Revision: D57594044

fbshipit-source-id: cb12679b6fc241a654b9545c5bc7bd0517aa1813
2024-05-21 09:50:41 -07:00
Richard Barnes b8e4489b98 Remove unused variables in faiss/IndexIVFFastScan.cpp (#3439)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3439

LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje, junjieqi

Differential Revision: D57344013

fbshipit-source-id: adf410139d2e6ca69a26ccdbff8511c9b7620489
2024-05-15 11:45:48 -07:00
Jayjeet Chakraborty 3121fc6175 Fix #3379: Add tutorial for HNSW index (#3381)
Summary:
Fixes https://github.com/facebookresearch/faiss/issues/3379

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

Reviewed By: junjieqi

Differential Revision: D56570120

Pulled By: kuarora

fbshipit-source-id: 758ea4ab866609d6dd5621e6e6ffda583ba52503
2024-04-30 12:23:58 -07:00
Matthijs Douze a996a4a052 Put idx_t in the faiss namespace (#2582)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2582

A few more or less cosmetic improvements
* Index::idx_t was in the Index object, which does not make much sense, this diff moves it to faiss::idx_t
* replace multiprocessing.dummy with multiprocessing.pool
* add Alexandr as a core contributor of Faiss in the README ;-)

```
for i in $( find . -name \*.cu -o -name \*.cuh -o -name \*.h -o -name \*.cpp ) ; do
  sed -i s/Index::idx_t/idx_t/ $i
done
```

For the fbcode deps:
```
for i in $( fbgs Index::idx_t --exclude fbcode/faiss -l ) ; do
   sed -i s/Index::idx_t/idx_t/ $i
done
```

Reviewed By: algoriddle

Differential Revision: D41437507

fbshipit-source-id: 8300f2a3ae97cace6172f3f14a9be3a83999fb89
2022-11-30 08:25:30 -08:00
Lucas Hosseini e86bf8cae1 Enable clang-format + autofix.
Summary: Format whole codebase with clang-format.

Reviewed By: mdouze

Differential Revision: D22891341

fbshipit-source-id: 673032b2444d61026d1e2c3fa2c5659f178cf58b
2021-02-25 04:46:10 -08:00
Matthijs Douze 15ffe976f0 fix tutorial files
Summary:
Added TARGETS files and fixed GPU tutorial code.
Related to issue https://github.com/facebookresearch/faiss/issues/1408

Reviewed By: beauby

Differential Revision: D23728732

fbshipit-source-id: 22bec7d439ffc187c144575e1e984111bfbfcbb2
2020-09-17 07:32:56 -07:00
Lucas Hosseini c37e71456b Get rid of non-portable drand48. (#1349)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/1349

Reviewed By: mdouze

Differential Revision: D23289393

Pulled By: beauby

fbshipit-source-id: a626bbf252ced4ae01abbc3dce4be50d9e628728
2020-08-24 00:42:21 -07:00
Lucas Hosseini b539a73e58 Linter auto-fix.
Summary: `arc lint faiss/**/*`

Reviewed By: LowikC

Differential Revision: D22891305

fbshipit-source-id: 45bab7294ccccf70898b4967b03683894b6ae4c4
2020-08-16 19:52:27 -07:00
Lucas Hosseini a8e4c5e2d5 Move build to CMake (#1313)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/1313

Reviewed By: mdouze

Differential Revision: D22948267

Pulled By: beauby

fbshipit-source-id: ec16fa0342f37672d46fb7886ecc55c7996011c4
2020-08-14 15:03:10 -07:00
Matthijs Douze 9258a9535e
fix datatypes for mac (#1270) 2020-06-28 13:00:44 +02:00
Matthijs Douze 1a332509a3
Update 5-Multiple-GPUs.cpp
Thanks to gameofdimension
https://github.com/facebookresearch/faiss/pull/1060/files
2020-01-16 16:46:11 +01:00
Lucas Hosseini a8118acbc5
Facebook sync (May 2019) + relicense (#838)
Changelog:

- changed license: BSD+Patents -> MIT
- 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
2019-05-28 16:17:22 +02:00
gensmusic 712edb043a tutorial build add CPPFLAGS which contains cuda include pathi when ./configure --with-cuda (#833) 2019-05-24 14:46:53 +02:00
Xuhui Sun 0a8f92d6d6 Update cpp tutorial makefile for GPU part (#774) 2019-04-11 14:20:38 +02:00
Lucas Hosseini ac7005b6ef Remove CMake. (#645) 2018-12-23 18:45:16 +01:00
Lucas Hosseini cf18101f6d Refactor makefiles and add configure script (#466)
* Refactors Makefiles and add configure script.

* Give MKL higher priority in configure script.

* Clean up Linux example makefile.inc.

* Cleanup makefile.inc examples.

* Fix python clean Makefile target.

* Regen swig wrappers.

* Remove useless CUDAFLAGS variable.

* Fix python linking flags.

* Separate compile and link phase in python makefile.

* Add macro to look for swig.

* Add CUDA check in configure script.

* Cleanup make depend targets.

* Cleanup CUDA flags.

* Fix linking flags.

* Fix python GPU linking.

* Remove useless flags from python gpu module linking.

* Add check for cuda libs.

* Cleanup GPU targets.

* Clean up test target.

* Add cpu/gpu targets to python makefile.

* Clean up tutorial Makefile.

* Remove stale OS var from example makefiles.

* Clean up cuda example flags.
2018-06-02 08:35:30 +02:00
Lizz 3bdc5abeaf Fix compile error in cpp tutorial (#380)
Not tested but looks legitimate + better than previous state in any case ;-)
2018-03-28 09:15:18 -04:00
Lucas Hosseini 16aed09c0f
Make tutorial examples use dynamic linkage. (#343)
* Add shared lib target for GPU version.

* Dynamically link tutorial examples.

* Add shared lib to clean target in GPU Makefile.

* Add clean target to tutorial examples Makefile.

* Minor modifications to tutorial GPU examples.
2018-02-21 15:36:29 +01:00
Lucas Hosseini 2c9aea24e7
[WIP] Update tutorial examples (#342)
* Remove transitional print import.

* Add example for multiple GPUs in python.

* Add example on GPU in C++.

* Add example on multiple GPUs in C++.

* Add IVFFlat example on GPU in python.

* Add Makefile for C++ tutorial examples.

* Add IVF index on GPU example in C++.
2018-02-20 15:53:56 +01:00
Matthijs Douze 1a9b814873
Update 4-GPU.py 2017-12-18 19:23:30 +01:00
matthijs c4ebee7feb added tuto for GPU 2017-12-07 09:12:19 -08:00
matthijs 8e3dc6f2b0 changed license 2017-07-30 00:18:45 -07:00
matthijs 784e2facd8 Synchronization with FB version 2017-06-21
* moved most FAISS_ASSERT calls to C++ exceptions, and adjusted
  memory allocation to avoid mem leaks

* added an IndexIVFScalarQuantizer type that offers an
  intermediate compression between IVFFlat and IVFPQ

* support removal of indices in IndexIDMap / IndexFlat combination

* various fixes in GPU code
2017-06-21 09:01:06 -07:00
Tianwei Shen 80314d9f07 add initial cmake support (#75)
* add initial cmake support

* update cmake, add cmake instructions to INSTALL

* update findopenmp and INSTALL

* change FindOpenBLAS.cmake to cater for macports

- change cblas.h to openblas_config.h since macports does not ship
cblas.h with openblas.

* revise INSTALL for cmake
2017-05-02 11:04:50 +02:00
Matthijs Douze c670118a4e Initial commit 2017-02-22 23:26:44 +01:00