1432 Commits

Author SHA1 Message Date
Mengdi Lin
2483feaba5 improve naming due to codemod (#4071)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4071

rename aq_2 to aq_init

Reviewed By: pankajsingh88

Differential Revision: D66839486

fbshipit-source-id: 72250df672944c3ecb697dad2e4522b96ca0824c
2024-12-06 07:29:23 -08:00
Mengdi Lin
616c50302a improve naming due to codemod (#4067)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4067

rename L_res_2 to L_res_init

Reviewed By: junjieqi

Differential Revision: D66823751

fbshipit-source-id: 7face41c2ee22f29c7eeec5e39c0ac3eae460275
2024-12-06 07:29:23 -08:00
Mengdi Lin
0f86f33e25 Improve naming due to codemod (#4070)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4070

rename `d_2` to `d` from codemod

Reviewed By: junjieqi

Differential Revision: D66823543

fbshipit-source-id: d1b4c702a31127cba105d4d4f1514f5e33925a50
2024-12-06 06:58:30 -08:00
Junjie Qi
0d568bc400 separare the github build into two conditions (#4066)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4066

Reviewed By: asadoughi

Differential Revision: D66853917

Pulled By: junjieqi

fbshipit-source-id: 800b2f9f797bf19fa262f04f53e32cc2bef27db8
2024-12-05 19:15:14 -08:00
Mengdi Lin
9bb69480df Improve naming due to codemod (#4065)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4065

improve neighbors_2 naming from codemod

Reviewed By: junjieqi

Differential Revision: D66823395

fbshipit-source-id: 90af06e7f6d917581a25311944689f82f12c93e1
2024-12-05 15:32:14 -08:00
Michael Norris
0868ffc5f4 Add more unit testing for IndexHNSW [2/n] (#4056)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4056

Part 2 of more HNSW unit tests

Added comments indicating some currently unused code.

Reviewed By: junjieqi

Differential Revision: D66782376

fbshipit-source-id: 5a7c210d516424e58054f36f0a74249859e48a8f
2024-12-05 15:14:14 -08:00
Mengdi Lin
8939f48803 Improve naming due to codemod (#4064)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4064

Apply matthijs' comments on better naming in D52582914

Reviewed By: junjieqi

Differential Revision: D66822957

fbshipit-source-id: d899dbe89ebd716a18901c734c65dac428856954
2024-12-05 14:21:38 -08:00
Michael Norris
661557e17f Add more unit testing for IndexHNSW [1/n] (#4054)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4054

Part 1 of more HNSW unit tests

Reviewed By: junjieqi

Differential Revision: D66690398

fbshipit-source-id: 29b35f1c0a919c168fd4cb770552f41eaed5b6b6
2024-12-05 13:43:28 -08:00
Mengdi Lin
1af89515db Improve naming due to codemod (#4063)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4063

Apply matthijs' comments on better naming in D65347906

Reviewed By: junjieqi

Differential Revision: D66822854

fbshipit-source-id: 282030ec47239066069716657e0eccf88d3c6cab
2024-12-05 12:10:29 -08:00
Junjie Qi
1ac6f3746b Pin conda build (#4062)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4062

Reviewed By: mengdilin

Differential Revision: D66802452

Pulled By: junjieqi

fbshipit-source-id: c4b59a17fb2385269bcceb51a81390b65130b5c8
2024-12-05 09:37:19 -08:00
Junjie Qi
eb49d8cb8d pin arm64 dependency (#4060)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4060

Reviewed By: mnorris11

Differential Revision: D66795223

Pulled By: junjieqi

fbshipit-source-id: 160c6c6cf0377cdb9754fdd76b1571d15f8e284e
2024-12-04 23:55:58 -08:00
Junjie Qi
82f8e6414e add cuda-toolkit for GPU (#4057)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4057

Reviewed By: bshethmeta

Differential Revision: D66790793

Pulled By: junjieqi

fbshipit-source-id: d43073d3c209b556afe95c9f45c62e841bcb7f1a
2024-12-04 21:05:37 -08:00
George Wang
80a8ff5e5a Unit tests for distances_simd.cpp
Summary:
distances_simd.cpp had insufficient test coverage. While there may be some codepaths untested due to compiler flags, this should cover most of it.

Also added a couple comments and fixed a typo

Reviewed By: pankajsingh88

Differential Revision: D66792601

fbshipit-source-id: 24301ffd383d21703f7579096c6aa9b41ece1509
2024-12-04 18:34:34 -08:00
Michael Norris
eed3860d7e stop dealloc of coarse quantizer when it is deleted (#4045)
Summary:
X-link: https://github.com/pytorch/torchrec/pull/2603

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

Need to add to `__init__.py` like Matthijs mentioned on the github issue https://github.com/facebookresearch/faiss/issues/3993. But we can't do it for non-GPU code, otherwise it will throw an exception and fail many tests than include fbcode/faiss. So we need to check if FAISS GPU is importable first.

To find the class names like GpuIndexIVFFlat etc, I checked everything under faiss/gpu where the constructor accepts an Index. The other Index is always parameter at index 1 (0-indexed), so that's why we use 1 in the function calls.

Reviewed By: pankajsingh88

Differential Revision: D66675910

fbshipit-source-id: f170dadb6318c620420689164f9522f9815aa980
2024-12-04 10:59:36 -08:00
Pankaj Singh
f8ae5f4a24 remove inconsistent oom exception test (#4052)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4052

`std::bad_alloc` exception is not consistent across platforms and libraries. Getting rid of it as it's causing test failures.

Reviewed By: junjieqi

Differential Revision: D66713400

fbshipit-source-id: 9d0784eff40b8fa2aaddb64659f272b80005a821
2024-12-04 10:12:16 -08:00
Junjie Qi
cc5ff1ff0d pin the dependecies version for x86_64 (#4046)
Summary:
Pin dependecy version to get stable CI signal

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

Reviewed By: mnorris11

Differential Revision: D66684832

Pulled By: junjieqi

fbshipit-source-id: 9749d328688034514d6f2315d313fbf8045405ee
2024-12-04 00:13:01 -08:00
Amir Sadoughi
697b6ddf55 Fix unused variable compilation error (#4041)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4041

Reviewed By: junjieqi

Differential Revision: D66477560

fbshipit-source-id: d2ee25424a902744910d3df77bd73b505d131618
2024-11-26 07:47:40 -08:00
Michael Pittard
37f52dc9d2 ROCm support for bfloat16 (#4039)
Summary:
Updated the hipify script to handle bfloat16 conversion and unblocked disabling for ROCm.

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

Reviewed By: junjieqi

Differential Revision: D66413190

Pulled By: asadoughi

fbshipit-source-id: d1564f87e3c3466ff929dfd639bd544318371148
2024-11-25 14:59:11 -08:00
Tarang Jain
d1ae64e03c Updates to faiss-gpu-cuvs nightly pkg (#4032)
Summary:
Attempt to resolve existing issues in faiss-gpu-cuvs conda package (changes to conda build github actions).

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

Reviewed By: junjieqi

Differential Revision: D66427909

Pulled By: asadoughi

fbshipit-source-id: f2b61219ed62bf8487974a8c9feecc7d1faa6618
2024-11-24 21:31:00 -08:00
sadoughi
f31f06a492 Constrain conda version for Windows build (#4040)
Summary:
Failure in nightly build due to https://github.com/conda/conda-build/issues/5549: https://github.com/facebookresearch/faiss/actions/runs/11967515834/job/33370335745

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

Reviewed By: mnorris11

Differential Revision: D66402850

Pulled By: asadoughi

fbshipit-source-id: 1601647ded3d30b750c921b4c7eafa1c0a7ad54b
2024-11-22 20:59:47 -08:00
Jeff Johnson
eaab46c870 Faiss GPU: bfloat16 brute-force kNN support (#4018)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4018

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

This diff adds support for bfloat16 vector/query data types with the GPU brute-force k-nearest neighbor function (`bfKnn`).

The change is largely just plumbing the new data type through the template hierarchy (so distances can be computed in bfloat16).

Of note, by design, all final distance results are produced in float32 regardless of input data type (float32, float16, bfloat16). This is because the true nearest neighbors in many data sets can often differ by only ~1000 float32 ULPs in terms of distance which will result in possible false equivalency. This seems to be one area where lossy compression/quantization thoughout does not work as well (and is also why `CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION` is set in `StandardGpuResources.cpp`. However, given that there is native bf16 x bf16 = fp32 tensor core support on Ampere+ architectures, the matrix multiplication itself should use them.

As bfloat16 support is quite lacking on AMD/ROCm (see [here](https://rocm.docs.amd.com/projects/HIPIFY/en/latest/tables/CUDA_Device_API_supported_by_HIP.html), very few bf16 functions implemented), bf16 functionality is completely disabled / not compiled for AMD ROCm.

Reviewed By: mdouze

Differential Revision: D65459723

fbshipit-source-id: 8a6aec843f7e37c205d95f2485442a26c402a3b0
2024-11-19 19:37:03 -08:00
Satyendra Mishra
844e3ce769 (1/n) - Preload datasets in manifold so that subsequent stages of training, indexing and search can use those instead of each trainer or indexer downloading data. (#4034)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4034

Preload datasets in manifold so that subsequent stages of training, indexing and search can use those instead of each trainer or indexer downloading data.

Reviewed By: kuarora

Differential Revision: D65926898

fbshipit-source-id: 9341d2676fd2a50027887e821ec95768e829af31
2024-11-19 19:22:03 -08:00
Shengqi Chen
98d335b172 Some chore fixes (#4010)
Summary:
- Fix a typo in comment
- Add missing header files to `FAISS_HEADERS` in CMake config

There should be some check against the inconsistency between `FAISS_HEADERS` and actual files, e.g. test compiling with installed headers and shared library (otherwise it always succeeds in the source dir).

This is not the first time that headers are missing (https://github.com/facebookresearch/faiss/issues/3218).

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

Reviewed By: junjieqi

Differential Revision: D65630647

Pulled By: kuarora

fbshipit-source-id: 2efcfc4bbd0b2d29efa817e1ff9371942c15d30a
2024-11-19 16:48:35 -08:00
Junjie Qi
3c25a68e52 fix linter (#4035)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4035

same as title

Reviewed By: bshethmeta

Differential Revision: D66154375

fbshipit-source-id: c5d05aac2d8e502058f0403b0ec0ea243afa18e2
2024-11-19 12:09:40 -08:00
Amir Sadoughi
94b640c66f Pin to numpy<2 (#4033)
Summary:
https://github.com/facebookresearch/faiss/issues/3526 is not addressed yet

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

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

`pytest tests/test_contrib.py`

Reviewed By: junjieqi

Differential Revision: D66140293

Pulled By: asadoughi

fbshipit-source-id: b32e31b7c4f17e4ee309a30296cb28927d78ebd4
2024-11-18 19:11:43 -08:00
Nicholas Ormrod
eb5e7341a6 facebook-unused-include-check in fbcode/faiss (#4029)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4029

Remove headers flagged by facebook-unused-include-check over fbcode.faiss.

+ format and autodeps

This is a codemod. It was automatically generated and will be landed once it is approved and tests are passing in sandcastle.
You have been added as a reviewer by Sentinel or Butterfly.

Autodiff project: uif
Autodiff partition: fbcode.faiss
Autodiff bookmark: ad.uif.fbcode.faiss

Reviewed By: dtolnay

Differential Revision: D65957849

fbshipit-source-id: f6199250db595defd56f5e7b2828f838702e9a16
2024-11-15 13:53:46 -08:00
Tarang Jain
134922061c Migrate from RAFT to CUVS (#3549)
Summary:
Remove the dependency on `raft::compiled` and modify GPU implementations to use cuVS backend in place of RAFT.

A deeper insight into the dependency:
FAISS gets the ANN algorithm implementations such as IVF-Flat and IVF-PQ from cuVS. RAFT is meant to be a lightweight C++ header-only template library that cuVS relies on for the more fundamental / low-level utilities. Some examples of these are RAFT's device mdarray and mdspan objects; the RAFT resource object (`raft::resource`) that takes care of the stream ordering of device functions; linear algebra functions such as mapping, reduction, BLAS routines etc. A lot of the cuVS functions take the RAFT mdspan objects as arguments (for example `raft::device_matrix_view`). Therefore FAISS relies on both cuVS and RAFT. FAISS gets RAFT headers through cuVS and uses them to create the function arguments that can be consumed by cuVS. Note that we are not explicitly linking FAISS against `raft::raft` or `raft::compiled`. Only the required headers are included and compiled rather than compiling the whole RAFT shared library. This is the reason we still see mentions of `raft` in FAISS.

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

Reviewed By: ramilbakhshyiev

Differential Revision: D62041013

Pulled By: asadoughi

fbshipit-source-id: 7230dcc06cf47baf95873adc1dec2adca4a8f82a
2024-11-14 11:30:16 -08:00
Richard Barnes
0fb56d94b7 Remove unused-variable in dumbo/backup/dumbo/service/tests/ChainReplicatorTests.cpp +3 (#4024)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4024

LLVM-15 has a warning `-Wunused-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]]`.

#buildsonlynotests - Builds are sufficient

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

Differential Revision: D65755277

fbshipit-source-id: 13a2ad06375fd84e5e7afd69488e7fa36b658f20
2024-11-12 10:34:57 -08:00
Richard Barnes
adb188411a Fix shadowed variable in faiss/IndexAdditiveQuantizer.cpp (#4011)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4011

Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.

This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.

**What's a shadowed variable?**

Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.

This diff fixes such an issue by renaming the variable.

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

Reviewed By: asadoughi

Differential Revision: D65347906

fbshipit-source-id: 4dbf5d2ee0300379e897954fe367cdc3186b5521
2024-11-06 07:44:46 -08:00
Mengdi Lin
1f2b7ced5b introduce data splits in dataset descriptor (#4012)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4012

This should enable us to read units of data where the unit is a split instead of reading X number of rows.

Reviewed By: kuarora, asadoughi

Differential Revision: D65429573

fbshipit-source-id: 27d901fe83840c3b2bd3cca66fbad3721b12a9ec
2024-11-06 05:19:25 -08:00
Mengdi Lin
cfd4804ff8 write distributed_kmeans centroids and assignments to hive tables (#4017)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4017

Exposing an option to run kmeans centroids and assignments to hive table which should bring us close in parity with Digraph's Kmeans API. This is needed for cluster balance data quality checks for large scale centroids

Reviewed By: kuarora

Differential Revision: D64835789

fbshipit-source-id: 95cbea00bb6b4733c03836049bc379be813bf9e5
2024-11-05 18:49:44 -08:00
Amir Sadoughi
a11c1dbab6 Added IndexLSH to the demo (#4009)
Summary:
Demonstrate IndexLSH does not need training or codebook serialization

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

Reviewed By: junjieqi

Differential Revision: D65274645

Pulled By: asadoughi

fbshipit-source-id: c9af463757edbd07cc07b1cf607b88373fa334c4
2024-11-04 10:21:44 -08:00
Michael Kosten
2c961cc308 Add VectorTransform read from filename to the C API (#3970)
Summary:
This adds read_VectorTransform to the C API. This is helpful for independently loading a vector transform rather than as an IndexPreTransform.

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

Reviewed By: asadoughi

Differential Revision: D65192203

Pulled By: junjieqi

fbshipit-source-id: 949ae875924b9f3558d7a9f43c4f2aa8ae705f02
2024-10-30 12:01:15 -07:00
Michael Norris
9766d64dde Add index binary to telemetry (#4001)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4001

It was mentioned in S461104 chat to cover all index types. This adds Binary for telemetry as well as the reverse factory string for binary indexes, which we did not support before.

Unit test covers 4 ways of reading a binary index.

The reverse factory string util is not complete. The remaining binary index types could get added later.

Reviewed By: asadoughi

Differential Revision: D65102643

fbshipit-source-id: 52f1053bda59e427a081369ada80265b67e55bd4
2024-10-29 09:58:43 -07:00
Amir Sadoughi
ecb4b802e9 Update autoclose.yml (#4000)
Summary:
Fix removal of autoclose as the bot already removes the stale label when activity occurs

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

Reviewed By: pankajsingh88

Differential Revision: D65090259

Pulled By: asadoughi

fbshipit-source-id: 27e00363afba604f5e2bf8589cef7923b78a9068
2024-10-29 06:52:29 -07:00
Tom Jackson
c5fbefe6d6 Fix reverse_index_factory formatting of ScalarQuantizers (#4003)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4003

It was emitting "SQSQ8" for `IndexScalarQuantizer`. The enum names already have `SQ` in the prefix.

Reviewed By: kuarora

Differential Revision: D65083146

fbshipit-source-id: 564f6d3d8987a2188fb7aa82b5ba772034225550
2024-10-29 01:32:22 -07:00
Amir Sadoughi
acaa01f32d Moved add_sa_codes, sa_code_size to Index, IndexBinary base classes (#3989)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3989

Moved add_sa_codes, sa_code_size to Index, IndexBinary base classes from IndexIVF to support adding coded vectors with ids using IDMap2,PQ

For an alternative approach, see previous attempt with merge_ids and merge_codes: D64941798

Reviewed By: mnorris11

Differential Revision: D64972587

fbshipit-source-id: 71622fc35a378d9892569a56442a872f0c9c9e83
2024-10-28 19:56:00 -07:00
Pankaj Singh
d657dfbf66 fix merge_flat_ondisk stress run failures (#3999)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3999

Fixed the bug causing `merge_flat_ondisk` stress run failures.

Running multiple `merge_flat_ondisk` tests simultaneously fails which is causing buck stress-run failures.
https://www.internalfb.com/intern/test/562950025349567/

Root cause: we were updating input copy (which was discarded) of the filename template instead of the local copy.

Reviewed By: asadoughi

Differential Revision: D65074463

fbshipit-source-id: 9f86deeb56975a3be7a15a8f56d602463cad61af
2024-10-28 18:54:58 -07:00
Pankaj Singh
5539039c9f add validity check AlignedTableTightAlloc clear method (#3997)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3997

Avoid null pointer error by checking that `numel > 0`.
It's equivalent of checking`ptr != null` but keeping numel check for consistency.

Bug reported in: https://github.com/facebookresearch/faiss/issues/3994

Reviewed By: mnorris11

Differential Revision: D65073502

fbshipit-source-id: f9aa56cbcd28fc352d45ef5b8727fa857fbe5345
2024-10-28 14:35:25 -07:00
Michael Norris
efa18da947 add all wrapped indexes to the index_read
Summary:
These were not added in the refactoring, so adding them now.

Added unit tests which should cover things

The `orig->own_fields = false` because we wrap the inner index too, so it gets deleted.

Reviewed By: bshethmeta, pankajsingh88

Differential Revision: D64702824

fbshipit-source-id: b2e36374dd0066581c57a55b0ea16323cdc519f0
2024-10-24 12:05:00 -07:00
Amir Sadoughi
1e7ef59194 demo: IndexPQ: separate codes from codebook (#3987)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3987

Created a new notebook demonstrating how to separate serializing and deserializing the PQ codebook (via faiss.write_index for IndexPQ) independently of the vector codes. For example, in the case where you have a few vector embeddings per user and want to shard the flat index by user you can re-use the same PQ method for all users but store each user's codes independently.

Reviewed By: junjieqi

Differential Revision: D64844978

fbshipit-source-id: ad6434101fbb3ef84999527a577ecb9b503e556c
2024-10-24 05:42:41 -07:00
Michael Norris
9c3cd777d8 Re-add example of how to build, link, and test an external SWIG module"" (#3981)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3981

prior issues:

1. Nightlies were breaking due to yaml changes. Those are reverted.
2. AIX build broke (external). Fix is to add a conditional in tests/CMakeLists.txt.
3. Build issue https://github.com/facebookresearch/faiss/issues/3944. Could not repro now.

Reviewed By: mdouze

Differential Revision: D64440629

fbshipit-source-id: a86b27c25ada0d07e9d3b4c6e4f00b2e6b637fbe
2024-10-23 07:34:38 -07:00
Amir Sadoughi
ebe5a692f8 Update RAFT CI with pytorch 2.4.1 (#3980)
Summary:
Related to testing in https://github.com/facebookresearch/faiss/pull/3974

Based on comparing the logs of two runs:
- failing: https://github.com/facebookresearch/faiss/actions/runs/11409771344/job/31751246207
- passing: https://github.com/facebookresearch/faiss/actions/runs/11368781432/job/31625550227

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

Reviewed By: junjieqi

Differential Revision: D64778154

Pulled By: asadoughi

fbshipit-source-id: f4e53fed3850f3e0f391015c0349ee14da68330a
2024-10-22 13:35:02 -07:00
Michael Norris
eff0898a13 Enable linting: lint config changes plus arc lint command (#3966)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3966

This actually enables the linting.

Manual changes:
- tools/arcanist/lint/fbsource-licenselint-config.toml
- tools/arcanist/lint/fbsource-lint-engine.toml

Automated changes:
`arc lint --apply-patches --take LICENSELINT --paths-cmd 'hg files faiss'`

Reviewed By: asadoughi

Differential Revision: D64484165

fbshipit-source-id: 4f2f6e953c94ef6ebfea8a5ae035ccfbea65ed04
2024-10-22 09:46:48 -07:00
Amir Sadoughi
e7d153dbf5 Adjust nightly build (#3978)
Summary:
Fixes disk space issue: 75 GB -> 150 GB

https://www.internalfb.com/intern/opensource/ci/github-actions/runners/

S460776

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

Reviewed By: junjieqi

Differential Revision: D64722810

Pulled By: asadoughi

fbshipit-source-id: 0ae0f50e86bb0e8c19caa651a9dc496ebf700256
2024-10-21 19:19:39 -07:00
Michael Norris
da20af4ca5 fix some more nvidia licenses that get erased (#3977)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3977

These were getting erased in D64484165.

Similar to D64481766, we need to add lint ignore to not erase Nvidia license.

Without the changes in this diff to ignore lint, screenshots show these 4 files erase the license when running the lint command:

Before lint:
 {F1941712401}

After lint:
 {F1941712573}

Reviewed By: asadoughi

Differential Revision: D64712875

fbshipit-source-id: ada63a8d2f3e4af6c58971f83053b0eb443908d8
2024-10-21 18:36:33 -07:00
Michael Norris
56a383f253 Resolve "duplicate-license-header": Find and replace duplicate license headers (#3967)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3967

This diff just finds and replaces duplicate license headers.

See the errors for "duplicate-license-header" in D64429711 under "linter-coverage-verification" signal.

Reviewed By: asadoughi

Differential Revision: D64484123

fbshipit-source-id: 906e8baa3a11a3bbee174a03dcc27681f9fd78c2
2024-10-21 08:26:22 -07:00
Matthijs Douze
adcde10e50 Allow to replace graph structure for NSG graphs (#3975)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3975

Graph-based indices are often quite bulky in terms of storage becausee the out-degree of the edges is high (32 or more) and edges are just encoded as 32-bit ints.

This diff makes it possible to replace the graph structure of NSG with a compressed version, but only for search (the full graph needs to be present at addition time).

It is easier to do it for NSG than for HNSW for several reasons:
- NSG's graph is not hierarichal -- HNSW is and the edges for the different levels are interleaved
- the NSG graph object is already isolated well (thanks KingLittleQ!)
- NSG cannot be built incrementally so it is easier to convert the graph after all adds are done in one go.

The custom compressed graph is currently only implemented as a test, but could be integrated in the main Faiss as an option to NSG.

Reviewed By: algoriddle

Differential Revision: D64646137

fbshipit-source-id: c10c2a485b44561d32941ce1e7a0e3fe512cf0ac
2024-10-21 06:33:11 -07:00
Michael Norris
fd6d784114 Resolve "incorrect-portions-license" errors: add no license lint to top of GPU files with both licenses (#3965)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3965

End goal: add some lint to prevent files landing without any header. This creates churn for the oncall. Example is the last diff in this stack: D64488600

This is the first diff in enabling linting. I wanted the diff which updates all files to be just the automated command and the .toml config files changes, so this diff is a preparation step.

This particular diff solves: we get errors due to having both NVidia and FB license comment headers in the same files. See the errors in D64429711 under "linter-coverage-verification" signal.

Context on linting: https://fb.workplace.com/groups/lintqa/posts/3762373340693743/?comment_id=3762915930639484&reply_comment_id=3763044163959994

Per OSS, we cannot remove the Nvidia notice: https://fb.workplace.com/groups/osssupport/posts/27179779734977284/?comment_id=27181801724775085&reply_comment_id=27181818148106776

So, we add the lint ignore here.

Reviewed By: asadoughi

Differential Revision: D64481766

fbshipit-source-id: 0468104a095831cac7dd5bf3c519cfb5a2ee1575
2024-10-20 18:07:08 -07:00
Michael Pittard
f9a01c65c0 Removing Manual Hipify Build Step (#3962)
Summary:
- Called the hipify script at CMAKE configure time removing the need for the user to run it.
- Now removes any .hip files left over when running the hipify script.
- Cleaned up the hipify script to remove redundancy.

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

Reviewed By: asadoughi, ramilbakhshyiev

Differential Revision: D64495550

Pulled By: mnorris11

fbshipit-source-id: 5547712a4e46fc18cf62346adb0395d0e5626399
2024-10-18 15:42:10 -07:00