├── faiss
├── .dockerignore
├── contrib
│ ├── __init__.py
│ ├── torch
│ │ ├── __init__.py
│ │ ├── README.md
│ │ ├── quantization.py
│ │ └── clustering.py
│ └── vecs_io.py
├── benchs
│ ├── bench_fw
│ │ └── __init__.py
│ ├── CMakeLists.txt
│ ├── bench_index_pq.py
│ ├── link_and_code
│ │ └── README.md
│ ├── bench_all_ivf
│ │ ├── make_groundtruth.py
│ │ └── README.md
│ ├── bench_pairwise_distances.py
│ ├── bench_hamming_knn.py
│ ├── bench_polysemous_sift1m.py
│ ├── datasets.py
│ ├── distributed_ondisk
│ │ └── make_trained_index.py
│ └── bench_fw_optimize.py
├── demos
│ ├── offline_ivf
│ │ ├── __init__.py
│ │ ├── generate_config.py
│ │ └── README.md
│ ├── rocksdb_ivf
│ │ ├── CMakeLists.txt
│ │ └── README.md
│ ├── README.md
│ └── CMakeLists.txt
├── faiss
│ ├── .flake8
│ ├── gpu
│ │ ├── utils
│ │ │ ├── warpselect
│ │ │ │ ├── WarpSelectFloatF512.cu
│ │ │ │ ├── WarpSelectFloatT512.cu
│ │ │ │ ├── WarpSelectFloatF1024.cu
│ │ │ │ ├── WarpSelectFloatT1024.cu
│ │ │ │ ├── WarpSelectFloat1.cu
│ │ │ │ ├── WarpSelectFloat128.cu
│ │ │ │ ├── WarpSelectFloat256.cu
│ │ │ │ ├── WarpSelectFloat32.cu
│ │ │ │ ├── WarpSelectFloat64.cu
│ │ │ │ ├── WarpSelectFloatF2048.cu
│ │ │ │ └── WarpSelectFloatT2048.cu
│ │ │ ├── blockselect
│ │ │ │ ├── BlockSelectFloatF512.cu
│ │ │ │ ├── BlockSelectFloatT512.cu
│ │ │ │ ├── BlockSelectFloatF1024.cu
│ │ │ │ ├── BlockSelectFloatT1024.cu
│ │ │ │ ├── BlockSelectFloat1.cu
│ │ │ │ ├── BlockSelectFloat32.cu
│ │ │ │ ├── BlockSelectFloat64.cu
│ │ │ │ ├── BlockSelectFloat128.cu
│ │ │ │ ├── BlockSelectFloat256.cu
│ │ │ │ ├── BlockSelectFloatF2048.cu
│ │ │ │ └── BlockSelectFloatT2048.cu
│ │ │ ├── MergeNetworkUtils.cuh
│ │ │ ├── Comparators.cuh
│ │ │ ├── Timer.h
│ │ │ ├── Timer.cpp
│ │ │ ├── MatrixMult.cuh
│ │ │ ├── DeviceDefs.cuh
│ │ │ └── Float16.cuh
│ │ ├── impl
│ │ │ ├── L2Select.cuh
│ │ │ ├── RemapIndices.h
│ │ │ ├── BinaryDistance.cuh
│ │ │ ├── L2Norm.cuh
│ │ │ ├── IndexUtils.h
│ │ │ ├── IVFFlatScan.cuh
│ │ │ ├── PQCodeDistances.cuh
│ │ │ ├── IndexUtils.cu
│ │ │ ├── PQScanMultiPassPrecomputed.cuh
│ │ │ ├── RemapIndices.cpp
│ │ │ ├── BroadcastSum.cuh
│ │ │ ├── PQScanMultiPassNoPrecomputed.cuh
│ │ │ ├── VectorResidual.cuh
│ │ │ └── InterleavedCodes.h
│ │ ├── perf
│ │ │ ├── slow.py
│ │ │ └── IndexWrapper.h
│ │ ├── GpuAutoTune.h
│ │ ├── GpuFaissAssert.h
│ │ ├── test
│ │ │ └── test_gpu_index_ivfflat.py
│ │ ├── GpuIndicesOptions.h
│ │ └── GpuIcmEncoder.h
│ ├── utils
│ │ ├── fp16.h
│ │ ├── fp16-fp16c.h
│ │ ├── bf16.h
│ │ ├── fp16-arm.h
│ │ ├── distances_fused
│ │ │ ├── simdlib_based.h
│ │ │ ├── avx512.h
│ │ │ ├── distances_fused.cpp
│ │ │ └── distances_fused.h
│ │ ├── simdlib.h
│ │ ├── approx_topk
│ │ │ └── mode.h
│ │ ├── extra_distances.h
│ │ ├── WorkerThread.h
│ │ └── prefetch.h
│ ├── cppcontrib
│ │ ├── factory_tools.h
│ │ ├── docker_dev
│ │ │ └── Dockerfile
│ │ └── detail
│ │ │ └── CoarseBitType.h
│ ├── index_factory.h
│ ├── clone_index.h
│ ├── impl
│ │ ├── index_read_utils.h
│ │ ├── Quantizer.h
│ │ ├── kmeans1d.h
│ │ ├── FaissException.h
│ │ └── CodePacker.cpp
│ ├── IndexNeuralNetCodec.h
│ ├── IndexShardsIVF.h
│ ├── IndexLattice.h
│ ├── IndexBinaryFromFloat.h
│ ├── IndexBinaryHNSW.h
│ ├── IndexIVFIndependentQuantizer.h
│ └── MatrixStats.h
├── conda
│ ├── conda_build_config.yaml
│ ├── faiss
│ │ ├── test_cpu_dispatch.sh
│ │ ├── build-lib-arm64.sh
│ │ ├── build-pkg-arm64.sh
│ │ ├── build-lib.sh
│ │ ├── build-lib.bat
│ │ ├── build-pkg.sh
│ │ ├── build-pkg.bat
│ │ ├── build-lib-osx.sh
│ │ └── build-pkg-osx.sh
│ ├── faiss-gpu
│ │ ├── test_cpu_dispatch.sh
│ │ ├── build-pkg.sh
│ │ └── build-lib.sh
│ └── faiss-gpu-raft
│ │ ├── test_cpu_dispatch.sh
│ │ ├── build-pkg.sh
│ │ └── build-lib.sh
├── CODE_OF_CONDUCT.md
├── cmake
│ ├── faiss-config.cmake.in
│ └── thirdparty
│ │ └── fetch_rapids.cmake
├── perf_tests
│ ├── utils.h
│ └── utils.cpp
├── .gitignore
├── tests
│ ├── test_omp_threads.cpp
│ ├── test_documentation.py
│ ├── test_omp_threads_py.py
│ ├── test_utils.cpp
│ ├── test_callback_py.py
│ ├── test_util.h
│ ├── test_callback.cpp
│ ├── test_partitioning.cpp
│ ├── test_oom_exception.py
│ ├── test_binary_factory.py
│ ├── test_rowwise_minmax.py
│ ├── test_autotune.py
│ └── test_binary_flat.cpp
├── c_api
│ ├── utils
│ │ ├── utils_c.cpp
│ │ └── utils_c.h
│ ├── gpu
│ │ ├── GpuIndex_c.cpp
│ │ ├── GpuIndex_c.h
│ │ ├── CMakeLists.txt
│ │ ├── DeviceUtils_c.h
│ │ ├── GpuIndicesOptions_c.h
│ │ ├── DeviceUtils_c.cpp
│ │ └── macros_impl.h
│ ├── error_impl.h
│ ├── error_impl.cpp
│ ├── clone_index_c.h
│ ├── index_factory_c.h
│ ├── clone_index_c.cpp
│ ├── error_c.h
│ ├── IndexLSH_c.h
│ ├── IndexReplicas_c.h
│ ├── IndexShards_c.h
│ ├── index_factory_c.cpp
│ ├── IndexLSH_c.cpp
│ └── IndexPreTransform_c.h
├── .github
│ ├── workflows
│ │ ├── retry_build.yml
│ │ ├── autoclose.yml
│ │ ├── update-doxygen.yml
│ │ └── publish-docs.yml
│ └── ISSUE_TEMPLATE.md
├── LICENSE
└── tutorial
│ ├── python
│ ├── 3-IVFPQ.py
│ ├── 1-Flat.py
│ ├── 5-Multiple-GPUs.py
│ ├── 2-IVFFlat.py
│ ├── 7-PQFastScan.py
│ ├── 8-PQFastScanRefine.py
│ └── 9-RefineComparison.py
│ └── cpp
│ ├── CMakeLists.txt
│ └── 6-HNSW.cpp
├── .gitattributes
├── docs
└── assets
│ ├── 001-building-faiss-index-on-ios.png
│ └── 002-done-building-faiss-index-on-ios.png
├── .gitignore
├── examples
├── FAISS-iOS-Objective-C
│ ├── FAISS-iOS-Objective-C
│ │ ├── Assets.xcassets
│ │ │ ├── Contents.json
│ │ │ ├── AccentColor.colorset
│ │ │ │ └── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ ├── ViewController.h
│ │ ├── AppDelegate.h
│ │ ├── SceneDelegate.h
│ │ ├── main.m
│ │ ├── Info.plist
│ │ ├── AppDelegate.m
│ │ └── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── LaunchScreen.storyboard
│ └── FAISS-iOS-Objective-C.xcodeproj
│ │ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcuserdata
│ │ │ └── eugene.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcuserdata
│ │ └── eugene.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
├── FAISS-Mac-Objective-C
│ └── FAISS-Mac-Objective-C.xcodeproj
│ │ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcuserdata
│ │ │ └── eugene.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcuserdata
│ │ └── eugene.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── FAISS-Mac-Objective-C++
│ ├── FAISS-Mac-Objective-C++.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcuserdata
│ │ │ └── eugene.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcuserdata
│ │ └── eugene.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
│ └── README.md
├── .vscode
└── settings.json
├── carthage
├── faiss-static-xcframework.json
└── faiss-c-static-xcframework.json
├── extra
├── CMakeLists.patch
└── update-carthage.js
├── TROUBLESHOOTING.md
├── LICENSE
├── Package.swift
├── FAISS.podspec
└── FAISS_C.podspec
/faiss/.dockerignore:
--------------------------------------------------------------------------------
1 | sift1M
--------------------------------------------------------------------------------
/faiss/contrib/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/faiss/benchs/bench_fw/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/faiss/contrib/torch/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/faiss/demos/offline_ivf/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.a filter=lfs diff=lfs merge=lfs -text
2 | *.zip filter=lfs diff=lfs merge=lfs -text
3 |
--------------------------------------------------------------------------------
/faiss/faiss/.flake8:
--------------------------------------------------------------------------------
1 | [flake8]
2 | # Ignore flakes about ambiguous variable name `I`.
3 | ignore = E741
4 |
--------------------------------------------------------------------------------
/faiss/conda/conda_build_config.yaml:
--------------------------------------------------------------------------------
1 | python:
2 | - 3.9
3 | - 3.10
4 | - 3.11
5 | - 3.12 # [not aarch64]
6 |
--------------------------------------------------------------------------------
/docs/assets/001-building-faiss-index-on-ios.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DeveloperMindset-com/faiss-mobile/HEAD/docs/assets/001-building-faiss-index-on-ios.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | build
3 | xcframeworks
4 | *.app
5 | node_modules
6 | package-lock.json
7 | logs
8 | dist/openmp.xcframework
9 | /.build
10 | /dist
11 |
--------------------------------------------------------------------------------
/docs/assets/002-done-building-faiss-index-on-ios.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DeveloperMindset-com/faiss-mobile/HEAD/docs/assets/002-done-building-faiss-index-on-ios.png
--------------------------------------------------------------------------------
/examples/FAISS-iOS-Objective-C/FAISS-iOS-Objective-C/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "cmake.ignoreCMakeListsMissing": true,
3 | "editor.formatOnSave": true,
4 | "editor.defaultFormatter": "foxundermoon.shell-format"
5 | }
--------------------------------------------------------------------------------
/carthage/faiss-static-xcframework.json:
--------------------------------------------------------------------------------
1 | {
2 | "1.7.4": "https://github.com/eugenehp/faiss-mobile/releases/download/v1.7.4/faiss.xcframework.zip",
3 | "1.9.0": "https://github.com/eugenehp/faiss-mobile/releases/download/v1.9.0/faiss.xcframework.zip"
4 | }
--------------------------------------------------------------------------------
/carthage/faiss-c-static-xcframework.json:
--------------------------------------------------------------------------------
1 | {
2 | "1.7.4": "https://github.com/eugenehp/faiss-mobile/releases/download/v1.7.4/faiss_c.xcframework.zip",
3 | "1.9.0": "https://github.com/eugenehp/faiss-mobile/releases/download/v1.9.0/faiss_c.xcframework.zip"
4 | }
--------------------------------------------------------------------------------
/faiss/contrib/torch/README.md:
--------------------------------------------------------------------------------
1 | # The Torch contrib
2 |
3 | This contrib directory contains a few Pytorch routines that
4 | are useful for similarity search. They do not necessarily depend on Faiss.
5 |
6 | The code is designed to work with CPU and GPU tensors.
7 |
--------------------------------------------------------------------------------
/examples/FAISS-Mac-Objective-C/FAISS-Mac-Objective-C.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/examples/FAISS-iOS-Objective-C/FAISS-iOS-Objective-C.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/faiss/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 | Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.fb.com/codeofconduct) so that you can understand what actions will and will not be tolerated.
--------------------------------------------------------------------------------
/examples/FAISS-Mac-Objective-C++/FAISS-Mac-Objective-C++.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/examples/FAISS-iOS-Objective-C/FAISS-iOS-Objective-C/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "idiom" : "universal"
5 | }
6 | ],
7 | "info" : {
8 | "author" : "xcode",
9 | "version" : 1
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/examples/FAISS-iOS-Objective-C/FAISS-iOS-Objective-C/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // FAISS-iOS-Objective-C
4 | //
5 | // Created by eugene on 6/16/23.
6 | //
7 |
8 | #import
9 |
10 | @interface ViewController : UIViewController
11 |
12 |
13 | @end
14 |
15 |
--------------------------------------------------------------------------------
/examples/FAISS-iOS-Objective-C/FAISS-iOS-Objective-C/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // FAISS-iOS-Objective-C
4 | //
5 | // Created by eugene on 6/16/23.
6 | //
7 |
8 | #import
9 |
10 | @interface AppDelegate : UIResponder
11 |
12 |
13 | @end
14 |
15 |
--------------------------------------------------------------------------------
/faiss/cmake/faiss-config.cmake.in:
--------------------------------------------------------------------------------
1 | # Copyright (c) Facebook, Inc. and its affiliates.
2 | # All rights reserved.
3 | #
4 | # This source code is licensed under the BSD-style license found in the
5 | # LICENSE file in the root directory of this source tree.
6 |
7 | include("${CMAKE_CURRENT_LIST_DIR}/faiss-targets.cmake")
8 |
--------------------------------------------------------------------------------
/extra/CMakeLists.patch:
--------------------------------------------------------------------------------
1 | 36a37,44
2 | > install(TARGETS faiss_c
3 | > EXPORT faiss-targets
4 | > RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
5 | > ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
6 | > LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
7 | > INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
8 | > )
9 | >
10 |
--------------------------------------------------------------------------------
/examples/FAISS-iOS-Objective-C/FAISS-iOS-Objective-C/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "platform" : "ios",
6 | "size" : "1024x1024"
7 | }
8 | ],
9 | "info" : {
10 | "author" : "xcode",
11 | "version" : 1
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/examples/FAISS-Mac-Objective-C/FAISS-Mac-Objective-C.xcodeproj/project.xcworkspace/xcuserdata/eugene.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DeveloperMindset-com/faiss-mobile/HEAD/examples/FAISS-Mac-Objective-C/FAISS-Mac-Objective-C.xcodeproj/project.xcworkspace/xcuserdata/eugene.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/examples/FAISS-iOS-Objective-C/FAISS-iOS-Objective-C.xcodeproj/project.xcworkspace/xcuserdata/eugene.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DeveloperMindset-com/faiss-mobile/HEAD/examples/FAISS-iOS-Objective-C/FAISS-iOS-Objective-C.xcodeproj/project.xcworkspace/xcuserdata/eugene.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/examples/FAISS-Mac-Objective-C++/FAISS-Mac-Objective-C++.xcodeproj/project.xcworkspace/xcuserdata/eugene.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DeveloperMindset-com/faiss-mobile/HEAD/examples/FAISS-Mac-Objective-C++/FAISS-Mac-Objective-C++.xcodeproj/project.xcworkspace/xcuserdata/eugene.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/faiss/perf_tests/utils.h:
--------------------------------------------------------------------------------
1 | // (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
2 |
3 | #pragma once
4 | #include
5 | #include