Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync #1

Merged
merged 234 commits into from
Oct 17, 2024
Merged

Sync #1

merged 234 commits into from
Oct 17, 2024

Commits on Apr 2, 2024

  1. Fix missing overload variable in Rocksdb ivf demo (#3326)

    Summary:
    **Bugs:**
    When following rocksdb_ivf demo to build executable file, its output as:
    ```bash
    faiss/demos/rocksdb_ivf/RocksDBInvertedLists.h:52:35: error: 'faiss::InvertedListsIterator* faiss_rocksdb::RocksDBInvertedLists::get_iterator(size_t) const' marked 'override', but does not override
       52 |     faiss::InvertedListsIterator* get_iterator(size_t list_no) const override;
          |                                   ^~~~~~~~~~~~
    make[2]: *** [CMakeFiles/demo_rocksdb_ivf.dir/build.make:90: CMakeFiles/demo_rocksdb_ivf.dir/RocksDBInvertedLists.cpp.o] Error 1
    ```
    
    **Solution:**
    Add relevant variable `void* inverted_list_contex` corresponding `get_iterator`'s base virtual function.
    
    Pull Request resolved: #3326
    
    Reviewed By: mlomeli1, mdouze
    
    Differential Revision: D55629580
    
    Pulled By: algoriddle
    
    fbshipit-source-id: a12fcacb483e0dd576411ad91a3dd1e0de94abec
    Warmchay authored and facebook-github-bot committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    c9c86f0 View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2024

  1. Support of skip_ids in merge_from_multiple function of OnDiskInverted…

    …Lists (#3327)
    
    Summary:
    Pull Request resolved: #3327
    
    **Context**
    1. [Issue 2621](#2621) discuss inconsistency between OnDiskInvertedList and InvertedList. OnDiskInvertedList is supposed to handle disk based multiple Index Shards. Thus, we should name it differently when merging invls from index shard.
    2. [Issue 2876](#2876) provides usecase of shifting ids when merging invls from different shards.
    
    **In this diff**,
    1. To address #1 above, I renamed the merge_from function to merge_from_multiple without touching merge_from base class.
    why so? To continue to allow merge invl from one index to ondiskinvl from other index.
    
    2. To address #2 above, I have added support of shift_ids in merge_from_multiple to shift ids from different shards. This can be used when each shard has same set of ids but different data. This is not recommended if id is already unique across shards.
    
    Reviewed By: mdouze
    
    Differential Revision: D55482518
    
    fbshipit-source-id: 95470c7449160488d2b45b024d134cbc037a2083
    kuarora authored and facebook-github-bot committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    da9f292 View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2024

  1. Implement reconstruct_n for GPU IVFFlat indexes (#3338)

    Summary:
    Pull Request resolved: #3338
    
    add reconstruct_n for GPU IVFFlat
    
    Reviewed By: mdouze
    
    Differential Revision: D55577561
    
    fbshipit-source-id: 47f8b939611e2df7dbcd087129538145f627293c
    junjieqi authored and facebook-github-bot committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    cfc7fe5 View commit details
    Browse the repository at this point in the history
  2. Support for Remove ids from IVFPQFastScan index (#3349)

    Summary:
    Pull Request resolved: #3349
    
    **Context**
    [Issue 3128](#3128) is an enhancement request to support remove_ids for IVFPQFastScan.
    
    Existing mechanism use direct map and iterate over items in selector and use scopecodes and scopeIds to replace item to be removed. Given that codes are packed, it is hard to return single code how it is packed in CodePackerPQ4. Thus, we need a custom implementation to removed_ids.
    
    **In this diff**,
    1. We have added custom implementation of remove_ids from BlockInvertedLists which unpack code as it iterate and repack in new position. DirectMap use this remove_id function in BlockInvertedLists for type NoMap in DirectMap.
    
    2. Also, we are throwing exception for other map type in DirectMap i.e. HashTable
    
    Reviewed By: mdouze
    
    Differential Revision: D55723390
    
    fbshipit-source-id: 0017b556bd790765251e778ac48ed37ff3a29a45
    kuarora authored and facebook-github-bot committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    f34588a View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2024

  1. Change index_cpu_to_gpu to throw for indices not implemented on GPU (#…

    …3336)
    
    Summary:
    Pull Request resolved: #3336
    
    Issues:
    #3269
    #3024
    
    List of implemented GPU indices: https://github.com/facebookresearch/faiss/wiki/Faiss-on-the-GPU#implemented-indexes
    
    Reviewed By: mdouze
    
    Differential Revision: D55577576
    
    fbshipit-source-id: 49f490cfba6784661e378acf4de3cce4195bb43b
    ramilbakhshyiev authored and facebook-github-bot committed Apr 6, 2024
    Configuration menu
    Copy the full SHA
    7657e81 View commit details
    Browse the repository at this point in the history
  2. Revert D55723390: Support for Remove ids from IVFPQFastScan index

    Differential Revision:
    D55723390
    
    Original commit changeset: 0017b556bd79
    
    Original Phabricator Diff: D55723390
    
    fbshipit-source-id: 58d61467b30dd11d27398f9f825162f598896845
    Gufan Yin authored and facebook-github-bot committed Apr 6, 2024
    Configuration menu
    Copy the full SHA
    366a814 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2024

  1. Support for Remove ids from IVFPQFastScan index (#3354)

    Summary:
    Pull Request resolved: #3354
    
    **Change was previously reverted because of build failure as change D55577576 removed the definition of FAISS_THROW_IF_MSG**
    
    **Context**
    [Issue 3128](#3128) is an enhancement request to support remove_ids for IVFPQFastScan.
    
    Existing mechanism use direct map and iterate over items in selector and use scopecodes and scopeIds to replace item to be removed. Given that codes are packed, it is hard to return single code how it is packed in CodePackerPQ4. Thus, we need a custom implementation to removed_ids.
    
    **In this diff**,
    1. We have added custom implementation of remove_ids from BlockInvertedLists which unpack code as it iterate and repack in new position. DirectMap use this remove_id function in BlockInvertedLists for type NoMap in DirectMap.
    
    2. Also, we are throwing exception for other map type in DirectMap i.e. HashTable
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D55858959
    
    fbshipit-source-id: c8a0631495380b7dead36720e4507f4d1900d39f
    kuarora authored and facebook-github-bot committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    252ae16 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2024

  1. Improve filtering & search parameters propagation (#3304)

    Summary: Pull Request resolved: #3304
    
    Reviewed By: junjieqi
    
    Differential Revision: D55823369
    
    Pulled By: mdouze
    
    fbshipit-source-id: c0e9f4b85d979758f02e9953f3706b63a846bf22
    alexanderguzhva authored and facebook-github-bot committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    17fbeb8 View commit details
    Browse the repository at this point in the history
  2. selector parameter for FastScan (#3362)

    Summary:
    Pull Request resolved: #3362
    
    Add test to Alex' PR
    
    Reviewed By: junjieqi
    
    Differential Revision: D56003946
    
    fbshipit-source-id: 5a8a881d450bc97ae0777d73ce0ce8607ec6b686
    mdouze authored and facebook-github-bot committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    40e8643 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2024

  1. Switch sprintf to snprintf (#3363)

    Summary:
    Pull Request resolved: #3363
    
    'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead
    
    {F1484071654}
    
    Reviewed By: kuarora
    
    Differential Revision: D56009251
    
    fbshipit-source-id: ec222cf589ff98b016979058d59fc20cccec8f43
    junjieqi authored and facebook-github-bot committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    acd06d6 View commit details
    Browse the repository at this point in the history
  2. Remove unused variables in faiss/IndexIVF.cpp

    Summary:
    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: dmm-fb
    
    Differential Revision: D56065763
    
    fbshipit-source-id: b0541b8a759c4b6ca0e8753fc24b8c227047bd3d
    r-barnes authored and facebook-github-bot committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    a35eb0a View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2024

  1. Apply clang-format 18

    Summary: Previously this code conformed from clang-format 12.
    
    Reviewed By: igorsugak
    
    Differential Revision: D56065247
    
    fbshipit-source-id: f5a985dd8f8b84f2f9e1818b3719b43c5a1b05b3
    zertosh authored and facebook-github-bot committed Apr 14, 2024
    Configuration menu
    Copy the full SHA
    ab2b7f5 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2024

  1. Update required cmake version to 3.24. (#3305)

    Summary:
    The CMakeLists.txt in faiss/gpu uses the $<LINK_LIBRARY:WHOLE_ARCHIVE expression which requires at least cmake 3.24.
    
    Pull Request resolved: #3305
    
    Reviewed By: mlomeli1
    
    Differential Revision: D56234500
    
    Pulled By: algoriddle
    
    fbshipit-source-id: dfe7df3379c5250dedec7d1988cffa889fc1c393
    iotamudelta authored and facebook-github-bot committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    0169f29 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2024

  1. Switch clang-format-11 to clang-format-18 (#3372)

    Summary:
    In this commit ab2b7f5, they changed format based on clang-format-18. However, we still use clang-format-11 in our circle ci job which caused the failure. In this PR, we are going to switch to clang-format-18
    
    Pull Request resolved: #3372
    
    Reviewed By: kuarora
    
    Differential Revision: D56280363
    
    Pulled By: junjieqi
    
    fbshipit-source-id: f832ab2112f762e6000b55a155e3e43fe99071d7
    junjieqi authored and facebook-github-bot committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    3677ab5 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. remove unused code (#3371)

    Summary:
    Pull Request resolved: #3371
    
    This will never happen because N is fixed at compile time and the buffer is large enough. It is misleading to add error handling code for a case that will never happen.
    
    Reviewed By: kuarora
    
    Differential Revision: D56274458
    
    fbshipit-source-id: ca706f1223dbc97e69d5ac9750b277afa4df80a7
    junjieqi authored and facebook-github-bot committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    5893ab7 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2024

  1. Unroll loop in lookup_2_lanes (#3364)

    Summary:
    The current loop goes from 0 to 31.  It has an if statement to do an assignment for j < 16 and a different assignment for j >= 16.  By unrolling the loop to do the j < 16 and the j >= 16 iterations in parallel the if j < 16 is eliminated and the number of loop iterations is reduced in half.
    
    Then unroll the loop for the j < 16 and the j >=16 to a depth of 2.
    
    This change results in approximately a 55% reduction in the execution time for the bench_ivf_fastscan.py workload on Power 10 when compiled with CMAKE_INSTALL_CONFIG_NAME=Release.
    
    The removal of the if (j < 16) statement and the unrolling of the loop removes branch cycle stall and register dependencies on instruction issue. The result is the unrolled code is able issue instructions earlier thus reducing the total number of cycles required to execute the function.
    
    Pull Request resolved: #3364
    
    Reviewed By: kuarora
    
    Differential Revision: D56455690
    
    Pulled By: mdouze
    
    fbshipit-source-id: 490a17a40d9d4439b1a8ea22e991e706d68fb2fa
    Carl Love authored and facebook-github-bot committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    b2e91f6 View commit details
    Browse the repository at this point in the history
  2. Fix the endianness issue in AIX while running the benchmark. (#3345)

    Summary:
    This pull request is for issue #3330. This patch makes sure that packed code arrays are in big endian format. Kindly let us know if we need any changes or if we can have a better approach.
    
    Pull Request resolved: #3345
    
    Reviewed By: junjieqi
    
    Differential Revision: D55957630
    
    Pulled By: mdouze
    
    fbshipit-source-id: f728f9563f6b942af9d8899b54662d7ceb811206
    KamathForAIX authored and facebook-github-bot committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    67574aa View commit details
    Browse the repository at this point in the history
  3. support big-endian machines (#3361)

    Summary:
    Pull Request resolved: #3361
    
    Fix a few issues in the PR.
    Normally all tests should pass on a litlle-endian machine
    
    Reviewed By: junjieqi
    
    Differential Revision: D56003181
    
    fbshipit-source-id: 405dec8c71898494f5ddcd2718c35708a1abf9cb
    mdouze authored and facebook-github-bot committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    783e044 View commit details
    Browse the repository at this point in the history
  4. Few fixes in bench_fw to enable IndexFromCodec (#3383)

    Summary:
    Pull Request resolved: #3383
    
    In this diff, I am fixing minor issues in bench_fw where either certain fields are not accessible when index is build from codec. It also requires index to be discovered using codec alias as index factory is not always available.
    
    In subsequent diff internal to meta will have testcase that execute this path.
    
    Reviewed By: algoriddle
    
    Differential Revision: D56444641
    
    fbshipit-source-id: b7af7e7bb47b20bbb5515a66f41dd24f42459d52
    kuarora authored and facebook-github-bot committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    2379b45 View commit details
    Browse the repository at this point in the history
  5. Fix IndexBinary.assign Python method

    Summary: Fixes #3343
    
    Reviewed By: kuarora, junjieqi
    
    Differential Revision: D56526842
    
    fbshipit-source-id: b7c4377495db4e68283cf4ce2b7c8fae008cd404
    Amir Sadoughi authored and facebook-github-bot committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    03750f5 View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2024

  1. Fix swig osx (#3357)

    Summary:
    The osx failed
    
    https://app.circleci.com/pipelines/github/facebookresearch/faiss/5698/workflows/4e029c32-8d8b-4db7-99e2-8e802aad6653/jobs/32701
    
    Pull Request resolved: #3357
    
    Reviewed By: kuarora
    
    Differential Revision: D56039739
    
    Pulled By: junjieqi
    
    fbshipit-source-id: dd434a8817148364797eae39c09e0e1e9edbe858
    junjieqi authored and facebook-github-bot committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    bd22c93 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2024

  1. fix raft log spew

    Summary: Remove debugging log lines
    
    Reviewed By: mlomeli1
    
    Differential Revision: D56626636
    
    fbshipit-source-id: 2721b84e4e1359d1372df2b2c95cc668c6a75c3f
    algoriddle authored and facebook-github-bot committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    5cbff67 View commit details
    Browse the repository at this point in the history
  2. Demo on how to address mulitple index contents

    Summary:
    This demonstrates how to query several independent IVF indexes with a trained index in common. This avoids to duplicate the coarse quantizer and metadata in memory.
    
    On the Faiss side, it also implements a InvertedListIterator on top of the flat inverted lists, which can prove useful.
    
    Reviewed By: junjieqi
    
    Differential Revision: D56575887
    
    fbshipit-source-id: cc3b26e952ee21f24b10169b5b614066600cf4b8
    mdouze authored and facebook-github-bot committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    a233bc9 View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2024

  1. Fix deprecated use of 0/NULL in faiss/python/python_callbacks.cpp + 1

    Summary:
    `nullptr` is typesafe. `0` and `NULL` are not. In the future, only `nullptr` will be allowed.
    
    This diff helps us embrace the future _now_ in service of enabling `-Wzero-as-null-pointer-constant`.
    
    Reviewed By: palmje
    
    Differential Revision: D56650318
    
    fbshipit-source-id: 803ae62114c39143b65946f6f0387715eaf7f534
    r-barnes authored and facebook-github-bot committed Apr 27, 2024
    Configuration menu
    Copy the full SHA
    c5599a0 View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2024

  1. Initial config and linux-x86_64-cmake build job only

    Summary:
    This commit is the first in a series in an attempt to incrementally enable all jobs currenlty performed by CircleCI. It includes the main configuration files provided by GitHub team + 1 build.
    
    Original PR: #3325
    
    Reviewed By: junjieqi
    
    Differential Revision: D56671582
    
    fbshipit-source-id: c8a21cd69aabaf86134eb86753e90b1facf51bc3
    ramilbakhshyiev authored and facebook-github-bot committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    7e1d2b1 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. Add linux-x86_64-AVX2-cmake build

    Summary: GitHub checks
    
    Reviewed By: junjieqi
    
    Differential Revision: D56733297
    
    fbshipit-source-id: fe5a2ca7c67f36a4fe986af78fb6dc8f4f843150
    ramilbakhshyiev authored and facebook-github-bot committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    825cbac View commit details
    Browse the repository at this point in the history
  2. Fix #3379: Add tutorial for HNSW index (#3381)

    Summary:
    Fixes #3379
    
    Pull Request resolved: #3381
    
    Reviewed By: junjieqi
    
    Differential Revision: D56570120
    
    Pulled By: kuarora
    
    fbshipit-source-id: 758ea4ab866609d6dd5621e6e6ffda583ba52503
    JayjeetAtGithub authored and facebook-github-bot committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    3121fc6 View commit details
    Browse the repository at this point in the history
  3. Add format check

    Summary: Migration to GitHub actions
    
    Reviewed By: junjieqi
    
    Differential Revision: D56745520
    
    fbshipit-source-id: 5311a549842f19672ae574edaa8be3ea5a580dbc
    ramilbakhshyiev authored and facebook-github-bot committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    c92b480 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2024

  1. Enable linux-x86_64-conda build via GitHub Actions (#3405)

    Summary:
    Pull Request resolved: #3405
    
    Migration to GitHub Actions
    
    Reviewed By: junjieqi
    
    Differential Revision: D56843276
    
    fbshipit-source-id: 3d5c7ee9a36a783407dfdcc3574c377da5f9db78
    ramilbakhshyiev authored and facebook-github-bot committed May 1, 2024
    Configuration menu
    Copy the full SHA
    5fd8b81 View commit details
    Browse the repository at this point in the history
  2. Enable windows-x86_64-conda build via GitHub Actions (#3406)

    Summary:
    Pull Request resolved: #3406
    
    Migration to GitHub Actions
    
    Reviewed By: junjieqi
    
    Differential Revision: D56848895
    
    fbshipit-source-id: 5a351534d9151369a9104314fee203657ac40043
    ramilbakhshyiev authored and facebook-github-bot committed May 1, 2024
    Configuration menu
    Copy the full SHA
    74562b2 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2024

  1. Enable linux-arm64-conda check via GitHub Actions (#3407)

    Summary:
    Pull Request resolved: #3407
    
    Migration to GitHub Actions
    
    Reviewed By: junjieqi
    
    Differential Revision: D56856565
    
    fbshipit-source-id: d7400eb9cb7bd68e93a712af81c6cbb7e76e2400
    ramilbakhshyiev authored and facebook-github-bot committed May 2, 2024
    Configuration menu
    Copy the full SHA
    96b88ac View commit details
    Browse the repository at this point in the history

Commits on May 3, 2024

  1. Enable packages builds on main for windows, linux-arm64, linux-x86_64…

    … via GitHub Actions (#3409)
    
    Summary:
    Pull Request resolved: #3409
    
    Migration to GitHub Actions
    
    Reviewed By: junjieqi
    
    Differential Revision: D56917083
    
    fbshipit-source-id: 93a2358ce5697b26aa40ced505f42c584fa8c46c
    ramilbakhshyiev authored and facebook-github-bot committed May 3, 2024
    Configuration menu
    Copy the full SHA
    7b8b981 View commit details
    Browse the repository at this point in the history
  2. Change linux-arm64-packages build to use 2-core-ubuntu-arm for better…

    … availability (#3410)
    
    Summary:
    Pull Request resolved: #3410
    
    Migration to GitHub Actions
    
    Reviewed By: junjieqi
    
    Differential Revision: D56921925
    
    fbshipit-source-id: 64e7a636b47d828110a6d413c8645e5343b578cb
    ramilbakhshyiev authored and facebook-github-bot committed May 3, 2024
    Configuration menu
    Copy the full SHA
    1b1a403 View commit details
    Browse the repository at this point in the history
  3. Enable osx-arm64-packages build via GitHub Actions (#3411)

    Summary:
    Pull Request resolved: #3411
    
    Migration to GitHub
    
    Reviewed By: kuarora
    
    Differential Revision: D56923116
    
    fbshipit-source-id: 1e2b493b0dd81ce850f2970e6d28c713f6a9927b
    ramilbakhshyiev authored and facebook-github-bot committed May 3, 2024
    Configuration menu
    Copy the full SHA
    0cc0e19 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2024

  1. TimeoutCallback C++ and Python (#3417)

    Summary:
    Pull Request resolved: #3417
    
    #3351
    
    Reviewed By: junjieqi
    
    Differential Revision: D57120422
    
    fbshipit-source-id: e2e446642e7be8647f5115f90916fad242e31286
    Amir Sadoughi authored and facebook-github-bot committed May 9, 2024
    Configuration menu
    Copy the full SHA
    b3e3c2d View commit details
    Browse the repository at this point in the history
  2. Enable linux-x86_64-GPU-w-RAFT-cmake build via GitHub Actions (#3418)

    Summary:
    Pull Request resolved: #3418
    
    Migration to GitHub Actions
    
    Reviewed By: junjieqi
    
    Differential Revision: D57133934
    
    fbshipit-source-id: 255b7afbbb90cc966916cd900174833416b0bc51
    ramilbakhshyiev authored and facebook-github-bot committed May 9, 2024
    Configuration menu
    Copy the full SHA
    34fa2ae View commit details
    Browse the repository at this point in the history

Commits on May 10, 2024

  1. PowerPC, improve code generation for function fvec_L2sqr (#3416)

    Summary:
    The code generated for function fvec_L2sqr generated by OpenXL do not perform as good as the codes generated by gcc on Power. The macros to enable imprecise floating point operation don’t cover Power with OpenXL. This patch adds the OpenXL compiler options for the PowerPC macros to achieve better performance.
    
    Pull Request resolved: #3416
    
    Reviewed By: asadoughi
    
    Differential Revision: D57210015
    
    Pulled By: mdouze
    
    fbshipit-source-id: 6b838a2fa4d4996fe52c9f1105827004626fe720
    Carl Love authored and facebook-github-bot committed May 10, 2024
    Configuration menu
    Copy the full SHA
    e1e4ad0 View commit details
    Browse the repository at this point in the history

Commits on May 13, 2024

  1. Update system dependencies to enable CUDA builds on v6 kernel and new…

    …er libc (#3426)
    
    Summary:
    Pull Request resolved: #3426
    
    GitHub Actions only supports Ubuntu 22 and newer and this change is necessary to enable CUDA builds to complete the migration.
    
    Reviewed By: algoriddle
    
    Differential Revision: D57261685
    
    fbshipit-source-id: 34467f57426864ffa8b32f6018ccdc7bb4424b57
    ramilbakhshyiev authored and facebook-github-bot committed May 13, 2024
    Configuration menu
    Copy the full SHA
    b487c62 View commit details
    Browse the repository at this point in the history
  2. Enable linux-x86_64-GPU-cmake build on GitHub Actions (#3427)

    Summary:
    Pull Request resolved: #3427
    
    Migration to GitHub Actions
    
    Reviewed By: algoriddle
    
    Differential Revision: D57261696
    
    fbshipit-source-id: d7b8c26259fd3de1cf59fc460f6af20185ceacfe
    ramilbakhshyiev authored and facebook-github-bot committed May 13, 2024
    Configuration menu
    Copy the full SHA
    2e04533 View commit details
    Browse the repository at this point in the history
  3. Add disabled linux-x86_64-AVX512-cmake build on GitHub Actions (#3428)

    Summary:
    Pull Request resolved: #3428
    
    GitHub Actions currently does not support runners with AVX-512  but committed to add this support in early 2025. We will be running these on CircleCI until then. This placeholder build configuration will allow us to enable it with a 1-liner when the hosts are available.
    
    Reviewed By: algoriddle
    
    Differential Revision: D57261783
    
    fbshipit-source-id: 1fb985a0c3dbb11851af63c95bde6494d25d0ac2
    ramilbakhshyiev authored and facebook-github-bot committed May 13, 2024
    Configuration menu
    Copy the full SHA
    4d06d70 View commit details
    Browse the repository at this point in the history

Commits on May 15, 2024

  1. Get rid of redundant instructions in ScalarQuantizer (#3430)

    Summary:
    This PR removes unneeded ARM NEON SIMD instructions for ScalarQuantizer.
    
    The removed instructions are completely redundant, and I believe that it is a funky way of converting two `float32x4_t` variables (which hold 4 float values in a single SIMD register) into a single `float32x4x2_t` variable (two SIMD registers packed together).
    
    Clang compiler is capable of eliminating these instructions. The only GCC that can eliminate these unneeded instructions is GCC 14, which was released very recently (Apr-May 2024).
    
    mdouze
    
    Pull Request resolved: #3430
    
    Reviewed By: mlomeli1
    
    Differential Revision: D57369849
    
    Pulled By: mdouze
    
    fbshipit-source-id: 09d7cf16e113df3eb9ddbfa54d074b58b452ba7f
    alexanderguzhva authored and facebook-github-bot committed May 15, 2024
    Configuration menu
    Copy the full SHA
    83df64c View commit details
    Browse the repository at this point in the history
  2. fix install instructions (#3442)

    Summary:
    Pull Request resolved: #3442
    
    fix install instruction for GPU + pytorch
    
    Reviewed By: mlomeli1
    
    Differential Revision: D57376959
    
    fbshipit-source-id: 74caff960be7dbf8102e7593ce1485452a18de6e
    mdouze authored and facebook-github-bot committed May 15, 2024
    Configuration menu
    Copy the full SHA
    509f4c1 View commit details
    Browse the repository at this point in the history
  3. interrupt for NNDescent (#3432)

    Summary:
    Pull Request resolved: #3432
    
    Addresses the issue in #3173
    
    for `IndexNNDescent`, I see that there is already interrupt implemented for it's [search](https://fburl.com/code/iwn3tqic) API, so I looked into it's `add` API.
    
    For a given dataset nb = 10 mil, iter = 10, K =  32, d = 32 on a CPU only machine reveals that bulk of the cost comes from [nndescent](https://fburl.com/code/5rdb1p5o). For every iteration of `nndescent` takes around ~12 seconds, ~70-80% of the time is spent on `join` method (~10 seconds per iteration) and ~20-30% spent on `update` (~2 second per iteration). Adding the interrupt on the `join` should suffice on quickly terminating the program when users hit ctrl+C (happy to move the interrupt elsewhere if we think otherwise)
    
    Reviewed By: junjieqi, mdouze
    
    Differential Revision: D57300514
    
    fbshipit-source-id: d343e0a292c35027ffdb8cbd0131e945b9881d63
    mengdilin authored and facebook-github-bot committed May 15, 2024
    Configuration menu
    Copy the full SHA
    558a7c3 View commit details
    Browse the repository at this point in the history
  4. Remove unused variables in faiss/IndexIVFFastScan.cpp (#3439)

    Summary:
    Pull Request resolved: #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
    r-barnes authored and facebook-github-bot committed May 15, 2024
    Configuration menu
    Copy the full SHA
    b8e4489 View commit details
    Browse the repository at this point in the history
  5. Add cuda-toolkit package dependency to faiss-gpu and faiss-gpu-raft c…

    …onda build recipes (#3440)
    
    Summary:
    Pull Request resolved: #3440
    
    This change is required to unblock the migration to GitHub Actions. `cuda-toolkit` was only specified in the `libfaiss` package and it was not available in `faiss-gpu` or `faiss-gpu-raft`. This currently works on CircleCI because the runner image has CUDA toolkit of the needed version installed on the system and the build logic falls back to that but breaks on GitHub Actions because their runner images do not come with CUDA toolkit pre-installed.
    
    Reviewed By: junjieqi
    
    Differential Revision: D57371597
    
    fbshipit-source-id: 8bededd53e2528f033fac797b296d74b47f9403e
    ramilbakhshyiev authored and facebook-github-bot committed May 15, 2024
    Configuration menu
    Copy the full SHA
    2050a03 View commit details
    Browse the repository at this point in the history
  6. stabilize formatting for bench_cppcontrib_sa_decode.cpp (#3443)

    Summary:
    Pull Request resolved: #3443
    
    Stabilize this file for clang-formatting versions 18.1.3 (VSCode) and 18.1.5 (our Github CI)
    
    Reviewed By: junjieqi
    
    Differential Revision: D57393650
    
    fbshipit-source-id: 15170436bbd03194dbeaac1ef1130e20adc8c23e
    mengdilin authored and facebook-github-bot committed May 15, 2024
    Configuration menu
    Copy the full SHA
    745bca8 View commit details
    Browse the repository at this point in the history
  7. Enable both RAFT package builds and CUDA 12.1.1 GPU package build (#3441

    )
    
    Summary:
    Pull Request resolved: #3441
    
    Migration to GitHub Actions
    
    Reviewed By: junjieqi
    
    Differential Revision: D57372738
    
    fbshipit-source-id: 745b3c3f43c49045f8f5035e2af302ffa30d7755
    ramilbakhshyiev authored and facebook-github-bot committed May 15, 2024
    Configuration menu
    Copy the full SHA
    72571c7 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2024

  1. Implement METRIC.NaNEuclidean (#3414)

    Summary:
    Pull Request resolved: #3414
    
    #3355
    
    A couple open questions:
    - Given L2 was squared, I figured I would leave this one as squared as well?
    - Also, wasn't sure if we wanted to return nan when present == 0 or -1?
    
    Reviewed By: mdouze
    
    Differential Revision: D57017608
    
    fbshipit-source-id: ba14458b92c8b055f3bf2a871565175935c8333a
    Amir Sadoughi authored and facebook-github-bot committed May 16, 2024
    Configuration menu
    Copy the full SHA
    1876925 View commit details
    Browse the repository at this point in the history
  2. Improve testing code step 1 (#3451)

    Summary:
    Pull Request resolved: #3451
    
    This is a first step to clean up the faiss codebase following T187322081
    
    Reviewed By: junjieqi
    
    Differential Revision: D57448335
    
    fbshipit-source-id: c9760d01479d3352b786bbcf2015251e7a7168d6
    Xiao Fu authored and facebook-github-bot committed May 16, 2024
    Configuration menu
    Copy the full SHA
    4972abd View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. Delete all remaining print (#3452)

    Summary:
    Pull Request resolved: #3452
    
    Delete all remaining print within the Tests to improve the readability and effectiveness of the codebase.
    
    Reviewed By: junjieqi
    
    Differential Revision: D57466393
    
    fbshipit-source-id: 6ebd66ae2e769894d810d4ba7a5f69fc865b797d
    Xiao Fu authored and facebook-github-bot committed May 17, 2024
    Configuration menu
    Copy the full SHA
    bf8bd6b View commit details
    Browse the repository at this point in the history
  2. GitHub Actions files cleanup (#3454)

    Summary:
    Pull Request resolved: #3454
    
    Removing commented out lines and adding proper descriptions and comments where appropriate.
    
    Reviewed By: junjieqi
    
    Differential Revision: D57501602
    
    fbshipit-source-id: 0202ff73b7a83158808affba9b98b96dff569457
    ramilbakhshyiev authored and facebook-github-bot committed May 17, 2024
    Configuration menu
    Copy the full SHA
    e822a8c View commit details
    Browse the repository at this point in the history
  3. Cleaning up more unnecessary print (#3455)

    Summary:
    Pull Request resolved: #3455
    
    Code quality control by reducing the number of prints
    
    Reviewed By: junjieqi
    
    Differential Revision: D57502194
    
    fbshipit-source-id: a6cd65ed4cc49590ce73d2978d41b640b5259c17
    Xiao Fu authored and facebook-github-bot committed May 17, 2024
    Configuration menu
    Copy the full SHA
    5e452ed View commit details
    Browse the repository at this point in the history

Commits on May 20, 2024

  1. Workaround for CUDA 11.4.4 build in Conda on Ubuntu 22 / v6 kernel (#…

    …3459)
    
    Summary:
    Pull Request resolved: #3459
    
    When building with CUDA 11.4.4, CMake does not properly include files under Conda environment. This workaround flattens the include sub-directories in to the include root. It will unblock us for now while we are looking for a fix through CMakeLists files or figure out if it's a CMake bug and it gets fixed.
    
    Reviewed By: junjieqi
    
    Differential Revision: D57545169
    
    fbshipit-source-id: 9cbdd0866e00e899cc889930a59448da55d873c2
    ramilbakhshyiev authored and facebook-github-bot committed May 20, 2024
    Configuration menu
    Copy the full SHA
    0c983f3 View commit details
    Browse the repository at this point in the history
  2. Enable linux-x86_64-GPU-packages-CUDA-11-4-4 build via GitHub Actions (

    …#3460)
    
    Summary:
    Pull Request resolved: #3460
    
    Migration to GitHub Actions
    
    Reviewed By: junjieqi
    
    Differential Revision: D57545637
    
    fbshipit-source-id: 8ee970e5642ae9354455d60d84019d4217884d3a
    ramilbakhshyiev authored and facebook-github-bot committed May 20, 2024
    Configuration menu
    Copy the full SHA
    86bf74d View commit details
    Browse the repository at this point in the history
  3. Relax version requirements for action steps (#3461)

    Summary:
    Pull Request resolved: #3461
    
    Migration to GitHub Actions
    
    Reviewed By: junjieqi
    
    Differential Revision: D57545814
    
    fbshipit-source-id: a3d08f8cf516ce26f8f16892eceef9e36bfe9f05
    ramilbakhshyiev authored and facebook-github-bot committed May 20, 2024
    Configuration menu
    Copy the full SHA
    7fc8184 View commit details
    Browse the repository at this point in the history
  4. Fix linter warnings in faiss-gpu Conda build script (#3463)

    Summary:
    Pull Request resolved: #3463
    
    Satisfying linter warnings from a previous change
    
    Reviewed By: junjieqi
    
    Differential Revision: D57581364
    
    fbshipit-source-id: 9e9b7f963a27d2da54d0e85390cce2f9f773c502
    ramilbakhshyiev authored and facebook-github-bot committed May 20, 2024
    Configuration menu
    Copy the full SHA
    8c95c69 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2024

  1. Properly pass the label for conda upload steps (#3464)

    Summary:
    Pull Request resolved: #3464
    
    Migration to GitHub
    
    Reviewed By: algoriddle
    
    Differential Revision: D57593494
    
    fbshipit-source-id: 726159b553d5544efcdfa064f5a82fd51ed793e9
    ramilbakhshyiev authored and facebook-github-bot committed May 21, 2024
    Configuration menu
    Copy the full SHA
    0698ac7 View commit details
    Browse the repository at this point in the history
  2. Fix CUDA 11.4.4 builds under CircleCI (#3466)

    Summary:
    Pull Request resolved: #3466
    
    Flattening Conda include directories breaks CUDA 11.4.4 build on Ubuntu 20 / v5 kernel. This change updates the logic to only flatten includes on Ubuntu 22 / v6 kernel (aka as running on GitHub Actions runners).
    
    Reviewed By: algoriddle
    
    Differential Revision: D57602154
    
    fbshipit-source-id: 00c14ca7c64644b8b86483ac6b4d40c6d8f12372
    ramilbakhshyiev authored and facebook-github-bot committed May 21, 2024
    Configuration menu
    Copy the full SHA
    a60a9e5 View commit details
    Browse the repository at this point in the history
  3. Enable nightly builds via GitHub Actions (#3467)

    Summary:
    Pull Request resolved: #3467
    
    1. Cron is scheduled to execute at 1:10am UTC. This is per GitHub's recommendation to avoid hotspots. The docs mention that when GH backend gets overloaded, they can drop scheduled jobs which we want to avoid so we scheduled off hour, off midnight.
    2. The plan is to let these nightlies run once and, if successful, then disable them in GitHub UI to perform validation. Also disable if things break and need to be fixed of course.
    
    Reviewed By: algoriddle
    
    Differential Revision: D57602833
    
    fbshipit-source-id: 4f4d9abbaa5ed3d1edb024ea4dd3f87aa78dd9b5
    ramilbakhshyiev authored and facebook-github-bot committed May 21, 2024
    Configuration menu
    Copy the full SHA
    c1528b5 View commit details
    Browse the repository at this point in the history
  4. Add tutorial for FastScan (#3465)

    Summary:
    Pull Request resolved: #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
    Xiao Fu authored and facebook-github-bot committed May 21, 2024
    Configuration menu
    Copy the full SHA
    4489773 View commit details
    Browse the repository at this point in the history
  5. Missed printing 'D' (#3433)

    Summary:
    'I' was printed twice and 'D' (distance vector) was not printed. Fixed.
    
    Pull Request resolved: #3433
    
    Reviewed By: fxdawnn
    
    Differential Revision: D57451544
    
    Pulled By: junjieqi
    
    fbshipit-source-id: fc17b3b467f8b2c4ad7d80b44866456d9146e530
    saarthdeshpande authored and facebook-github-bot committed May 21, 2024
    Configuration menu
    Copy the full SHA
    59e3ee1 View commit details
    Browse the repository at this point in the history
  6. Add tutorial on PQFastScan for cpp (#3468)

    Summary:
    Pull Request resolved: #3468
    
    This commit includes the tutorial for PQFastScan in the cpp environment.
    
    Reviewed By: junjieqi
    
    Differential Revision: D57631441
    
    fbshipit-source-id: f5e17eee2a584ebfc9ff63868d741d0da6b3b413
    Xiao Fu authored and facebook-github-bot committed May 21, 2024
    Configuration menu
    Copy the full SHA
    f38e52c View commit details
    Browse the repository at this point in the history

Commits on May 22, 2024

  1. Add FastScan refinement tutorial for python (#3469)

    Summary: Pull Request resolved: #3469
    
    Reviewed By: junjieqi
    
    Differential Revision: D57650807
    
    fbshipit-source-id: 5e642a8140455e4a3f1f21afe2f06771462e61f4
    Xiao Fu authored and facebook-github-bot committed May 22, 2024
    Configuration menu
    Copy the full SHA
    7d7fef0 View commit details
    Browse the repository at this point in the history
  2. Fix cron schedule for nightlies via GitHub Actions (#3470)

    Summary:
    Pull Request resolved: #3470
    
    Hour and minute values are swapped, the goal is to run is at 1:10am UTC.
    
    Reviewed By: algoriddle
    
    Differential Revision: D57654059
    
    fbshipit-source-id: 23bcb42e5c95f731cd4713ad4691d0f475ed8ad2
    ramilbakhshyiev authored and facebook-github-bot committed May 22, 2024
    Configuration menu
    Copy the full SHA
    f352168 View commit details
    Browse the repository at this point in the history
  3. Fix CUDA 11.4.4 nightly in GitHub Actions (#3473)

    Summary:
    Pull Request resolved: #3473
    
    Previous diff (D57602154) fixed the CircleCI version and the PR build version of GHA but not the nightly one.
    
    Reviewed By: junjieqi
    
    Differential Revision: D57680576
    
    fbshipit-source-id: 39f49c20df824c915f536b1ed3ffc35db2907988
    ramilbakhshyiev authored and facebook-github-bot committed May 22, 2024
    Configuration menu
    Copy the full SHA
    b39dd4d View commit details
    Browse the repository at this point in the history
  4. Add tutorial for FastScan with refinement for cpp (#3474)

    Summary:
    Pull Request resolved: #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
    Xiao Fu authored and facebook-github-bot committed May 22, 2024
    Configuration menu
    Copy the full SHA
    414fd1e View commit details
    Browse the repository at this point in the history

Commits on May 23, 2024

  1. QT_bf16 for scalar quantizer for bfloat16 (#3444)

    Summary:
    mdouze Please let me know if any additional unit tests are needed
    
    Pull Request resolved: #3444
    
    Reviewed By: algoriddle
    
    Differential Revision: D57665641
    
    Pulled By: mdouze
    
    fbshipit-source-id: 9bec91306a1c31ea4f1f1d726c9d60ac6415fdfc
    alexanderguzhva authored and facebook-github-bot committed May 23, 2024
    Configuration menu
    Copy the full SHA
    6a94c67 View commit details
    Browse the repository at this point in the history
  2. Add display names to all PR build jobs on GitHub Actions (#3475)

    Summary:
    Pull Request resolved: #3475
    
    Migration to GitHub
    
    Reviewed By: algoriddle
    
    Differential Revision: D57707064
    
    fbshipit-source-id: 17f0a97028007f3664faa5b6b2c269f50bcdf39e
    ramilbakhshyiev authored and facebook-github-bot committed May 23, 2024
    Configuration menu
    Copy the full SHA
    ee7ce21 View commit details
    Browse the repository at this point in the history
  3. Gate all PR builds behind linux-x86_64-cmake in GitHub Actions (#3476)

    Summary:
    Pull Request resolved: #3476
    
    The long tail will still be the RAFT build but we can save on cost if the build has errors by incurring ~10m penalty added by waiting for the basic cmake build to complete. Both GPU and RAFT builds will start together so this will take less time overall to complete.
    
    Reviewed By: algoriddle
    
    Differential Revision: D57707298
    
    fbshipit-source-id: 3589842e9bda9ebca9b25e089e6177fe96b6a0f5
    ramilbakhshyiev authored and facebook-github-bot committed May 23, 2024
    Configuration menu
    Copy the full SHA
    93bc9b6 View commit details
    Browse the repository at this point in the history
  4. Disable CircleCI builds (#3477)

    Summary:
    Pull Request resolved: #3477
    
    AVX-512 must remain on CircleCI until GitHub provides runners with AVX-512 support (ETA: Q1 2025).
    
    Reviewed By: algoriddle
    
    Differential Revision: D57707621
    
    fbshipit-source-id: e8a0885f8363cf8f20854cccca3ec0adc946362b
    ramilbakhshyiev authored and facebook-github-bot committed May 23, 2024
    Configuration menu
    Copy the full SHA
    eec4cba View commit details
    Browse the repository at this point in the history
  5. Remove extra semi colon from deprecated/libmccpp/ThreadSafeClientPool…

    ….h (#3479)
    
    Summary:
    Pull Request resolved: #3479
    
    `-Wextra-semi` or `-Wextra-semi-stmt`
    
    If the code compiles, this is safe to land.
    
    Reviewed By: palmje
    
    Differential Revision: D57632759
    
    fbshipit-source-id: 48bc23e87b3f518182085124c4c8e68ddbb3ca8f
    r-barnes authored and facebook-github-bot committed May 23, 2024
    Configuration menu
    Copy the full SHA
    729a66f View commit details
    Browse the repository at this point in the history
  6. Remove duplicate NegativeDistanceComputer instances (#3450)

    Summary: Pull Request resolved: #3450
    
    Reviewed By: mdouze
    
    Differential Revision: D57708412
    
    Pulled By: junjieqi
    
    fbshipit-source-id: 9540b7e60d8b2b39e0ca92423d2a305fab2a17e6
    alexanderguzhva authored and facebook-github-bot committed May 23, 2024
    Configuration menu
    Copy the full SHA
    eb28481 View commit details
    Browse the repository at this point in the history
  7. Delete Raft Handle (#3435)

    Summary:
    Small Raft related modification to StandardGpuResources:
    if the stream for a particular device is modified by a user, delete the Raft handle for that device. On any subsequent call to `getRaftHandle(device)`, a new raft handle with the updated stream will be created.
    Closes #3424
    
    Pull Request resolved: #3435
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D57640976
    
    Pulled By: junjieqi
    
    fbshipit-source-id: 41e2898a39250b7e52e920b71e819fc21ca9fc85
    tarang-jain authored and facebook-github-bot committed May 23, 2024
    Configuration menu
    Copy the full SHA
    6580156 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2024

  1. Add python tutorial on different indexs refinement and respect accura…

    …cy measurement (#3480)
    
    Summary:
    Pull Request resolved: #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
    Xiao Fu authored and facebook-github-bot committed May 27, 2024
    Configuration menu
    Copy the full SHA
    6e423cc View commit details
    Browse the repository at this point in the history

Commits on May 28, 2024

  1. Workaround for missing intrinsic on gcc < 9 (#3481)

    Summary:
    Rebased branch for #3420
    
    Pull Request resolved: #3481
    
    Reviewed By: mdouze
    
    Differential Revision: D57830230
    
    Pulled By: junjieqi
    
    fbshipit-source-id: a93fb3cc53f11245faec891a9590b5e849dbf3b9
    borrrden authored and facebook-github-bot committed May 28, 2024
    Configuration menu
    Copy the full SHA
    db6ff2e View commit details
    Browse the repository at this point in the history
  2. fix algorithm of spreading vectors over shards (#3374)

    Summary:
    simple math:
    | **input n** | **input nshards** |  shard_size | idx | i0 | ni |
    | -- |-- |-- |-- |-- |-- |
    | 19 | 6 | 4 | 5 | 20 | **-1** |
    | 1000 | 37 | 28 | 36 | 1008 | -8 |
    | 1000 | 64 | 16 | 63 | 1008 | -8 |
    
    root cause:
    integer cause precision loss, `idx * shard_size` overflows, because `(n + nshards - 1) / nshards` is roundup
    
    my solution:
    each shard takes at least  `base_shard_size = n / nshards`, then `remain = n % nshards`, we know `0 <= remain < nshards`, next, assign those remain vectors to first `remain` shards, i.e. first `remain` shards take one more vector each.
    ```c++
    auto i0 = idx * base_shard_size;
    if (i0 < remain) {
      // if current idx is one of the first `remain` shards
      i0 += idx;
    } else {
      i0 += remain;
    }
    ```
    simplify above code: `i0 = idx * base_shard_size + std::min(size_t(idx), n % nshards);`
    
    Pull Request resolved: #3374
    
    Reviewed By: fxdawnn
    
    Differential Revision: D57867910
    
    Pulled By: junjieqi
    
    fbshipit-source-id: 7e72ea5cd197af4f3446fb7a3fd34ad08901dbb2
    simshi authored and facebook-github-bot committed May 28, 2024
    Configuration menu
    Copy the full SHA
    6e7d9e0 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2024

  1. sys.big_endian to sys.byteorder (#3422)

    Summary:
    Pull Request resolved: #3422
    
    Found vec_io failing when running some benchmarking.
    There is no such field named big_endian in sys. So, reverting it to original field byteorder
    
    Reviewed By: algoriddle
    
    Differential Revision: D56718607
    
    fbshipit-source-id: 553f1d2d6bc967581142a92282e534f3f164e8f9
    kuarora authored and facebook-github-bot committed May 30, 2024
    Configuration menu
    Copy the full SHA
    0beecb4 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2024

  1. Adding buck target for experiment bench_fw_ivf (#3423)

    Summary:
    Pull Request resolved: #3423
    
    Adding small fixes to run experiments from fbcode.
    1. Added buck target
    2. Full import path of faiss bench_fw modules
    3. new dataset path to run tests locally as we can't use  an existing directory ./data in fbcode.
    
    Reviewed By: algoriddle, junjieqi
    
    Differential Revision: D57235092
    
    fbshipit-source-id: f78a23199e619b640a19ca37f8b52ff0abdd8298
    kuarora authored and facebook-github-bot committed May 31, 2024
    Configuration menu
    Copy the full SHA
    2230434 View commit details
    Browse the repository at this point in the history
  2. add skip_storage flag to HNSW (#3487)

    Summary:
    Pull Request resolved: #3487
    
    Sometimes it is not useful to serialize the storage index along with a HNSW index. This diff adds a flag that supports skipping the storage of the index.
    
    Searchign and adding to the index is not possible until a storage index is added back in.
    
    Reviewed By: junjieqi
    
    Differential Revision: D57911060
    
    fbshipit-source-id: 5a4ceee4a8f53f6f746df59af3942b813a99c14f
    mdouze authored and facebook-github-bot committed May 31, 2024
    Configuration menu
    Copy the full SHA
    bf73e38 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2024

  1. Add cpp tutorial for index factory refine index construction (#3494)

    Summary:
    Pull Request resolved: #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
    Xiao Fu authored and facebook-github-bot committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    a900cfa View commit details
    Browse the repository at this point in the history
  2. Update .gitignore (#3492)

    Summary:
    Adding build folder to gitignore, so that they don't show up in the commit tree while building from source
    
    Pull Request resolved: #3492
    
    Reviewed By: junjieqi
    
    Differential Revision: D58171359
    
    Pulled By: asadoughi
    
    fbshipit-source-id: b0efed348769328a3bdbcc13098dcb84cadb6c4f
    abhiramvad authored and facebook-github-bot committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    ec67ac1 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2024

  1. Interop between CAGRA and HNSW (#3252)

    Summary:
    Depends on #3084
    
    Pull Request resolved: #3252
    
    Reviewed By: junjieqi
    
    Differential Revision: D57971948
    
    Pulled By: mdouze
    
    fbshipit-source-id: 4371f4d136eeceb59568593f98a6ae9163a768ba
    divyegala authored and facebook-github-bot committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    df0dea6 View commit details
    Browse the repository at this point in the history
  2. fix spurious include to land the cagra diff (#3502)

    Summary:
    Pull Request resolved: #3502
    
    include probably added by vscode
    
    Reviewed By: mengdilin
    
    Differential Revision: D58411537
    
    fbshipit-source-id: 3035f690d26decc937fb492c54ffa2f974ee2db8
    mdouze authored and facebook-github-bot committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    f71d5b9 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2024

  1. add use_raft to knn_gpu (torch) (#3509)

    Summary:
    Add support for `use_raft` in the torch version of `knn_gpu`. The numpy version already has this support, see https://github.com/facebookresearch/faiss/blob/main/faiss/python/gpu_wrappers.py#L59
    
    Pull Request resolved: #3509
    
    Reviewed By: mlomeli1, junjieqi
    
    Differential Revision: D58489851
    
    Pulled By: algoriddle
    
    fbshipit-source-id: cfad722fefd4809b135b765d0d43587cfd782d0e
    algoriddle authored and facebook-github-bot committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    3d32330 View commit details
    Browse the repository at this point in the history
  2. Add conda bin to path early in the cmake GitHub action (#3512)

    Summary:
    Pull Request resolved: #3512
    
    Pull Request resolved: #3510
    
    GitHub hosted runners some with the build-essentials package pre-installed, self-hosted runners on AWS do not have this package. This made it all steps other than the `all targets` one fall back to the system executables which unintentially worked on GitHub hosted runners but not on the self-hosted ones. This diff fixes it by pulling the line that adds conda bin to path early in the cmake build action.
    
    Reviewed By: asadoughi
    
    Differential Revision: D58513853
    
    fbshipit-source-id: 23e95459e0031c96bd142515db07d1b700d713cf
    ramilbakhshyiev authored and facebook-github-bot committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    d45f78b View commit details
    Browse the repository at this point in the history
  3. typo in test_io_no_storage (#3515)

    Summary:
    Pull Request resolved: #3515
    
    Fix typo `test_io_no_storage`
    
    Reviewed By: kuarora, asadoughi
    
    Differential Revision: D58540190
    
    fbshipit-source-id: b8b9cacd7ea6005c0edb94014de74188450318c1
    algoriddle authored and facebook-github-bot committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    34feae4 View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2024

  1. Consolidate build environment configuration steps in cmake builds (#3516

    )
    
    Summary:
    Pull Request resolved: #3516
    
    This diff seeks to simplify the steps that install conda packages and environment configuration into a single step at the start of the cmake build action.
    
    Reviewed By: mnorris11
    
    Differential Revision: D58560454
    
    fbshipit-source-id: ee2c6b36865809f31eb335cfb3c2fffdccaa318d
    ramilbakhshyiev authored and facebook-github-bot committed Jun 14, 2024
    Configuration menu
    Copy the full SHA
    44d21ee View commit details
    Browse the repository at this point in the history
  2. fix Windows build - signed int OMP for MSVC (#3517)

    Summary:
    Pull Request resolved: #3517
    
    MSVC doesn't support unsigned int for OMP
    
    Reviewed By: kuarora, junjieqi, ramilbakhshyiev
    
    Differential Revision: D58591594
    
    fbshipit-source-id: ac7d6b37a82f9543be3e0fe418f0f6b439751475
    algoriddle authored and facebook-github-bot committed Jun 14, 2024
    Configuration menu
    Copy the full SHA
    e65a910 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2024

  1. Unbreak RAFT conda builds (#3519)

    Summary:
    Pull Request resolved: #3519
    
    Fixing the conda conflicts because of `_openmp_mutex` build versions. This change pins that version for RAFT conda package builds.
    
    Reviewed By: algoriddle
    
    Differential Revision: D58646659
    
    fbshipit-source-id: 4c1eaa9f08bd354da016b9399a36698007a497d8
    ramilbakhshyiev authored and facebook-github-bot committed Jun 17, 2024
    Configuration menu
    Copy the full SHA
    849557a View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2024

  1. Bump libraft to 24.06 to unblock nightly RAFT builds (#3522)

    Summary:
    Pull Request resolved: #3522
    
    Quick fix to unblock nightly
    
    Reviewed By: mlomeli1
    
    Differential Revision: D58694193
    
    fbshipit-source-id: ea323991cc2e2b958fc11ab614dcd6e09d4c072c
    ramilbakhshyiev authored and facebook-github-bot committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    e188eb3 View commit details
    Browse the repository at this point in the history
  2. Add ABS_INNER_PRODUCT metric (#3524)

    Summary:
    Pull Request resolved: #3524
    
    Searches with the metric abs(dot(query, database))
    This makes it possible to search vectors that are closest to a hyperplane
    
    * adds support for alternative metrics in faiss.knn in python
    
    * checks that it works with HNSW
    
    * simplifies the extra distances interface by removing the template on
    
    Reviewed By: asadoughi
    
    Differential Revision: D58695971
    
    fbshipit-source-id: 2a0ff49c7f7ac2c005d85f141cc5de148081c9c4
    mdouze authored and facebook-github-bot committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    e758973 View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2024

  1. Adding faiss bench_fw to bento faiss kernel (#3531)

    Summary:
    Pull Request resolved: #3531
    
    **In this diff**
    1. I have add bench_fw to bento faiss kernel target
    2. First part of notebook is changed to analyze sift1M results
    
    Reviewed By: algoriddle
    
    Differential Revision: D58823037
    
    fbshipit-source-id: a67d4638af4368f0575bd289ce7aff8cf1fcd38b
    kuarora authored and facebook-github-bot committed Jun 21, 2024
    Configuration menu
    Copy the full SHA
    3a7c718 View commit details
    Browse the repository at this point in the history
  2. Refactor bench_fw to support train, build & search in parallel (#3527)

    Summary:
    Pull Request resolved: #3527
    
    **Context**
    Design Doc: [Faiss Benchmarking](https://docs.google.com/document/d/1c7zziITa4RD6jZsbG9_yOgyRjWdyueldSPH6QdZzL98/edit)
    
    **In this diff**
    1. Be able to reference codec and index from blobstore (bucket & path) outside the experiment
    2. To support #1, naming is moved to descriptors.
    3. Build index can be written as well.
    4. You can run benchmark with train and then refer it in index built and then refer index built in knn search. Index serialization is optional. Although not yet exposed through index descriptor.
    5. Benchmark can support index with different datasets sizes
    6. Working with varying dataset now support multiple ground truth. There may be small fixes before we could use this.
    7. Added targets for bench_fw_range, ivf, codecs and optimize.
    
    **Analysis of ivf result**: D58823037
    
    Reviewed By: algoriddle
    
    Differential Revision: D57236543
    
    fbshipit-source-id: ad03b28bae937a35f8c20f12e0a5b0a27c34ff3b
    kuarora authored and facebook-github-bot committed Jun 21, 2024
    Configuration menu
    Copy the full SHA
    da75d03 View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2024

  1. Add SQ8bit signed quantization (#3501)

    Summary:
    ### Description
    Add new signed 8 bit scalar quantizer, `QT_8bit_direct_signed` to ingest signed 8 bit vectors ([-128 to 127]).
    
    ### Issues Resolved
    #3488
    
    Pull Request resolved: #3501
    
    Reviewed By: mengdilin
    
    Differential Revision: D58639363
    
    Pulled By: mdouze
    
    fbshipit-source-id: cf7f244fdbb7a34051d2b20c6f8086cd5628b4e0
    naveentatikonda authored and facebook-github-bot committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    33c0ba5 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2024

  1. Fix seg faults in CAGRA C++ unit tests (#3552)

    Summary:
    The issue was that `uniform_int_distribution` generates numbers in the range `[0, ntotal]` and not `[0, ntotal)`, which was an oversight on my part. This PR also attempts to reduce the tolerance for `copyTo` tests as we have seen those fail intermittently.
    
    cc ramilbakhshyiev mdouze cjnolet
    
    Pull Request resolved: #3552
    
    Reviewed By: junjieqi
    
    Differential Revision: D59097786
    
    Pulled By: ramilbakhshyiev
    
    fbshipit-source-id: 9dac4367e25c6c219b116ed172089a2fa2a39c4f
    divyegala authored and facebook-github-bot committed Jun 27, 2024
    Configuration menu
    Copy the full SHA
    079fd55 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2024

  1. Non-Blocking AVX512 Build on self-hosted github runner (#3602)

    Summary:
    Start beta-testing AVX512 Build on self-hosted github runner with label faiss-aws-m7i.xlarge. This build is non-blocking on the PRs right now (via the parameter `continue-on-error`)
    
    Pull Request resolved: #3602
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D59290555
    
    Pulled By: mengdilin
    
    fbshipit-source-id: 6a82538bd44fecf4913885ac3b1999eb0fa52047
    mengdilin authored and facebook-github-bot committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    f821704 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2024

  1. Adding missing includes which are necessary for building (#3609)

    Summary:
    Pull Request resolved: #3609
    
    The current version of Faiss cannot be built due to missing #includes on a test file tests/test_ivf_index.cpp. This is better described in issue #3532.
    
    #3533
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D59314273
    
    fbshipit-source-id: 6ec8bfa973760d0a44bc94ae751b4fc55c4784ef
    junjieqi authored and facebook-github-bot committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    db251e2 View commit details
    Browse the repository at this point in the history
  2. Fix typo in matrix mult (#3607)

    Summary:
    Pull Request resolved: #3607
    
    Github issue: #3026
    
    Reviewed By: mengdilin, junjieqi
    
    Differential Revision: D59284732
    
    fbshipit-source-id: a1100c05e7eab40ae90e910364f9ee1db8b1bc55
    Michael Norris authored and facebook-github-bot committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    3fe0b93 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2024

  1. Create autoclose GHA workflow (#3614)

    Summary:
    After a reviewer labels the issue as "autoclose", issues will be labeled as "stale" after 7 days of no update and close after an additional 7 days.
    
    See https://docs.github.com/en/actions/managing-issues-and-pull-requests/closing-inactive-issues and https://github.com/marketplace/actions/close-stale-issues
    
    Pull Request resolved: #3614
    
    Reviewed By: junjieqi
    
    Differential Revision: D59411424
    
    Pulled By: asadoughi
    
    fbshipit-source-id: d79f173de900d5aec53d01c77e8ddc9a8312c12c
    asadoughi authored and facebook-github-bot committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    e5ab701 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2024

  1. Rename autoclose to autoclose.yml (#3618)

    Summary: Pull Request resolved: #3618
    
    Reviewed By: junjieqi
    
    Differential Revision: D59467510
    
    Pulled By: asadoughi
    
    fbshipit-source-id: 52c4cc42e7a9362d78596a695ec4a1121bf455a2
    asadoughi authored and facebook-github-bot committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    036a7e3 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2024

  1. Set verbosoe before train (#3619)

    Summary:
    Pull Request resolved: #3619
    
    Resolves issue #3293
    
    This just means that we wouldn't get verbose prints in train() before, and after we do.
    
    Reviewed By: junjieqi
    
    Differential Revision: D59474995
    
    fbshipit-source-id: 72537643b661c553353e5f701cfcaf76d21f40d2
    Michael Norris authored and facebook-github-bot committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    444614b View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2024

  1. add dispatcher for VectorDistance and ResultHandlers

    Summary: Add dispatcher function to avoid repeating dispatching code for distance computation and result handlers.
    
    Reviewed By: asadoughi
    
    Differential Revision: D59318865
    
    fbshipit-source-id: 59046ede02f71a0da3b8061289fc70306bf875cb
    mdouze authored and facebook-github-bot committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    261edde View commit details
    Browse the repository at this point in the history
  2. Add search functionality to FlatCodes (#3611)

    Summary:
    Pull Request resolved: #3611
    
    Using the new dispatcher functions, add search func to flat codes. To test it, make IndexLattice a subclass of FlatCodes and check the resonstruction there.
    
    Reviewed By: asadoughi
    
    Differential Revision: D59367989
    
    fbshipit-source-id: 405dab4358fe34b2e38ac8bcc222b19f58643229
    mdouze authored and facebook-github-bot committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    ab109c2 View commit details
    Browse the repository at this point in the history
  3. QINCo implementation in CPU Faiss (#3608)

    Summary:
    Pull Request resolved: #3608
    
    This is a straightforward implementation of QINCo in CPU Faiss, with encoding and decoding capabilities (not training).
    
    For this, we translate a simplified version of some torch classes:
    
    - tensors, restricted to 2D and int32 + float32
    
    - Linear and Embedding layer
    
    Then the QINCoStep and QINCo can just be defined as C++ objects that are copy-constructable.
    
    There is some plumbing required in the wrapping layers to support the integration. Pytroch tensors are converted to numpy for getting / setting them in C++.
    
    Reviewed By: asadoughi
    
    Differential Revision: D59132952
    
    fbshipit-source-id: eea4856507a5b7c5f219efcf8d19fe56944df088
    mdouze authored and facebook-github-bot committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    dd72e41 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2024

  1. Fix CI for AVX512 (#3649)

    Summary:
    With the refactoring diff landed in [D59650573](https://www.internalfb.com/diff/D59650573), we take in the instance type string for aws and register it as the label for the runner. There was a typo in the previous registration (`m7i.xlarge` instead of `m7i.large`). The refactoring diff fixed the typo from the runner registration side but we need to fix it on the CI side as well so CI can find the runners
    
    Pull Request resolved: #3649
    
    Test Plan: CI's AVX512 run on Github Action should succeed instead of stuck in pending
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D59916841
    
    Pulled By: mengdilin
    
    fbshipit-source-id: 5403e1a449ed765f0bf1a00e4a0d81d6c97463b9
    mengdilin authored and facebook-github-bot committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    749163e View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. 1720 - expose FAISS version field to c_api (#3635)

    Summary:
    Pull Request resolved: #3635
    
    Add a util function to return the version in the c api.
    
    Reviewed By: ramilbakhshyiev, fxdawnn
    
    Differential Revision: D59817407
    
    fbshipit-source-id: ca805f8e04f554d0294ba9da8ec6dc7c31e91fe3
    bshethmeta authored and facebook-github-bot committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    8b5895f View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2024

  1. First attempt at LSH matching with nbits (#3679)

    Summary:
    Pull Request resolved: #3679
    
    T195237796 Claims we should be able to incldue nbits in the LSH factory string.
    
    Their example is:
    
    ```
    index = faiss.index_factory(128, 'LSH16rt')
    Returns the following error.
    faiss/index_factory.cpp:880: could not parse index string LSHrt_16
    ```
    
    This is my first attempt at modifying the regex to accept an integer for nbits. Can an expert help me understand what the domain of accepted strings should be so I can modify the regex as necessary?
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D60054776
    
    fbshipit-source-id: e47074eb9986b7c1c702832fc0bf758f60f45290
    bshethmeta authored and facebook-github-bot committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    aed7b0e View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2024

  1. Add warning on adding nbits to LSH index factory (#3687)

    Summary:
    Pull Request resolved: #3687
    
    We will write a warning if nbits is not specified while using index factory with LSH. The warning lets users know we will be using default d as nbits.
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D60187935
    
    fbshipit-source-id: 0fa960eeed615d857add77fa131a4cfa1989809d
    bshethmeta authored and facebook-github-bot committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    0363934 View commit details
    Browse the repository at this point in the history
  2. Back out "Add warning on adding nbits to LSH index factory" (#3690)

    Summary:
    Pull Request resolved: #3690
    
    Seems like this may not be necessary because it is the the expected behavior.
    
    See: #3687 (comment)
    
    Reviewed By: asadoughi
    
    Differential Revision: D60241747
    
    fbshipit-source-id: 7b8780fc4922a58c1975ae1b4343dc87e0eda0e1
    bshethmeta authored and facebook-github-bot committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    f2361a4 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2024

  1. Moved statements to faiss.ai (#3694)

    Summary:
    Pull Request resolved: #3694
    
    depends on #3693
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D60255937
    
    fbshipit-source-id: 9d56812a9d94d8d81ed855aa97232cd400fdeac4
    Amir Sadoughi authored and facebook-github-bot committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    6e1f23f View commit details
    Browse the repository at this point in the history
  2. add get_version() for c_api. (#3688)

    Summary:
    Pull Request resolved: #3688
    Looks like our previous changes only modified the cpp API. Not the c_api like the request wanted. This attempts to add faiss_get_version to c_api
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D60207739
    
    fbshipit-source-id: 07184aeae92a154bb3f440279595077f002851f3
    bshethmeta authored and facebook-github-bot committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    4cfa638 View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2024

  1. Add ARM64 build to build_cmake actions for SVE (#3653)

    Summary:
    Add instructions to download arm64 specific conda dependencies and cmake command and run it on CI. This should prepare us to turn on CI with SVE optimization
    
    Pull Request resolved: #3653
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D60043435
    
    Pulled By: mengdilin
    
    fbshipit-source-id: d81bb1c1022681c3da8f98bbf080d5e1d65d6b80
    mengdilin authored and facebook-github-bot committed Jul 27, 2024
    Configuration menu
    Copy the full SHA
    34bbe5e View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2024

  1. Fix radius search with HSNW and IP (#3698)

    Summary:
    Pull Request resolved: #3698
    
    Addressed issue
    
    #3684
    
    I forgot to negate the threshold of the radius search.
    This diff adds a test and fixes the issue.
    
    Reviewed By: mengdilin
    
    Differential Revision: D60373054
    
    fbshipit-source-id: 70f3daa8292177a4038846a94aff6221f88077e8
    mdouze authored and facebook-github-bot committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    7178bf8 View commit details
    Browse the repository at this point in the history
  2. Add sve targets (#2886)

    Summary:
    related: #2884
    
    This PR contains below changes:
    
    - Add new optlevel `sve`
        - ARM SVE is _extension_ of ARMv8, so it should be treated similar to AVX2 IMO
    - Add targets for ARM SVE, `faiss_sve` and `swigfaiss_sve`
        - These targets will be built when you give `-DFAISS_OPT_LEVEL=sve` at build time
        - Design decision: Don't fix SVE register length.
            - The python package of faiss is "fat binary" (for example, the package for avx2 contains `_swigfaiss_avx2.so` and `_swigfaiss.so`)
            - SVE is scalable instruction set (= doesn't fix vector length), but actually we can specify the vector length at compile time.
                - [with `-msve-vector-length=` option](https://developer.arm.com/documentation/101726/4-0/Coding-for-Scalable-Vector-Extension--SVE-/SVE-Vector-Length-Specific--VLS--programming)
                - When this option is specified, the binary can't work correctly on the CPU which has other vector length rather than specified at compile time
            - When we use fixed vector length, SVE-supported faiss python package will contain 7 shared libraries like `_swigfaiss.so` , `_swigfaiss_sve.so` , `_swigfaiss_sve128.so` , `_swigfaiss_sve256.so` , `_swigfaiss_sve512.so` , `_swigfaiss_sve1024.so` , and `_swigfaiss_sve2048.so` . The package size will be exploded.
            - For these reason, I don't specify the vector length at compile time and `faiss_sve` detects the vector length at run time.
    - Add a mechanism of detecting ARM SVE on runtime environment and importing `swigfaiss_sve` dynamically
        - Currently it only supports Linux, but there is no SVE environment with non-Linux OS now, as far as I know
    
    NOTE: I plan to make one more PR about add some SVE implementation after this PR merged. This PR only contains adding sve target.
    
    Pull Request resolved: #2886
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D60386983
    
    Pulled By: mengdilin
    
    fbshipit-source-id: 7e66162ee53ce88fbfb6636e7bf705b44e6c3282
    vorj authored and facebook-github-bot committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    4eeaa42 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. Gate ARM SVE build behind base Linux build (#3701)

    Summary:
    Pull Request resolved: #3701
    
    Gating ARM SVE behind the plain vanilla linux x64 build like all the other builds.
    
    Reviewed By: mengdilin
    
    Differential Revision: D60425535
    
    fbshipit-source-id: f2e082fbaa6ea1e314ffe0e2e7260c8634cab989
    ramilbakhshyiev authored and facebook-github-bot committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    fecabc2 View commit details
    Browse the repository at this point in the history
  2. Merge cmake command in the cmake build action (#3702)

    Summary:
    Pull Request resolved: #3702
    
    Simplify the cmake command in the cmake build action
    
    Reviewed By: mengdilin
    
    Differential Revision: D60427830
    
    fbshipit-source-id: 0e89068649a61e2df3889de69e4d3fa13de0442f
    ramilbakhshyiev authored and facebook-github-bot committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    28f7d3a View commit details
    Browse the repository at this point in the history
  3. turn on SVE opt mode in CI (#3703)

    Summary:
    Pull Request resolved: #3703
    
    Now that SVE PR has been merged, we can turn on SVE opt mode in CI
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D60457456
    
    fbshipit-source-id: 053b1f8ac805afba9035095c5df811da05675a81
    mengdilin authored and facebook-github-bot committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    96d0781 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. fbcode//faiss/tests (#3707)

    Summary: Pull Request resolved: #3707
    
    Differential Revision: D60503059
    
    fbshipit-source-id: af5405717e08d78ab11ee8ee431f2b8a00c2aa70
    generatedunixname2443911735787003 authored and facebook-github-bot committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    8013fbd View commit details
    Browse the repository at this point in the history
  2. Include libfaiss_python_callbacks.so in python installation. (#2062)

    Summary:
    Include `libfaiss_python_callbacks.so` in `setup.py`.
    
    Pull Request resolved: #2062
    
    Reviewed By: kuarora
    
    Differential Revision: D60528532
    
    Pulled By: junjieqi
    
    fbshipit-source-id: e624e297b3efc4dd162230fe0b345242ce91bd4d
    ccoulombe authored and facebook-github-bot committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    2883129 View commit details
    Browse the repository at this point in the history
  3. suppress warning (#3708)

    Summary:
    suppress below warning:
    
    ```
    In file included from /path/to/faiss/faiss/utils/extra_distances.h:59,
                     from /path/to/faiss/faiss/IndexFlatCodes.cpp:16:
    /path/to/faiss/faiss/utils/extra_distances-inl.h: In function ‘typename Consumer::T faiss::dispatch_VectorDistance(size_t, MetricType, float, Consumer&, Types ...) [with Consumer = {anonymous}::Run_get_distance_computer; Types = {const IndexFlatCodes*}]’:
    /path/to/faiss/faiss/utils/extra_distances-inl.h:198:1: warning: control reaches end of non-void function [-Wreturn-type]
      198 | }
          | ^
    ```
    
    Pull Request resolved: #3708
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D60528995
    
    Pulled By: mengdilin
    
    fbshipit-source-id: 97a6721f3f59ec59ae6d2e69137b1ecc85d7da12
    vorj authored and facebook-github-bot committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    677e73f View commit details
    Browse the repository at this point in the history
  4. ROCm support (#3462)

    Summary:
    * add hipify at configure time
    * ROCm specific code paths behind USE_ROCM guards
    * support for wavefront 32 (Navi) and 64 (MI)
    * use builtins to match inline PTX
    * support C API on ROCm
    * support Python API on ROCm
    
    ---------
    
    Pull Request resolved: #3462
    
    Reviewed By: asadoughi
    
    Differential Revision: D60431193
    
    Pulled By: ramilbakhshyiev
    
    fbshipit-source-id: ac82d5ecb38f995c467e100ed583d5178ae489ee
    iotamudelta authored and facebook-github-bot committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    b670cb1 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2024

  1. Enable ROCm in build-only mode (#3713)

    Summary:
    Pull Request resolved: #3713
    
    Enable ROCm in CI
    
    Reviewed By: asadoughi
    
    Differential Revision: D60598458
    
    fbshipit-source-id: f95d9a2b0b894c3f7272d4f1963d9230e1069bf8
    ramilbakhshyiev authored and facebook-github-bot committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    4e2aead View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2024

  1. ROCm linter and shellcheck warning cleanup (#3715)

    Summary:
    Pull Request resolved: #3715
    
    Cleaning up linter and shell warnings after importing the PR. This is done as a follow-up as it's easier to address these in a separate PR since the original PR was authored by an external contributor.
    
    Reviewed By: mengdilin
    
    Differential Revision: D60639835
    
    fbshipit-source-id: eba00a557339873742e1caf43c6be45f4d065333
    ramilbakhshyiev authored and facebook-github-bot committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    e59d8c3 View commit details
    Browse the repository at this point in the history
  2. ROCm CMake configuration cleanup (#3716)

    Summary:
    Pull Request resolved: #3716
    
    Renaming `USE_ROCM` to `FAISS_ENABLE_ROCM` in CMake files, `FAISS_ENABLE_ROCM` in SWIG files, and `USE_AMD_ROCM` in other source files to follow the existing naming convention.
    
    Reviewed By: mnorris11
    
    Differential Revision: D60673731
    
    fbshipit-source-id: 1aaa3f2ff6836830c4eb733ee7f41554f79f9695
    ramilbakhshyiev authored and facebook-github-bot committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    a757309 View commit details
    Browse the repository at this point in the history
  3. Turn on blocking build for AVX512 and SVE on GHA (#3717)

    Summary:
    Pull Request resolved: #3717
    
    they have been running in shadow mode for quite some time now.
     I spot-checked the builds for the past 10 jobs and they all look good. Since `continue-on-error` will always mark a job as "green" even if it fails, I need a way to holistically verify these builds actually work reliably. Turning the builds to blocking to accomplish that.
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D60692521
    
    fbshipit-source-id: 172a6362c672b0376c76559f12852110936756df
    mengdilin authored and facebook-github-bot committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    0b2328f View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2024

  1. CMake step to symlink system libraries for RAFT and ROCm (#3725)

    Summary:
    Pull Request resolved: #3725
    
    This step is necessary for both of the builds with newer gxx_linux package version. ROCm is already using this symlinking and this change expands it to RAFT as well.
    
    Reviewed By: mengdilin
    
    Differential Revision: D60830977
    
    fbshipit-source-id: fe95a6580b3866e17b56d542509405e93a3ff453
    ramilbakhshyiev authored and facebook-github-bot committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    85df0e0 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2024

  1. Unpin gxx_linux-64 requirement (#3655)

    Summary:
    The TestPartitioning.TestPartitioningBigRange test case fails on gcc version 13.2. We can avoid this by requiring gcc version 11.2 where the test case works.
    
    Pull Request resolved: #3655
    
    Test Plan: Check github workflows and test branches
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D59988036
    
    Pulled By: gtwang01
    
    fbshipit-source-id: ae6d7f7888c9d7a2e59f557e05dbd4f318983668
    gtwang01 authored and facebook-github-bot committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    e5f4647 View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2024

  1. Update code comment regarding PQ's search metrics (#3733)

    Summary:
    Pull Request resolved: #3733
    
    Update code comment in response to Alexandr's inquiry
    
    #3714
    
    Reviewed By: mengdilin
    
    Differential Revision: D60907205
    
    fbshipit-source-id: ae0f2c9208b8bafd4343910a3c539fa40985191d
    Amir Sadoughi authored and facebook-github-bot committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    90b1da4 View commit details
    Browse the repository at this point in the history
  2. Move nightly builds to 11pm PT (#3737)

    Summary:
    Pull Request resolved: #3737
    
    This moves nightly builds away from when most of the team is working to avoid exhausting limited resources like custom hardware / specialized hardware.
    
    Reviewed By: bshethmeta
    
    Differential Revision: D60976671
    
    fbshipit-source-id: 1a8521379654a06a793fda0ae3f3bd1bf6fa8bf6
    ramilbakhshyiev authored and facebook-github-bot committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    9f79bcf View commit details
    Browse the repository at this point in the history
  3. Add labels to test-results file and include ROCm flag (#3738)

    Summary: Pull Request resolved: #3738
    
    Reviewed By: gtwang01
    
    Differential Revision: D60977946
    
    fbshipit-source-id: f13bfd909b689300ec765fa15d850ef3701bbf37
    ramilbakhshyiev authored and facebook-github-bot committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    acc3a97 View commit details
    Browse the repository at this point in the history
  4. Introduce retry-build workflow (#3718)

    Summary:
    Pull Request resolved: #3718
    
    This workflow needs to be pushed first before it can be called from the build workflow.
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D60697701
    
    fbshipit-source-id: 40cb6b7006dae8293e966cc2cbb0ebda5d606045
    gtwang01 authored and facebook-github-bot committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    c669357 View commit details
    Browse the repository at this point in the history
  5. Add human readable names to PR build steps (#3739)

    Summary: Pull Request resolved: #3739
    
    Reviewed By: mengdilin
    
    Differential Revision: D60978686
    
    fbshipit-source-id: 28a886eaea8f1d2e75f5115fc7035e0b6e555ae0
    ramilbakhshyiev authored and facebook-github-bot committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    01317af View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2024

  1. Auto-retry failed CI builds once (#3740)

    Summary: Pull Request resolved: #3740
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D60992604
    
    fbshipit-source-id: 9edb046356bbcae950c131280ac1822f35bbfe7e
    gtwang01 authored and facebook-github-bot committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    13371c7 View commit details
    Browse the repository at this point in the history
  2. Append ROCm flag to compile definitions for Python instead of overwri…

    …ting (#3742)
    
    Summary:
    Pull Request resolved: #3742
    
    Before this change, the CMake line was setting (instead of appending to) compile definitions for Python code which replace the GPU wrappers flag and resulting in Python library compiling with no GPU code which failed ROCm tests.
    
    Reviewed By: junjieqi
    
    Differential Revision: D61007640
    
    fbshipit-source-id: 174aeb0a4abe0607629ddf57c882d19ea2d6c6bf
    ramilbakhshyiev authored and facebook-github-bot committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    11c15af View commit details
    Browse the repository at this point in the history
  3. Use $HOME variable to find Conda binaries instead of hard-coded path (#…

    …3743)
    
    Summary:
    Pull Request resolved: #3743
    
    This fixes containerized builds that will be needed for ROCm.
    
    Reviewed By: junjieqi
    
    Differential Revision: D61007764
    
    fbshipit-source-id: 11fa8dc3641a85d4c220832bedf0f6d62ae49426
    ramilbakhshyiev authored and facebook-github-bot committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    9f9b53b View commit details
    Browse the repository at this point in the history
  4. Install gpg for ROCm builds (#3744)

    Summary:
    Pull Request resolved: #3744
    
    gpg is needed for ROCm builds but does not come with containerized builds. This change add installation of gpg.
    
    Reviewed By: junjieqi
    
    Differential Revision: D61007840
    
    fbshipit-source-id: 6322112803866dff57637bea290dc032e2bf41ad
    ramilbakhshyiev authored and facebook-github-bot committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    ac18577 View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2024

  1. Adding embedding column to dataset descriptor (#3736)

    Summary:
    Pull Request resolved: #3736
    
    Nit - adding embedding column in dataset descriptor
    Nit - initializing cached_ds as part of class instead of post_init
    
    Reviewed By: satymish
    
    Differential Revision: D60858496
    
    fbshipit-source-id: 3358d866a0668424cd6895bc7a5c620ff97e72fa
    kuarora authored and facebook-github-bot committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    290464f View commit details
    Browse the repository at this point in the history
  2. Containerize ROCm build and move it to AMD GPU runners (#3747)

    Summary:
    Pull Request resolved: #3747
    
    This change converts the ROCm build to run inside containers and updates it to run on AMD GPU based runners. Still working with the AMD team to resolve test failures before enabled those.
    
    Differential Revision: D61049115
    
    fbshipit-source-id: 28274e0bde795f99b3d78711beaf9b3ed3c5e66c
    ramilbakhshyiev authored and facebook-github-bot committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    a56ee81 View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2024

  1. Fixing initialization of dictionary in dataclass (#3749)

    Summary:
    Pull Request resolved: #3749
    
    same as title
    
    Reviewed By: satymish
    
    Differential Revision: D61133788
    
    fbshipit-source-id: 5761e6347365f7701ee0600a9d895b8bd1f0a6b8
    kuarora authored and facebook-github-bot committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    80a2462 View commit details
    Browse the repository at this point in the history
  2. Add hnsw search params for bounded queue option (#3748)

    Summary:
    Pull Request resolved: #3748
    
    So we can dynamically change it
    
    Reviewed By: asadoughi
    
    Differential Revision: D61029191
    
    fbshipit-source-id: 19a6775c1218762dac7a7805e13efab9bb43cfa5
    Emy Sun authored and facebook-github-bot committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    2968ab1 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2024

  1. minor refactor to avoid else block in IVFPQ reconstruct_from_offset. (#…

    …3753)
    
    Summary:
    Pull Request resolved: #3753
    
    minor refactor to avoid else block in IVFPQ reconstruct_from_offset. No change in logic.
    
    Reviewed By: asadoughi
    
    Differential Revision: D61255339
    
    fbshipit-source-id: e0a8ac10570391eaf7ed3b35796af8b38d40a23c
    pankajsingh88 authored and facebook-github-bot committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    b10f001 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2024

  1. introduce options for reducing the overhead for a clustering procedure (

    #3731)
    
    Summary:
    Several changes:
    1. Introduce `ClusteringParameters::check_input_data_for_NaNs`, which may suppress checks for NaN values in the input data
    2. Introduce `ClusteringParameters::use_faster_subsampling`, which uses a newly added SplitMix64-based rng (`SplitMix64RandomGenerator`) and also may pick duplicate points from the original input dataset.  Surprisingly, `rand_perm()` may involve noticeable non-zero costs for certain scenarios.
    3. Negative values for `ClusteringParameters::seed` initialize internal clustering rng with high-resolution clock each time, making clustering procedure to pick different subsamples each time. I've decided not to use `std::random_device` in order to avoid possible negative effects.
    
    Useful for future `ProductResidualQuantizer` improvements.
    
    Pull Request resolved: #3731
    
    Reviewed By: asadoughi
    
    Differential Revision: D61106105
    
    Pulled By: mnorris11
    
    fbshipit-source-id: 072ab2f5ce4f82f9cf49d678122f65d1c08ce596
    alexanderguzhva authored and facebook-github-bot committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    afe9c40 View commit details
    Browse the repository at this point in the history
  2. Add midding hipStream SWIG typedef to fix ROCm memleak in Python (#3760)

    Summary:
    Pull Request resolved: #3760
    
    This fixes the memleak and the warning received after running Python tests under ROCm since no destructor was declared and objects would remain allocated.
    
    Reviewed By: gtwang01
    
    Differential Revision: D61357579
    
    fbshipit-source-id: cf73bbd7a7002565a4224c1f0af0aa6ea5edebdb
    ramilbakhshyiev authored and facebook-github-bot committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    d40adca View commit details
    Browse the repository at this point in the history
  3. Reorder imports in torch_test_contrib_gpu (#3761)

    Summary:
    Pull Request resolved: #3761
    
    This fixes CUDA errors inside faiss in the test environment. If torch is loaded first (this change) then both torch and faiss see all GPUs available on the machine in the ROCm build. Without this change, torch sees the GPUs and faiss does not. AMD team is looking at finding the root cause but we wanted to fix this for now.
    
    Reviewed By: junjieqi, mnorris11
    
    Differential Revision: D61358018
    
    fbshipit-source-id: ac59be99817ef13d37a1676f615585f44eabaf24
    ramilbakhshyiev authored and facebook-github-bot committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    772d860 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2024

  1. Enable Python tests for ROCm (#3763)

    Summary:
    Pull Request resolved: #3763
    
    This change enables Python version of tests for ROCm builds.
    
    Reviewed By: asadoughi
    
    Differential Revision: D61366282
    
    fbshipit-source-id: c2fd688db42d63946f1c5ca7d50f0a1c4d4a33cd
    ramilbakhshyiev authored and facebook-github-bot committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    924c24d View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2024

  1. fix ARM64 SVE CI due to openblas version bump (#3777)

    Summary:
    Pull Request resolved: #3777
    
    openblas version is bumped from 0.3.27 -> 0.3.28 in the last 3 days. This caused the below test to fail. Confirmed with algoriddle bumping nprobe is okay to do
    
    Reviewed By: algoriddle
    
    Differential Revision: D61536541
    
    fbshipit-source-id: 1e83f75011517ba7b856520f11526e72a00494a5
    mengdilin authored and facebook-github-bot committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    c0b32d2 View commit details
    Browse the repository at this point in the history
  2. delete circle CI config (#3732)

    Summary:
    Pull Request resolved: #3732
    
    AVX512 has been running on GhA for some days without issues. Deleting the CircleCI config. Will press the "deprecate CircleCI button" in 1-2 more weeks. I want to wait a little longer just in case anything goes wrong for AVX512 on GhA.
    
    Reviewed By: junjieqi, ramilbakhshyiev
    
    Differential Revision: D60914370
    
    fbshipit-source-id: 5bb09e81c3f5cd1a58525fe633d07373884207d4
    mengdilin authored and facebook-github-bot committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    6e6685b View commit details
    Browse the repository at this point in the history
  3. add reconstruct support to additive quantizers (#3752)

    Summary:
    Pull Request resolved: #3752
    
    add reconstruct support to additive quantizers.
    
    fixes github issue: 2422
    
    Reviewed By: asadoughi
    
    Differential Revision: D61255049
    
    fbshipit-source-id: 09a0edae7fc24295a686d332e2d052e37372d2c0
    pankajsingh88 authored and facebook-github-bot committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    f3c05bd View commit details
    Browse the repository at this point in the history
  4. Move static functions to header file (#3757)

    Summary:
    Pull Request resolved: #3757
    
    In the telemetry wrapper, we need to wrap read_index to return wrapped index structs. D61049751
    
    This read_index wrapper calls several static functions. These are not callable outside a C++ file. Thus this diff changes them to non static and declares them in the header file. Then the wrapper is able to call them.
    
    Reviewed By: asadoughi
    
    Differential Revision: D61282004
    
    fbshipit-source-id: 2c8b2ded169577aa6eecdf1edc7483b0ef5f0665
    Michael Norris authored and facebook-github-bot committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    a10b883 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2024

  1. Specify to retry only on failed jobs (#3772)

    Summary:
    Pull Request resolved: #3772
    
    It looks like there are many failures on the retry build workflow, but these are mainly due to retry attempts with the --failed flag being unable to rerun workflows that don't have any failed jobs.
    
    Reviewed By: kuarora, junjieqi, ramilbakhshyiev
    
    Differential Revision: D61489426
    
    fbshipit-source-id: 6dcef6ba422634bb333e44a5b12c74c5d3b3df8f
    gtwang01 authored and facebook-github-bot committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    a43afd6 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2024

  1. Add sampling fields to dataset descriptor (#3782)

    Summary:
    Pull Request resolved: #3782
    
    Fields sampling_column and sampling_rate are added to dataset descriptor for supporting sampling in dataset readers.
    
    Reviewed By: satymish
    
    Differential Revision: D61569067
    
    fbshipit-source-id: e5db9957538b033bbef4b7662154411b9044d1f8
    kuarora authored and facebook-github-bot committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    5c87f13 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2024

  1. fix get_compile_options bug (#3785)

    Summary:
    Pull Request resolved: #3785
    
    Right now when avx512 is turned on, we will only return AVX2 in options. My understanding is turning on avx512 sets both the macros `__AVX2__` and `__AVX512F__`: https://fburl.com/vgh7jg9p
    
    Reviewed By: asadoughi
    
    Differential Revision: D61674490
    
    fbshipit-source-id: 47292025b4eb5ef5907c4fbb0bbf39259129f6ee
    mengdilin authored and facebook-github-bot committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    6053348 View commit details
    Browse the repository at this point in the history
  2. Enable most of C++ tests on ROCm (#3786)

    Summary:
    Pull Request resolved: #3786
    
    ROCm build successfully passes all but 2 GPU tests and we want to enable the passing test on CI while skipping the 2 failing tests to make progress. The 2 failing tests are failing specifically on the hardware type that we use for our runners and the AMD team is actively working on root causing it and providing a fix:
    `TestGpuIndexIVFPQ.Query_L2_MMCodeDistance`
    `TestGpuIndexIVFPQ.Query_IP_MMCodeDistance`
    
    Reviewed By: asadoughi
    
    Differential Revision: D61688657
    
    fbshipit-source-id: 3fedfcf22a0ccf40ac8aff033e8bc09c4eb0cbd5
    ramilbakhshyiev authored and facebook-github-bot committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    58a673d View commit details
    Browse the repository at this point in the history
  3. add AMD_ROCM as part of get_compile_options (#3790)

    Summary:
    Pull Request resolved: #3790
    
    Comment from ramilbakhshyiev https://www.internalfb.com/diff/D61674490?dst_version_fbid=359297527230868&transaction_fbid=8025001410919172
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D61680186
    
    fbshipit-source-id: 2b6d5803e620b36878b669e617253c875562c30f
    mengdilin authored and facebook-github-bot committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    4ca6734 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2024

  1. avx512 compilation option (#3798)

    Summary:
    Pull Request resolved: #3798
    
    Alexander left a comment on the previous PR: #3785 (comment). The contract for the function seems to be that it will only append a single compilation option, not a list of options. Fixing it to comply with the contract.
    
    Reviewed By: asadoughi, ramilbakhshyiev
    
    Differential Revision: D61803839
    
    fbshipit-source-id: 948a3d636f6dd6b5c4f975d236c19923af2bbd18
    mengdilin authored and facebook-github-bot committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    3614cc7 View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2024

  1. Fix parameter names in docstrings (#3795)

    Summary: Pull Request resolved: #3795
    
    Reviewed By: bshethmeta
    
    Differential Revision: D61817514
    
    Pulled By: junjieqi
    
    fbshipit-source-id: a1b06825b9e4d5a38bd3d800c1e540a8298c80eb
    kit1980 authored and facebook-github-bot committed Aug 27, 2024
    Configuration menu
    Copy the full SHA
    084496a View commit details
    Browse the repository at this point in the history
  2. Adding support for index builder (#3800)

    Summary:
    Pull Request resolved: #3800
    
    In this diff,
    1. codec can be referred both using desc name or remote path in IndexFromCodec
    2. expose serialization of full index through BuildOperator
    3. Rename get_local_filename to get_local_filepath.
    
    Reviewed By: satymish
    
    Differential Revision: D61813717
    
    fbshipit-source-id: ed422751a1d3712565efa87ecf615620799cb8eb
    kuarora authored and facebook-github-bot committed Aug 27, 2024
    Configuration menu
    Copy the full SHA
    37f6b76 View commit details
    Browse the repository at this point in the history
  3. Add standalone Link-Time Optimization option to CMake (#2943)

    Summary:
    Adds `-DFAISS_USE_LTO=ON` option to CMake to enable LTO. LTO increases the linking time, but potentially provides a small boost to the whole library.
    
    Pull Request resolved: #2943
    
    Reviewed By: mengdilin
    
    Differential Revision: D61868553
    
    Pulled By: junjieqi
    
    fbshipit-source-id: f07ade6fdaaa337876f28b9d06bdc5629cc486b0
    alexanderguzhva authored and facebook-github-bot committed Aug 27, 2024
    Configuration menu
    Copy the full SHA
    4283e5b View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2024

  1. Fix bench_fw_codec

    Summary: It was not training even. So, changing default to run training.
    
    Reviewed By: mengdilin
    
    Differential Revision: D61884150
    
    fbshipit-source-id: 182fbff69f223dbf8efb8fbd056279901c311d3a
    kuarora authored and facebook-github-bot committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    145e93d View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2024

  1. Re-order imports in Python tests to avoid crashing (#3806)

    Summary:
    Pull Request resolved: #3806
    
    No explanation for why this works but importing faiss prior to torch causing Python to crash on certain test cases under pytest. This is a temporary workaround with a full RCA required.
    
    Reviewed By: pankajsingh88
    
    Differential Revision: D61956515
    
    fbshipit-source-id: d33992d0b92e87d58ddff1f160990cba487b9927
    ramilbakhshyiev authored and facebook-github-bot committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    a5ad714 View commit details
    Browse the repository at this point in the history
  2. Some small improvements. (#3692)

    Summary:
    A collection of small tweaks that might be needed in the future.
    * Adds another statistics for HNSW called `nhops`, which is a number of different nodes visited through a single query search
    * AVX-512 code for `PQDecoder8`
    * Binary heap utilities for data stored in `std::pair<dis,ids>` format
    * Completely remove `HNSW::upper_beam`
    * AVX-512 code `HNSW::MinimaxHeap::pop_min`
    
    Pull Request resolved: #3692
    
    Test Plan: buck test //faiss/tests/:test_graph_based
    
    Reviewed By: mnorris11
    
    Differential Revision: D61210752
    
    Pulled By: mdouze
    
    fbshipit-source-id: dea78c04a1b30db2885ecb67235de5099b5b3476
    alexanderguzhva authored and facebook-github-bot committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    97e6f48 View commit details
    Browse the repository at this point in the history
  3. Nightly failure fix - ignore searched vectors with identical distances (

    #3809)
    
    Summary:
    Pull Request resolved: #3809
    
    test_IndexIVFRQ is failing nightly GPU w/RAFT builds. These are false positive failures for the edge cases when the distance of a query vector to two candidate vectors is identical. In such cases, the search and search_and_reconstruct return these candidate vectors in a different order (on GPU w/Raft).
    
    Current fix is to ignore the order of such ids with identical distances by sorting on distance and use id as tiebreaker. There is negligible performance implication (5ms extra), given the test candidate size is low.
    
    Reviewed By: mengdilin, ramilbakhshyiev
    
    Differential Revision: D61977915
    
    fbshipit-source-id: 5f7a81c51c91a967013fb5e69e2bfee59be341c7
    pankajsingh88 authored and facebook-github-bot committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    95e0a66 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2024

  1. Use weights_only for load (#3796)

    Summary:
    `torch.load` without `weights_only` parameter is unsafe. Explicitly set `weights_only` to False only if you trust the data you load and full pickle functionality is needed, otherwise set `weights_only=True`.
    
    If `weights_only=True` doesn't work for some cases, then explicit `weights_only=False` should be used.
    
    Found with https://github.com/pytorch-labs/torchfix/
    
    Pull Request resolved: #3796
    
    Reviewed By: asadoughi
    
    Differential Revision: D61824340
    
    Pulled By: kit1980
    
    fbshipit-source-id: bc013d06d4f368f730ffee6898e75fd0b0ff1d40
    kit1980 authored and facebook-github-bot committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    383b5d9 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2024

  1. Fix deprecated use of 0/NULL (#3817)

    Summary:
    Pull Request resolved: #3817
    
    `nullptr` is typesafe. `0` and `NULL` are not. We are interested in enabling `-Wzero-as-null-pointer-constant` for first-party code, and only `nullptr` will be allowed.
    
    Reviewed By: zertosh
    
    Differential Revision: D62083883
    
    fbshipit-source-id: 9f19434ff72faa1444dec72ec182a41398b575fe
    David Tolnay authored and facebook-github-bot committed Sep 1, 2024
    Configuration menu
    Copy the full SHA
    c418b30 View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2024

  1. always upload pytest results (#3808)

    Summary:
    Pull Request resolved: #3808
    
    Previously, we only upload the results when the tests passed. It is useful to also upload results of failing tests for debugging
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D61972433
    
    fbshipit-source-id: 1825e6ebea56279e4d8d8c6480841985c1626674
    mengdilin authored and facebook-github-bot committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    ca1ab78 View commit details
    Browse the repository at this point in the history
  2. Build SVE CI with openblas that was compiled with USE_OPENMP=1 (#3776)

    Summary:
    I noticed by default, conda install openblas installs `libopenblas-pthreads` on our SVE CI. This can be problematic as described in https://github.com/facebookresearch/faiss/wiki/Troubleshooting#surprising-faiss-openmp-and-openblas-interaction
    
    Updating installation of openblas to be more specific and use the version that works well with openmp.
    
    Sees version `0.3.27-openmp_h1b0c31a_0` for openblas instead of `pthread`
    
    Pull Request resolved: #3776
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D61856775
    
    Pulled By: mengdilin
    
    fbshipit-source-id: 950bd68ba438d221b39d25b2d6e185bc61512243
    mengdilin authored and facebook-github-bot committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    5e61450 View commit details
    Browse the repository at this point in the history
  3. create perf_tests directory and onboard all scalar quantizer types to…

    … benchmark (#3824)
    
    Summary:
    Pull Request resolved: #3824
    
    We currently have a 6bit quantizer benchmark running on servicelab during difftime.
    
    This diff creates `faiss/perf_tests` directory which will host all the benchmarks that run as performance regression tests. It generalizes `bench_6bit_codec` to work for all quantizer types.
    
    I am not deleting the existing `bench_6bit_codec` experiments yet because I want to play around with parameters: {num_trials, num_iterations, strobelight_profiling} in the new sets of experiments to see which combinations provide the least amount of noise. For now, these experiments will not run on diffs.
    
    Reviewed By: mnorris11
    
    Differential Revision: D62033843
    
    fbshipit-source-id: d59a67db6c68d8830b1bc8b4d95e2fe8262e8c4d
    mengdilin authored and facebook-github-bot committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    4683cc1 View commit details
    Browse the repository at this point in the history
  4. more refactor and add encode/decode steps to benchmark (#3825)

    Summary:
    Pull Request resolved: #3825
    
    - previously, there is 1 benchmark that measures the reconstruction error and then measures the performance of the distance computation for the scalar quantizer. Split it up into distance benchmark and accuracy benchmark.
    - add performance benchmarks for encode and decode as well
    - refactor the benchmarks to accept `n` and `d` as command line arguments. We run the benchmarks with `n` = 2000 and `d` = 128 to start. Happy to expand it to d=`256` and a higher `n` if we think it's better.
    - refactor the targets file so we can create servicelab experiments based on different parameters
    
    Planning to use the benchmarks here to test my simd refactor changes (and expand the benchmarks when necessary).
    
    Reviewed By: mnorris11
    
    Differential Revision: D62049857
    
    fbshipit-source-id: 7e4cbfe27af6da09616b2e7c82d77480c8ddecd6
    mengdilin authored and facebook-github-bot committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    501a8be View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2024

  1. Prevent reordering of imports by auto formatter to avoid crashes (#3826)

    Summary:
    Pull Request resolved: #3826
    
    Apparently this is the generally accepted way to do this.
    
    https://usort.readthedocs.io/en/stable/guide.html#import-blocks
    
    What do you think?
    
    Reviewed By: kuarora, mengdilin
    
    Differential Revision: D62147522
    
    fbshipit-source-id: b9cf034ff6119595956a3c46e7094a2a8b0cb2cc
    bshethmeta authored and facebook-github-bot committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    d296b2c View commit details
    Browse the repository at this point in the history
  2. remove compile options label from gbench (#3834)

    Summary:
    Pull Request resolved: #3834
    
    Looks like ServiceLab does not handle any metric that is not integer: https://fburl.com/code/chqi5hcr The current experiments are erroring with the message https://fburl.com/servicelab/99s69hbf:
    ```
    ERROR:windtunnel.benchmarks.gbench_benchmark_runner.gbench_benchmark_runner:exception occurred while processing benchmark (this usually means a benchmark is misconfigured) faiss/perf_tests/scalar_quantizer_distance_test1/bench_scalar_quantizer_distance:QT_bf16_128d_2000n/iterations invalid literal for int() with base 10: 'OPTIMIZE AVX2 '
    Traceback (most recent call last):
      File "windtunnel/benchmarks/gbench_benchmark_runner/gbench_benchmark_runner.py", line 116, in parse_gbench_results
        int(entry[metric_name]),
    ValueError: invalid literal for int() with base 10: 'OPTIMIZE AVX2 '
    ```
    
    Removing the label that's causing the failure. We can track the optimization mode via experiment names, or a dummy counter name in the future as I roll out multi-platform experiments.
    
    Reviewed By: junjieqi
    
    Differential Revision: D62166280
    
    fbshipit-source-id: 6de70c945cf5058feb479e6dd501d7e84d08ef83
    mengdilin authored and facebook-github-bot committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    1cafc71 View commit details
    Browse the repository at this point in the history
  3. Add error for overflowing nbits during PQ construction (#3833)

    Summary:
    Pull Request resolved: #3833
    
    size_t expands to unsigned long int, so any left shift more than 31 means ksub overflows. So, we can add a check right before it is constructed in ProductQuantizer.
    
    Ramil talked to Matthijs and the outcome is that 16 bits isn't really practical, but we can do the check for 24 to be safe.
    
    Reviewed By: kuarora, mengdilin
    
    Differential Revision: D62153881
    
    fbshipit-source-id: 721db6bf6ad5dd5d336b4498f4750acc4059310c
    Michael Norris authored and facebook-github-bot committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    a4ebcb1 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2024

  1. Allow search Index without Gt (#3827)

    Summary:
    Pull Request resolved: #3827
    
    There are few fixes in this diff which allows us to execute search on an existing index without needing to compare it with ground truth. This has been currently added to only knn search (not range)
    
    Reviewed By: satymish
    
    Differential Revision: D61825365
    
    fbshipit-source-id: ee1e39260ed3480ed32aeeb8d7232e975f56bbfa
    kuarora authored and facebook-github-bot committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    202a204 View commit details
    Browse the repository at this point in the history
  2. group SWIG tests into one file (#3807)

    Summary:
    Pull Request resolved: #3807
    
    This diff re-organizes the tests a bit:
    
    * groups tests related to SWIG into a single file
    
    * enable doxygen test conditionally
    
    * removes a dep on platform.Version that does not exist on some envs
    
    * move a few tests out of build_blocks to avoid it being a catch-all file for uncategorized tests
    
    Reviewed By: asadoughi
    
    Differential Revision: D61959750
    
    fbshipit-source-id: fb6ada5b5a980ac07088254183d80b80ddfb1f45
    mdouze authored and facebook-github-bot committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    52cf9af View commit details
    Browse the repository at this point in the history
  3. faster hnsw CPU index training (#3822)

    Summary:
    This change decreases the training time for 1M x 768 dataset down to 10 minutes from 13 minutes in our experiments.
    
    Please verify and benchmark.
    
    Pull Request resolved: #3822
    
    Reviewed By: mdouze
    
    Differential Revision: D62151489
    
    Pulled By: kuarora
    
    fbshipit-source-id: b29ffd0db615bd52187464b4665c31fc9d3b8d0a
    alexanderguzhva authored and facebook-github-bot committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    e261725 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2024

  1. Quiet down apt-get on ROCm builds (#3836)

    Summary:
    Pull Request resolved: #3836
    
    This disables verbose output from apt-get and only outputs on errors to make the build output logs more readable.
    
    Reviewed By: junjieqi
    
    Differential Revision: D62278742
    
    fbshipit-source-id: 524490ffd95fc1283f69797c0da57886e68206a6
    ramilbakhshyiev authored and facebook-github-bot committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    18bc38a View commit details
    Browse the repository at this point in the history
  2. Do not unnecessarily install CUDA for ROCm

    Summary: ROCm does not require CUDA, this change stops installing it.
    
    Reviewed By: mengdilin
    
    Differential Revision: D62283602
    
    fbshipit-source-id: 8fd0d770c5bd407b0c7bca7e92d754e05b5083da
    ramilbakhshyiev authored and facebook-github-bot committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    736cd4d View commit details
    Browse the repository at this point in the history
  3. Upgrade to ROCm 6.2 (#3839)

    Summary:
    Pull Request resolved: #3839
    
    This is a prerequisite to fixing issue 3787 and an upgrade to a newer stable version.
    
    Reviewed By: mengdilin
    
    Differential Revision: D62284555
    
    fbshipit-source-id: 946f7757eea36bdddc3f8bb7d8c16168e90fd063
    ramilbakhshyiev authored and facebook-github-bot committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    753833c View commit details
    Browse the repository at this point in the history
  4. Re-enable Query_L2_MMCodeDistance and Query_IP_MMCodeDistance tests f…

    …or ROCm (#3838)
    
    Summary:
    Pull Request resolved: #3838
    
    This fixes 3787 now that we do not install CUDA for ROCm builds.
    
    Reviewed By: mengdilin
    
    Differential Revision: D62283662
    
    fbshipit-source-id: e5c736296b1c6d7b9a6b9f60161ffe3b5cb1c699
    ramilbakhshyiev authored and facebook-github-bot committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    3f41161 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2024

  1. Fix an incorrectly counted the number of computed distances for HNSW (#…

    …3840)
    
    Summary:
    #3819
    
    A definite bug in my code from the past.
    The number of reported distances is higher that the number of distances actually computed.
    
    Pull Request resolved: #3840
    
    Reviewed By: junjieqi
    
    Differential Revision: D62392577
    
    Pulled By: mengdilin
    
    fbshipit-source-id: c4d595849cc95e77eb6cd8d499b3128bbe9a6e13
    alexanderguzhva authored and facebook-github-bot committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    21dfdba View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. Fixing headers as per OSS requirement (#3847)

    Summary:
    Pull Request resolved: #3847
    
    same as title.
    Fixing headers as raised in task - P1558157110
    
    Reviewed By: junjieqi
    
    Differential Revision: D62408917
    
    fbshipit-source-id: 652b55dd2ba9617edeb2b05172be0f42291d7035
    kuarora authored and facebook-github-bot committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    6fe4640 View commit details
    Browse the repository at this point in the history
  2. Allow k and M suffixes in IVF indexes (#3812)

    Summary:
    Pull Request resolved: #3812
    
    Allows factory strings like `IVF3k,Flat` as a shorthand for 3072 centroids.
    
    The main question is whether k or M should be metric (k=1000) or power of 2 (k=1024):
    
    * pro-metric: standard,
    
    * pro-power of 2: in practice we use powers of 2 most often
    
    The suffixes ki and Mi should be used for powers of 2 but this makes the notation more heavy (which is what we wanted to avoid in the first place).
    
    So I picked power of 2.
    
    Reviewed By: mnorris11
    
    Differential Revision: D62019941
    
    fbshipit-source-id: f547962625123ecdfaa406067781c77386017793
    mdouze authored and facebook-github-bot committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    d85fda7 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2024

  1. Adding bucket/path (blobstore) in dataset descriptor (#3848)

    Summary:
    Pull Request resolved: #3848
    
    same as title.
    Dataset can be referred from blobstore
    
    Reviewed By: satymish
    
    Differential Revision: D62476993
    
    fbshipit-source-id: db2b4088ab6e02278b8b91194bf916fc476b79ec
    kuarora authored and facebook-github-bot committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    a166e13 View commit details
    Browse the repository at this point in the history
  2. add hnsw unit test for PR 3840 (#3849)

    Summary:
    Pull Request resolved: #3849
    
    #3845
    
    Add unit tests for helper search utilities for HNSW. These utility functions live inside an anonymous namespace and each has a reference version gated behind a const bool, I refactored them so the reference version is a flag for the function which defaults to false.
    
    If we are concerned about the performance overhead of the extra if branching (whether to use reference version or not) inside these utility functions, I'm happy to lift out the reference versions to their own functions inside the unit test
    
    Reviewed By: junjieqi
    
    Differential Revision: D62510014
    
    fbshipit-source-id: b92ed4db69d125c7830da93946f1c2374fb87b08
    mengdilin authored and facebook-github-bot committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    52ce3f5 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2024

  1. assign_index should default to null (#3855)

    Summary:
    Pull Request resolved: #3855
    
    Laser clients are calling RCQ search with a query size of 1 and the bulk of the overhead came from IndexFlat add/search. With a small query size, using IndexFlatL2 does lots of unnecessary copies to the IndexFlatL2.
    
    By default, we should fall back to https://fburl.com/code/jpt236mz branch unless the client overrides `assign_index` with `assign_index_factory`.
    
    Reviewed By: bshethmeta
    
    Differential Revision: D62644305
    
    fbshipit-source-id: 2434e2b238968304dc5b346637f8ca956e6bd548
    mengdilin authored and facebook-github-bot committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    dbdd63b View commit details
    Browse the repository at this point in the history
  2. Add a dockerfile for development (#3851)

    Summary:
    It turns out to be very useful for testing faiss compilation in a fresh environment
    
    Pull Request resolved: #3851
    
    Reviewed By: junjieqi
    
    Differential Revision: D62655137
    
    Pulled By: mengdilin
    
    fbshipit-source-id: c1c2591e26bd20fb3783d3661a4096eaf31c4c08
    alexanderguzhva authored and facebook-github-bot committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    d104275 View commit details
    Browse the repository at this point in the history
  3. add hnsw flat benchmark (#3857)

    Summary:
    Pull Request resolved: #3857
    
    add benchmarking for hnsw flat. ServiceLab requires us to register our python benchmarks with their custom python function in order to export the metrics correctly. I decided to split servicelab custom code inside `faiss/perf_tests/servicelab` folder as to not expose it to open source and the actual benchmarking logic for `hnsw` lives in `faiss/perf_tests/bench_hnsw.py` which will be exposed to open source
    
    Reviewed By: kuarora
    
    Differential Revision: D62316706
    
    fbshipit-source-id: 6f88ed70ae78fa309a347371645fb012e25b55da
    mengdilin authored and facebook-github-bot committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    dc55e11 View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2024

  1. Fix several typos in code detected by lintian (#3861)

    Summary:
    All typos are not names of public APIs, thus safe to fix.
    
    Closes #3859
    
    Pull Request resolved: #3861
    
    Reviewed By: asadoughi
    
    Differential Revision: D62717144
    
    Pulled By: junjieqi
    
    fbshipit-source-id: 647de83ac5d6dba713031c2fc8af7b3f4d84f1d3
    Harry-Chen authored and facebook-github-bot committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    8a9e600 View commit details
    Browse the repository at this point in the history
  2. add benchmarking for hnsw flat based on efSearch (#3858)

    Summary:
    Pull Request resolved: #3858
    
    Stealing from Alexander's hnsw benchmark where he tuned the efSearch parameter and search_bounded_queue in https://fburl.com/code/keovfhxk
    
    Reviewed By: asadoughi
    
    Differential Revision: D62652021
    
    fbshipit-source-id: c9324718781ab171f1be86e7310717c9bcf4c563
    mengdilin authored and facebook-github-bot committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    f67f518 View commit details
    Browse the repository at this point in the history
  3. Add explicit instanciations of search_dispatch_implem (#3860)

    Summary:
    Since commit 32f0e8c (#3190) faiss fails to build on gcc7.
    
    For some reason gcc7 needs these explicit instanciations (or rather, for some reason later versions are OK without them). This commit partially revers that commit, adding back the explicit instanciations.
    
    Pull Request resolved: #3860
    
    Reviewed By: mengdilin
    
    Differential Revision: D62762224
    
    Pulled By: mnorris11
    
    fbshipit-source-id: 938d5bc1917ef947847b1d8fcc3e40cea52e8367
    JAicewizard authored and facebook-github-bot committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    6da9952 View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2024

  1. Adding Documentation for ROCm (#3856)

    Summary:
    Adding documentation for ROCm in README.md and INSTALL.md
    
    Pull Request resolved: #3856
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D62774430
    
    Pulled By: mnorris11
    
    fbshipit-source-id: c5692be5bb6d5a6876ad168edf1855ed8ccfd26b
    ItsPitt authored and facebook-github-bot committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    b6024e9 View commit details
    Browse the repository at this point in the history
  2. RCQ search microbenchmark (#3863)

    Summary:
    Pull Request resolved: #3863
    
    add RCQ search microbenchmark with parameters similar to the ones provided by ivansopin in D62529163
    
    Reviewed By: asadoughi
    
    Differential Revision: D62769834
    
    fbshipit-source-id: 457ce901e77d1665bc1b2ef4166f4ee5b676e52a
    mengdilin authored and facebook-github-bot committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    83d0599 View commit details
    Browse the repository at this point in the history
  3. simplify and refactor create_servicelab_experiment utility (#3867)

    Summary:
    Pull Request resolved: #3867
    
    `create_servicelab_experiment`'s metrics' key calculation and benchmarks were specific to scalar quantizer. Refactor it so we can reuse the same utility for RCQ. Fix the previous naming suggestion for the position of `_profile` in the experiment name as well
    
    Reviewed By: junjieqi
    
    Differential Revision: D62770846
    
    fbshipit-source-id: 52422138df6f32ca8f2319369cb9f6675e8b3bdf
    mengdilin authored and facebook-github-bot committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    73a41f1 View commit details
    Browse the repository at this point in the history
  4. more telemetry classes (#3854)

    Summary:
    Pull Request resolved: #3854
    
    We need some more functions exposed for use in telemetry wrapper classes. This PR changes some functions in read_index to be non static and exposes them in the header. (Laser can also write IndexIVFPQ and IndexIVFScalarQuantizer, so those are added to read_index).
    
    Reviewed By: asadoughi
    
    Differential Revision: D62623242
    
    fbshipit-source-id: 5b29d986570d4439d066b1815d15a21b45e90482
    Michael Norris authored and facebook-github-bot committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    fa60ae6 View commit details
    Browse the repository at this point in the history
  5. FIx a bug for a non-simdlib code of ResidualQuantizer (#3868)

    Summary:
    This causes an access violation error.
    
    The reason why this was not caught in unit tests for AVX/NEON is that this code branch is unlikely to be used.
    
    The reason why this was not caught in unit tests for a plain non-SIMD binary is unclear.
    
    More ResidualQuantizer patches to follow.
    
    Pull Request resolved: #3868
    
    Reviewed By: mengdilin
    
    Differential Revision: D62882531
    
    Pulled By: mnorris11
    
    fbshipit-source-id: fc50c7409d6064605f783c342b0d313145ffe948
    alexanderguzhva authored and facebook-github-bot committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    317bd00 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2024

  1. Introduce QuantizerTemplateScaling for SQ (#3870)

    Summary:
    replace
    ``` C++
    template <class Codec, bool uniform, int SIMD>
    struct QuantizerTemplate {};
    ```
    
    with
    ``` C++
    enum class QuantizerTemplateScaling { UNIFORM = 0, NON_UNIFORM = 1 };
    
    template <class Codec, QuantizerTemplateScaling SCALING, int SIMD>
    struct QuantizerTemplate {};
    ```
    
    This allows adding more Scalar Quantizer scaling types (such as rowwise or rowwise + non-uniform) in the future.
    
    Pull Request resolved: #3870
    
    Reviewed By: mengdilin
    
    Differential Revision: D63033311
    
    Pulled By: mnorris11
    
    fbshipit-source-id: f62b3dcdf446251229a863fdd9aa5e00d9b02c07
    alexanderguzhva authored and facebook-github-bot committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    4e30901 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2024

  1. rewrite python kmeans without scipy (#3873)

    Summary:
    Pull Request resolved: #3873
    
    The previous version required scipy to do the accumulation, which is replaced here with a nifty piece of numpy accumulation.
    This removes the need for scipy for non-sparse data.
    
    Reviewed By: junjieqi
    
    Differential Revision: D62884307
    
    fbshipit-source-id: 5443634e487387a2b518fd2a7f9a3d9a40abd4b4
    mdouze authored and facebook-github-bot committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    0d7817e View commit details
    Browse the repository at this point in the history
  2. begin torch_contrib (#3872)

    Summary:
    Pull Request resolved: #3872
    
    The contrib.torch subdirectory is intended to receive modules in python that are useful for similarity search and that apply to CPU or GPU pytorch tensors.
    
    The current version includes CPU clustering on torch tensors. To be added:
    * implementation of PQ
    
    Reviewed By: asadoughi
    
    Differential Revision: D62759207
    
    fbshipit-source-id: 87dbaa5083e3f2f4f60526815e22ded4e83e8559
    mdouze authored and facebook-github-bot committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    6baebe2 View commit details
    Browse the repository at this point in the history
  3. torch.distributed kmeans (#3876)

    Summary:
    Pull Request resolved: #3876
    
    Demo script for distributed kmeans. It provides a `DatasetAssign` object and shows how to run it with torch.distributed.
    
    Reviewed By: asadoughi, pankajsingh88
    
    Differential Revision: D63013820
    
    fbshipit-source-id: 22c959f3afdc04fd4aa8b9aeed309ea6290b1328
    mdouze authored and facebook-github-bot committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    838612c View commit details
    Browse the repository at this point in the history
  4. Add AVX-512 implementation for the distance and scalar quantizer func…

    …tions. (#3853)
    
    Summary:
    The distance and scalar quantizer functions currently have AVX2 implementations. This patch adds the AVX-512 equivalents for each of the AVX2 implementations.
    
    While preparing to push this PR, I realized that you have already implemented the AVX-512 equivalent for [HNSW::MinimaxHeap::pop_min](https://github.com/facebookresearch/faiss/blob/a166e13a25b2a5fe46adce4d7d06677d5199e598/faiss/impl/HNSW.cpp#L1176-L1265), which is great.
    
    Pull Request resolved: #3853
    
    Test Plan:
    Imported from GitHub, without a `Test Plan:` line.
    
    Top of the stack D62993711 is green
    
    Reviewed By: asadoughi
    
    Differential Revision: D62989543
    
    Pulled By: mengdilin
    
    fbshipit-source-id: 913403fadbfc512d195fe3411ee761d8ad025245
    mulugetam authored and facebook-github-bot committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    4eecd91 View commit details
    Browse the repository at this point in the history
  5. fix open source CI (#3878)

    Summary:
    Pull Request resolved: #3878
    
    Looks like D63013820 broke external CI (example failures: https://github.com/facebookresearch/faiss/actions/runs/10965502942/job/30451466102 and https://github.com/facebookresearch/faiss/actions/runs/10964917863 )
    
    with stacktrace
    ```
    Traceback (most recent call last):
      File "/home/runner/work/faiss/faiss/build/faiss/python/setup.py", line 16, in <module>
        shutil.copytree("contrib/torch", "faiss/contrib/torch")
      File "/home/runner/miniconda3/lib/python3.11/shutil.py", line 573, in copytree
        return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/miniconda3/lib/python3.11/shutil.py", line 471, in _copytree
        os.makedirs(dst, exist_ok=dirs_exist_ok)
      File "<frozen os>", line 225, in makedirs
    FileExistsError: [Errno 17] File exists: 'faiss/contrib/torch'
    ```
    
    `faiss/contrib/torch'` should be copied over from the line above `faiss/contrib`
    
    Reviewed By: asadoughi
    
    Differential Revision: D63145404
    
    fbshipit-source-id: 0c2df0b3a912aeb48671ca0213a1ea4dd8b44510
    mengdilin authored and facebook-github-bot committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    03f1d2a View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2024

  1. Fix CI 2.0: Compile SQ for avx512 (#3880)

    Summary:
    #3870 conflicted with changes in #3853 Rebasing D62989543 for PR 3853 internally did not catch the breakage since we don't have avx512 coverage internally unfortunately :(
    
    === Test Plan ===
    Tested on a local machine and compilation and C++ tests worked
    CI for AVX512 and conda build should succeed
    
    Pull Request resolved: #3880
    
    Reviewed By: junjieqi
    
    Differential Revision: D63156374
    
    Pulled By: mengdilin
    
    fbshipit-source-id: 4bf51b2e7795bb55d388a31c79bded742f87d6e9
    mengdilin authored and facebook-github-bot committed Sep 21, 2024
    Configuration menu
    Copy the full SHA
    1f42e81 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2024

  1. Add reverse factory string util, add StringIOReader, add centralized …

    …JK (#3879)
    
    Summary:
    Pull Request resolved: #3879
    
    1. Adds JK `faiss/telemetry:use_faiss_telemetry_core` to the top level logging util in `wrapper_logging_utils.h`. This is currently set to false. I plan to deprecate the other knobs under https://www.internalfb.com/intern/justknobs/?name=faiss%2Ftelemetry and just use one, as Unicorn can't really have their own JK easily (they subclass a lot of FAISS classes too).
    2. Copied StringIOReader from Unicorn to telemetry wrapper in `io.h`. This will be deleted from Unicorn in the follow up diff.
    3. Updated Laser tests to reflect correct index_read factory string changes.
    4. Adds reverse_index_factory. More tests for it in subsequent diff.
    
    Reviewed By: junjieqi
    
    Differential Revision: D62670316
    
    fbshipit-source-id: de1b2ed385593bb43798d29d16d90407920a3251
    Michael Norris authored and facebook-github-bot committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    0660b23 View commit details
    Browse the repository at this point in the history
  2. Add performance regression tests (#3793)

    Summary:
    Add `CMakeList` compile `faiss/perf_tests` benchmarks. We will run the google benchmarks as part of CI so people can see benchmarking results (there is no diff-to-diff regression detection in open-sourced CI)
    
    ==== Test Plan =====
    
    Sees logs in CI that looks like
    ```
    Run on (4 X 3184.9 MHz CPU s)
    CPU Caches:
      L1 Data 32 KiB (x2)
      L1 Instruction 32 KiB (x2)
      L2 Unified 512 KiB (x2)
      L3 Unified 32768 KiB (x1)
    Load Average: 2.69, 2.84, 1.56
    ----------------------------------------------------------------------------------------------
    Benchmark                                    Time             CPU   Iterations UserCounters...
    ----------------------------------------------------------------------------------------------
    QT_4bit/iterations:20                 53646755 ns     53643729 ns           20 code_size=1k
    QT_4bit_uniform/iterations:20         52248603 ns     52246874 ns           20 code_size=1k
    QT_6bit/iterations:20                 63697930 ns     63693459 ns           20 code_size=1.5k
    QT_8bit/iterations:20                 43305175 ns     43303946 ns           20 code_size=2k
    QT_8bit_direct/iterations:20          30771920 ns     30770261 ns           20 code_size=2k
    QT_8bit_direct_signed/iterations:20   30744625 ns     30742891 ns           20 code_size=2k
    QT_8bit_uniform/iterations:20         44227773 ns     44224242 ns           20 code_size=2k
    QT_bf16/iterations:20                 32758794 ns     32758717 ns           20 code_size=4k
    QT_fp16/iterations:20                 41068848 ns     41066492 ns           20 code_size=4k
    2024-09-20T23:15:01+00:00
    Running ./build/perf_tests/bench_scalar_quantizer_decode
    Run on (4 X 3244.56 MHz CPU s)
    CPU Caches:
      L1 Data 32 KiB (x2)
      L1 Instruction 32 KiB (x2)
      L2 Unified 512 KiB (x2)
      L3 Unified 32768 KiB (x1)
    Load Average: 2.43, 2.78, 1.56
    ----------------------------------------------------------------------------------------------
    Benchmark                                    Time             CPU   Iterations UserCounters...
    ----------------------------------------------------------------------------------------------
    QT_4bit/iterations:20                   338300 ns       338284 ns           20 code_size=64
    QT_4bit_uniform/iterations:20           332928 ns       332914 ns           20 code_size=64
    QT_6bit/iterations:20                   4[1568](https://github.com/facebookresearch/faiss/actions/runs/10966335129/job/30454475438?pr=3878#step:3:1585)3 ns       415674 ns           20 code_size=96
    QT_8bit/iterations:20                   266034 ns       266026 ns           20 code_size=128
    QT_8bit_direct/iterations:20             37552 ns        37553 ns           20 code_size=128
    QT_8bit_direct_signed/iterations:20      39701 ns        39696 ns           20 code_size=128
    QT_8bit_uniform/iterations:20           261535 ns       261529 ns           20 code_size=128
    QT_bf16/iterations:20                    45518 ns        45506 ns           20 code_size=256
    QT_fp16/iterations:20                   334602 ns       334584 ns           20 code_size=256
    2024-09-20T23:15:02+00:00
    Running ./build/perf_tests/bench_no_multithreading_rcq_search
    Run on (4 X 3243.03 MHz CPU s)
    CPU Caches:
      L1 Data 32 KiB (x2)
      L1 Instruction 32 KiB (x2)
      L2 Unified 512 KiB (x2)
      L3 Unified 32768 KiB (x1)
    Load Average: 2.43, 2.78, 1.56
    WARNING clustering 65536 points to 65536 centroids: please provide at least 2555904 training points
    WARNING clustering 65536 points to 65536 centroids: please provide at least 2555904 training points
    WARNING clustering 65536 points to 65536 centroids: please provide at least 2555904 training points
    WARNING clustering 65536 points to 65536 centroids: please provide at least 2555904 training points
    WARNING clustering 65536 points to 65536 centroids: please provide at least 2555904 training points
    WARNING clustering 65536 points to 65536 centroids: please provide at least 2555904 training points
    WARNING clustering 65536 points to 65536 centroids: please provide at least 2555904 training points
    WARNING clustering 65536 points to 65536 centroids: please provide at least 2555904 training points
    WARNING clustering 65536 points to 65536 centroids: please provide at least 2555904 training points
    WARNING clustering 65536 points to 65536 centroids: please provide at least 2555904 training points
    ---------------------------------------------------------------
    Benchmark                     Time             CPU   Iterations
    ---------------------------------------------------------------
    search/iterations:20   12763792 ns     10367188 ns           20
    2024-09-20T23:15:51+00:00
    Running ./build/perf_tests/bench_scalar_quantizer_accuracy
    Run on (4 X 3231.04 MHz CPU s)
    CPU Caches:
      L1 Data 32 KiB (x2)
      L1 Instruction 32 KiB (x2)
      L2 Unified 512 KiB (x2)
      L3 Unified 32768 KiB (x1)
    Load Average: 2.85, 2.84, 1.65
    ----------------------------------------------------------------------------------------------
    Benchmark                                    Time             CPU   Iterations UserCounters...
    ----------------------------------------------------------------------------------------------
    QT_4bit/iterations:20                    0.000 ns        0.000 ns            0 code_size=64 code_size_two=128k ndiff_for_idempotence=0 sql2_recons_error=0.047396
    QT_4bit_uniform/iterations:20            0.000 ns        0.000 ns            0 code_size=64 code_size_two=128k ndiff_for_idempotence=0 sql2_recons_error=0.0473931
    QT_6bit/iterations:20                    0.000 ns        0.000 ns            0 code_size=96 code_size_two=192k ndiff_for_idempotence=0 sql2_recons_error=2.6899m
    QT_8bit/iterations:20                    0.000 ns        0.000 ns            0 code_size=128 code_size_two=256k ndiff_for_idempotence=0 sql2_recons_error=164.317u
    QT_8bit_direct/iterations:20             0.000 ns        0.000 ns            0 code_size=128 code_size_two=256k ndiff_for_idempotence=0 sql2_recons_error=42.5514
    QT_8bit_direct_signed/iterations:20      0.000 ns        0.000 ns            0 code_size=128 code_size_two=256k ndiff_for_idempotence=0 sql2_recons_error=42.5494
    QT_8bit_uniform/iterations:20            0.000 ns        0.000 ns            0 code_size=128 code_size_two=256k ndiff_for_idempotence=0 sql2_recons_error=164.152u
    QT_bf16/iterations:20                    0.000 ns        0.000 ns            0 code_size=256 code_size_two=512k ndiff_for_idempotence=0 sql2_recons_error=92.8328u
    QT_fp16/iterations:20                    0.000 ns        0.000 ns            0 code_size=256 code_size_two=512k ndiff_for_idempotence=0 sql2_recons_error=1.44838u
    2024-09-20T23:15:51+00:00
    Running ./build/perf_tests/bench_scalar_quantizer_encode
    Run on (4 X 3243.72 MHz CPU s)
    CPU Caches:
      L1 Data 32 KiB (x2)
      L1 Instruction 32 KiB (x2)
      L2 Unified 512 KiB (x2)
      L3 Unified 32768 KiB (x1)
    Load Average: 2.85, 2.84, 1.65
    ----------------------------------------------------------------------------------------------
    Benchmark                                    Time             CPU   Iterations UserCounters...
    ----------------------------------------------------------------------------------------------
    QT_4bit/iterations:20                   702046 ns       701319 ns           20 code_size=64
    QT_4bit_uniform/iterations:20           595889 ns       595880 ns           20 code_size=64
    QT_6bit/iterations:20                  1287503 ns      1287542 ns           20 code_size=96
    QT_8bit/iterations:20                   511811 ns       511804 ns           20 code_size=128
    QT_8bit_direct/iterations:20            152977 ns       152970 ns           20 code_size=128
    QT_8bit_direct_signed/iterations:20     185578 ns       185572 ns           20 code_size=128
    QT_8bit_uniform/iterations:20           454412 ns       454408 ns           20 code_size=128
    QT_bf16/iterations:20                    51331 ns        51324 ns           20 code_size=256
    QT_fp16/iterations:20                   390658 ns       390649 ns           20 code_size=256
    ```
    
    Pull Request resolved: #3793
    
    Reviewed By: junjieqi
    
    Differential Revision: D63147599
    
    Pulled By: mengdilin
    
    fbshipit-source-id: 03165b5acb3b0647a69f7db144ab76efda2fee11
    mengdilin authored and facebook-github-bot committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    149c1f4 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2024

  1. Re-sync with internal repository (#3885)

    The internal and external repositories are out of sync. This Pull Request attempts to brings them back in sync by patching the GitHub repository. Please carefully review this patch. You must disable ShipIt for your project in order to merge this pull request. DO NOT IMPORT this pull request. Instead, merge it directly on GitHub using the MERGE BUTTON. Re-enable ShipIt after merging.
    facebook-github-bot authored Sep 24, 2024
    Configuration menu
    Copy the full SHA
    c8d1474 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2024

  1. Changing dependency for bench_fw to *_cpu instead of *_gpu (#3889)

    Summary:
    Pull Request resolved: #3889
    
    1.Changing dependency for bench_fw to *_cpu instead of *_gpu
     - faiss_gpu and torch get incompatible. Once, that is fixed, I'll add gpu dependency back.
    - today, we are not using gpu in benchmarking yet.
    
    2.Fixing some naming issue in kmeans which is used when using opaque as false in assemble.
    3.codec_name when it is not assigned explicitly, it happens when using assembly
    
    Reviewed By: satymish
    
    Differential Revision: D62671870
    
    fbshipit-source-id: 4a4ecfeef948c99fffba407cbf69d2349544bdfd
    kuarora authored and facebook-github-bot committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    d8aec60 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2024

  1. Disable the NEON optimisations on gcc <= 8 (#3869)

    Summary:
    GCC7 doesnt support all the necessary NEON intrinsics, which is really a shame. However this means that for aarch64 GCC cannot compile faiss with neon intrinsics, so we should avoid using them.
    
    This is similar to #3860, build issues on GCC7, which I need. This one is a bit uglier, since GCC7 does support NEON just not all of the intrinsics.
    
    Pull Request resolved: #3869
    
    Reviewed By: asadoughi
    
    Differential Revision: D63081962
    
    Pulled By: junjieqi
    
    fbshipit-source-id: 69827cd447dd405b3ef70d651996f9ad00b6213e
    JAicewizard authored and facebook-github-bot committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    1ee7561 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2024

  1. Update INSTALL.md to ensure AVX2 and AV512 support for python package (

    …#3892)
    
    Summary:
    Following the current documentation creates the python package without AVX2 or AV512 support. Updated documentation notes that corresponding faiss version must be built before swigfaiss.
    
    fixes #3883
    
    Pull Request resolved: #3892
    
    Reviewed By: mengdilin
    
    Differential Revision: D63641111
    
    Pulled By: asadoughi
    
    fbshipit-source-id: 2f0598ead8cc5b82ed34841c185e6d2a1d068ba5
    lranon1 authored and facebook-github-bot committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    09bffd2 View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2024

  1. clean up hnsw benchmark (#3901)

    Summary:
    Pull Request resolved: #3901
    
    1) remove system time from benchmark as this metric has extremely high jitter (50-100%) and is not useful for us
    
    2) clean up command-line arguments and define a main function the external world can call
    
    3) tweak default so microbenchmark runs fast by default (this does not the parameters we pass to microbenchmarks for servicelab)
    
    Reviewed By: mnorris11
    
    Differential Revision: D63650110
    
    fbshipit-source-id: efc81563291f00701a0d1df1d27172adeb3ef231
    mengdilin authored and facebook-github-bot committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    0df5d24 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2024

  1. Increment next release, v1.9.0 (#3887)

    Summary: Pull Request resolved: #3887
    
    Reviewed By: kuarora
    
    Differential Revision: D63355030
    
    Pulled By: asadoughi
    
    fbshipit-source-id: 38792e49fe678c2811896faca7a3ddcab19f8bd0
    asadoughi authored and facebook-github-bot committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    caa3b34 View commit details
    Browse the repository at this point in the history
  2. Small nits and formatting (#3907)

    Summary:
    Pull Request resolved: #3907
    
    same as title.
    Fix checking right desc
    
    Reviewed By: satymish
    
    Differential Revision: D63854967
    
    fbshipit-source-id: b8bc48662bc38ac96cf9241bdbe2be2b23f1a37e
    kuarora authored and facebook-github-bot committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    d2692b8 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2024

  1. Update Pinned RAFT version (#3921)

    Summary: Pull Request resolved: #3921
    
    Reviewed By: pankajsingh88
    
    Differential Revision: D64005877
    
    Pulled By: ramilbakhshyiev
    
    fbshipit-source-id: 663c7ab752db04751c7675095d2545adec4be173
    tarang-jain authored and facebook-github-bot committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    ab59374 View commit details
    Browse the repository at this point in the history
  2. Fix package upload for main releases (#3910)

    Summary:
    Similar to .github/workflows/nightly.yml
    
    Pull Request resolved: #3910
    
    Reviewed By: kuarora, pankajsingh88
    
    Differential Revision: D63923478
    
    Pulled By: asadoughi
    
    fbshipit-source-id: df92a86ba48aa0d19aae40d7ca11aeedf4dfac51
    asadoughi authored and facebook-github-bot committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    092e2cd View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2024

  1. fix hnsw unit test in opt mode (#3919)

    Summary:
    Pull Request resolved: #3919
    
    These tests are passing successfully in `dev` mode during my local development when I added them but I recently noticed they are failing on contbuild which is running them in opt/mode: https://www.internalfb.com/intern/test/281475152762853/
    
    Upon further inspection, 2 of these were from floating point comparisons which we can fix with `EXPECT_NEAR`. The another one stems from indeterminism of the results in opt mode, so we will relax the test until we figure out a way to deal with the indeterminism
    
    Reviewed By: junjieqi
    
    Differential Revision: D63942329
    
    fbshipit-source-id: 60f1c0b8a0db93015cd32bf991ab983ff2d1af13
    mengdilin authored and facebook-github-bot committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    be4fc8e View commit details
    Browse the repository at this point in the history
  2. Support search_preassigned in torch (#3916)

    Summary:
    Pull Request resolved: #3916
    
    Adding missing wrapper to the torch wrappers in Faiss + test it.
    
    Also factorized a  bit of code between search functions.
    
    Reviewed By: algoriddle
    
    Differential Revision: D63974821
    
    fbshipit-source-id: a0415a57a763e2d1896956c503e503615c167860
    mdouze authored and facebook-github-bot committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    2e6551f View commit details
    Browse the repository at this point in the history
  3. FIX SVE CI latency regression (#3918)

    Summary:
    Sometimes between Sept 25 to Oct 2, downloading and linking against `openblas=*=*openmp*` package to run tests have caused a 4-7x slow down. Link it with the regular openblas package which is not compiled with `USE_OPENMP=1`. We will set the openblas omp threads via the environment variable `OPENBLAS_NUM_THREADS` according to https://github.com/OpenMathLib/OpenBLAS/wiki/Faq#multi-threaded
    
    Pull Request resolved: #3918
    
    Test Plan: SVE CI should finish within 40 minutes
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D64059860
    
    Pulled By: mengdilin
    
    fbshipit-source-id: 3ba2bda5fce5122f051421f459692f15ad5360a4
    mengdilin authored and facebook-github-bot committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    c5aed7c View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2024

  1. 3893 - Fix index factory order of idmap and refinement (#3928)

    Summary:
    Pull Request resolved: #3928
    
    Fix issue in T203425107
    
    Reviewed By: asadoughi
    
    Differential Revision: D64068971
    
    fbshipit-source-id: 56db439793539570a102773ff2c7158d48feb7a9
    gtwang01 authored and facebook-github-bot committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    af70c5b View commit details
    Browse the repository at this point in the history
  2. Updated conda CI label from staging to main, INSTALL.md (#3929)

    Summary:
    * Replaced 1.8.0 to 1.9.0.
    * Fixed x86-64 architecture reference: https://en.wikipedia.org/wiki/X86-64
    
    Tested with: `conda install -c pytorch/label/staging faiss-cpu`
    
    Pull Request resolved: #3929
    
    Reviewed By: ramilbakhshyiev
    
    Differential Revision: D64082430
    
    Pulled By: asadoughi
    
    fbshipit-source-id: 8a1427a7c14b8c3de4a341533b138d9d8f8490f2
    asadoughi authored and facebook-github-bot committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    d243e62 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2024

  1. Move train, build and search to their respective operators (#3934)

    Summary:
    Pull Request resolved: #3934
    
    Initial thought was to be able to call individual operations on execution operator but it make sense to keep single interface 'execute' and move all these implementations to respective operators.
    
    Reviewed By: satymish
    
    Differential Revision: D63290104
    
    fbshipit-source-id: d1f0b1391c38552c5cdb0a8ea935e23d0d0cb75b
    kuarora authored and facebook-github-bot committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    61eaf19 View commit details
    Browse the repository at this point in the history
  2. Add desc_name to dataset descriptor (#3935)

    Summary:
    Pull Request resolved: #3935
    
    same as title
    
    Reviewed By: satymish
    
    Differential Revision: D64144800
    
    fbshipit-source-id: 4a298aa83315d82f44ee424bf0a30737d5bf48a4
    kuarora authored and facebook-github-bot committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    07a345c View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2024

  1. implement ST_norm_from_LUT for the ResidualQuantizer (#3917)

    Summary:
    Pull Request resolved: #3917
    
    The norm computation ST_norm_from_LUT was not implemented in Faiss. See issue
    
    #3882
    
    This diff adds an implementation for it. It is probably not very quick. A few precomputed tables for AdditiveQuantizer were moved form ResidualQuantizer.
    
    Reviewed By: asadoughi
    
    Differential Revision: D63975689
    
    fbshipit-source-id: 1bbe497a66bb3891ae727a1cd2b719479f80a836
    mdouze authored and facebook-github-bot committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    a99dbcd View commit details
    Browse the repository at this point in the history
  2. Add example of how to build, link, and test an external SWIG module (#…

    …3922)
    
    Summary:
    Pull Request resolved: #3922
    
    We need to be able to build external modules into FAISS, but don't have an example yet. This diff shows what CMakeLists.txt changes need to happen to incorporate an external module.
    
    Reference: #3699
    
    Reviewed By: mdouze
    
    Differential Revision: D63991471
    
    fbshipit-source-id: 0c1cd25eabbffb01d2a7170d6725a0c4a13c5bf0
    Michael Norris authored and facebook-github-bot committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    847cde8 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2024

  1. PQFS into Index trainer (#3941)

    Summary:
    Pull Request resolved: #3941
    
    Support PQFS with index trainer
    
    Reviewed By: kuarora
    
    Differential Revision: D64259953
    
    fbshipit-source-id: fd7ed90aed2ff6b6351460dcf7b61058c59cd25b
    gtwang01 authored and facebook-github-bot committed Oct 12, 2024
    Configuration menu
    Copy the full SHA
    6441b56 View commit details
    Browse the repository at this point in the history
  2. Fix total_rows (#3942)

    Summary:
    Pull Request resolved: #3942
    
    Reverted splitting of partition string to align with previous behavior of finding partition intersection rather than the union.
    Also changed util dependency from laser to vector_search, which makes more sense.
    
    Reviewed By: kuarora
    
    Differential Revision: D64274531
    
    fbshipit-source-id: 4614ae42d0fb534c9c9ce3314fd3c26a0c74d049
    gtwang01 authored and facebook-github-bot committed Oct 12, 2024
    Configuration menu
    Copy the full SHA
    3daf48c View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2024

  1. Place a useful cmake function 'link_to_faiss_lib' into a separate file (

    #3939)
    
    Summary:
    Add `cmake/link_to_faiss_lib.cmake`, which exposes a useful and reusable CMake `link_to_faiss_lib()` function
    
    Pull Request resolved: #3939
    
    Reviewed By: mnorris11
    
    Differential Revision: D64250261
    
    Pulled By: mengdilin
    
    fbshipit-source-id: bab5b7fab8effb33cb73024eb7eefd2319998e5b
    alexanderguzhva authored and facebook-github-bot committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    4d78137 View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2024

  1. Fix INSTALL.md due to failure of conflict resolving (#3915)

    Summary:
    #2943 had removed about SVE information (added on #2886 ) on the installation document. This PR fixes it.
    
    This PR changes only the document, so it doesn't affect software behavior.
    
    Pull Request resolved: #3915
    
    Reviewed By: asadoughi
    
    Differential Revision: D63967842
    
    Pulled By: ramilbakhshyiev
    
    fbshipit-source-id: ce0a0bfe591cb75b504cdf6362b5e8ed156928d5
    vorj authored and facebook-github-bot committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    e017c35 View commit details
    Browse the repository at this point in the history
  2. add copyright header (#3948)

    Summary:
    Pull Request resolved: #3948
    
    I noticed this file I added was violating the header check. https://www.internalfb.com/intern/opensource/github/repo/1812028399049977/checkup/
    
    Reviewed By: asadoughi
    
    Differential Revision: D64341054
    
    fbshipit-source-id: 4564191661acbff193c8ffe970582cef8fb3a490
    Michael Norris authored and facebook-github-bot committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    1ab7e5c View commit details
    Browse the repository at this point in the history
  3. Add some SVE implementations (#3933)

    Summary:
    related: #2884
    
    I added some SVE implementations of:
    
    - `code_distance`
        - `distance_single_code`
        - `distance_four_codes`
    - `exhaustive_L2sqr_blas_cmax_sve`
    - `fvec_inner_products_ny`
    - `fvec_madd`
    
    ## Evaluation result
    
    I evaluated the search for SIFT1M dataset on AWS EC2 c7g.large and r8g.large instances.
    `main` is the current (2e6551f) implementation.
    
    ### c7g.large (Graviton 3)
    
    ![g3_sift1m](https://github.com/user-attachments/assets/9c03cffa-72d1-4c77-9ae8-0ec0a5f5a6a5)
    
    ![g3_ivfpq](https://github.com/user-attachments/assets/4a8dfcc8-823c-4c31-ae79-3f4af9be28c8)
    
    On Graviton 3, `IndexIVFPQ` has been improved particularly. In the best case (IndexIVFPQ + IndexFlatL2, M: 32), this PR is approx. 2.38-~~2.50~~**2.44**x faster than `main` .
    
    - nprobe: 1, 0.069ms/query → 0.029ms/query
    - nprobe: 4, 0.181ms/query → ~~0.074~~**0.075**ms/query
    - nprobe: 16, 0.613ms/query → ~~0.245~~**0.251**ms/query
    
    ### r8g.large (Graviton 4)
    
    ![g4_sift1m](https://github.com/user-attachments/assets/e8510163-49d2-4143-babe-d406e2e40398)
    
    ![g4_ivfpq](https://github.com/user-attachments/assets/dc9a3ae0-a6b5-4a07-9898-c6aff372025c)
    
    On Graviton 4, especially `IndexIVFPQ` for tiny `nprobe` has been improved. In the best case (IndexIVFPQ + IndexFlatL2, M: 8, nprobe: 1), this PR is approx. 1.33x faster than `main` (0.016ms/query → 0.012ms/query).
    
    Pull Request resolved: #3933
    
    Reviewed By: mengdilin
    
    Differential Revision: D64249808
    
    Pulled By: asadoughi
    
    fbshipit-source-id: 8a625f0ab37732d330192599c851f864350885c4
    vorj authored and facebook-github-bot committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    dce7c09 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2024

  1. Back out "Add example of how to build, link, and test an external SWI…

    …G module" (#3954)
    
    Summary:
    Pull Request resolved: #3954
    
    Original commit changeset: 0c1cd25eabbf
    
    Original Phabricator Diff: D63991471
    
    Reviewed By: mengdilin, asadoughi
    
    Differential Revision: D64439886
    
    fbshipit-source-id: cc90958f6d90a429a4eece8e1cd1322b20d9aceb
    Michael Norris authored and facebook-github-bot committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    cb1a512 View commit details
    Browse the repository at this point in the history
  2. Fix shadowed variable in faiss/IndexPQ.cpp (#3959)

    Summary:
    Pull Request resolved: #3959
    
    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: meyering
    
    Differential Revision: D64398686
    
    fbshipit-source-id: 44c60ea6e99d9542acf5af15adba6cdccda95577
    r-barnes authored and facebook-github-bot committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    7a51922 View commit details
    Browse the repository at this point in the history
  3. Cache device major version value to avoid multiple calls of getCudaDe…

    …viceProperties (#3950)
    
    Summary:
    This diff enables to cache the device major version value so getCudaDeviceProperties() doesn't need to be called multiple times. Currently, the profiler of the code looks as so:
    {F1933796291}
    
    Pull Request resolved: #3950
    
    Test Plan:
    N5114369 -- provides a toy example (2) which exhibits the following timings:
    Average timings before change: 3.35s
    Average tmings after change:  1.99s
    
    Reviewed By: algoriddle
    
    Differential Revision: D64047778
    
    Pulled By: mlomeli1
    
    fbshipit-source-id: 2f09373944237e80b96d40f35c6714c06f5741a9
    mlomeli1 authored and facebook-github-bot committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    b8ae854 View commit details
    Browse the repository at this point in the history
  4. Fix shadowed variable in faiss/IndexIVFAdditiveQuantizer.cpp (#3958)

    Summary:
    Pull Request resolved: #3958
    
    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: meyering
    
    Differential Revision: D64398701
    
    fbshipit-source-id: 9f7b417bf6e8da6758f9cac4167a8b581bfed8b7
    r-barnes authored and facebook-github-bot committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    68f66bc View commit details
    Browse the repository at this point in the history
  5. Fix shadowed variable in faiss/impl/HNSW.cpp (#3961)

    Summary:
    Pull Request resolved: #3961
    
    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: meyering
    
    Differential Revision: D64398743
    
    fbshipit-source-id: 3ec24a1655133ee0d3b94a55e38857ffa8853268
    r-barnes authored and facebook-github-bot committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    c93d1fd View commit details
    Browse the repository at this point in the history
  6. Fix shadowed variable in faiss/impl/simd_result_handlers.h (#3960)

    Summary:
    Pull Request resolved: #3960
    
    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: meyering
    
    Differential Revision: D64398709
    
    fbshipit-source-id: b10e44b40aa1d3e21aeb5112eb93fb63d64d4118
    r-barnes authored and facebook-github-bot committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    d492753 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2024

  1. Fix shadowed variable in faiss/utils/NeuralNet.cpp (#3952)

    Summary:
    Pull Request resolved: #3952
    
    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: D64398749
    
    fbshipit-source-id: 0e8fd4ab8f6dbf780d4412083fa88fc0df3b89c2
    r-barnes authored and facebook-github-bot committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    1a799d0 View commit details
    Browse the repository at this point in the history