16 Commits

Author SHA1 Message Date
Ramil Bakhshyiev
e188eb3810 Bump libraft to 24.06 to unblock nightly RAFT builds (#3522)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3522

Quick fix to unblock nightly

Reviewed By: mlomeli1

Differential Revision: D58694193

fbshipit-source-id: ea323991cc2e2b958fc11ab614dcd6e09d4c072c
2024-06-17 17:59:13 -07:00
Ramil Bakhshyiev
849557a38a Unbreak RAFT conda builds (#3519)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/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
2024-06-17 01:40:32 -07:00
Ramil Bakhshyiev
2050a03090 Add cuda-toolkit package dependency to faiss-gpu and faiss-gpu-raft conda build recipes (#3440)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/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
2024-05-15 13:06:00 -07:00
iotamudelta
0169f29f37 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: https://github.com/facebookresearch/faiss/pull/3305

Reviewed By: mlomeli1

Differential Revision: D56234500

Pulled By: algoriddle

fbshipit-source-id: dfe7df3379c5250dedec7d1988cffa889fc1c393
2024-04-17 03:43:57 -07:00
Junjie Qi
d6854136af Fix faiss swig build with version > 4.2.x (#3315)
Summary:
Currently, faiss can't build with swig version > 4.2.x. As the https://github.com/facebookresearch/faiss/issues/3239 mentioned.  Swig removed the support for 32bit 9fb3a4939e. So SWIGTYPE_p_unsigned_long_long isn't supported any more. In this diff, we are going to remove the unsupported type from Faiss swig.

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

Test Plan:
STEP 1: create a new conda env
```
conda create --name faiss_swig
conda activate faiss_swig
```

STEP 2: install dependecies from conda-forge
```
conda install -y -q python=3.11 cmake make swig mkl=2023 mkl-devel=2023 numpy scipy pytest gxx_linux-64 sysroot_linux-64=2.28 -c conda-forge
```

STEP 3: CMAKE

```
cmake -B build \
      -DBUILD_TESTING=ON \
      -DBUILD_SHARED_LIBS=ON \
      -DFAISS_ENABLE_GPU=OFF \
      -DFAISS_ENABLE_RAFT=OFF \
      -DFAISS_OPT_LEVEL=avx512 \
      -DFAISS_ENABLE_C_API=ON \
      -DPYTHON_EXECUTABLE=$(which python) \
      -DCMAKE_BUILD_TYPE=Release \
      -DBLA_VENDOR=Intel10_64_dyn \
      -DCMAKE_CUDA_FLAGS="-gencode arch=compute_75,code=sm_75" \
      .
```

STEP 4: build
```
make -C build -j faiss && make -C build -j swigfaiss
```
<img width="876" alt="Screenshot 2024-03-25 at 12 24 16 AM" src="https://github.com/facebookresearch/faiss/assets/8333898/918f0caf-398a-4361-989f-93ff547cf2b2">

Reviewed By: algoriddle

Differential Revision: D55304004

Pulled By: junjieqi

fbshipit-source-id: e958009dc637aa33b0e1a574a16a846a4abb1525
2024-03-28 22:54:51 -07:00
Gergely Szilvasy
b77061ff5e move to raft 24.04 (#3302)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3302

Reviewed By: junjieqi

Differential Revision: D55173776

fbshipit-source-id: 5de2225638e2d997fbfa4e28b924d5e4633ee27f
2024-03-21 11:18:02 -07:00
Junjie Qi
6f3843e14f Back out "Remove swig version and always rely on the latest version" (#3297)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3297

Original commit changeset: 7ca59fb58390

Original Phabricator Diff: D54975271

Differential Revision: D55102226

fbshipit-source-id: 2a2828b4e74b16ee25b090ae4b844dab4f1d72a6
2024-03-19 16:31:48 -07:00
Junjie Qi
f7fe62e801 Remove swig version and always rely on the latest version (#3295)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3295

In the past, we had build failure due to the latest swig version in conda-forge so we had to specify the version of swig. In this diff, we are going to change it to be the latest version always because the issue has gone.

Reviewed By: algoriddle

Differential Revision: D54975271

fbshipit-source-id: 7ca59fb58390edb0cc5ed52f6fd416f633dd7938
2024-03-19 10:46:30 -07:00
Gergely Szilvasy
ed3f6e5fdf faiss-gpu to use 11.4.4 and be the only one supporting P100 (#3237)
Summary:
Considering that only GPU classic works on Pascal and only if compiled with cuda 11.4, this sets up the conda builds as follows.

tl;dr: Pascal will only be supported by faiss-gpu on cuda 11.

## faiss-gpu
1. build on cuda 11.4.4, supports Pascal, works with pytorch-cuda=11 (including hosts with cuda 12 drivers)
2. build on cuda 12.1.1, does NOT support Pascal, works with pytorch-cuda=12

## faiss-gpu-raft
1. build on cuda 11.8.0, does NOT support Pascal, works with pytorch-cuda=11.8
2. build on cuda 12.1.1, does NOT support Pascal, works with pytorch-cuda=12

The reason faiss-gpu-raft is built with and supports only 11.8 is due to the risk of clobbering otherwise between libraft and pytorch-cuda dependencies.

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

Reviewed By: mdouze

Differential Revision: D53354121

Pulled By: algoriddle

fbshipit-source-id: 86108e975168759572f84922bf0ccef55ae75ef8
2024-02-02 09:01:10 -08:00
Gergely Szilvasy
c1822a81b2 cuda dependencies (#3230)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3230

Reviewed By: mlomeli1

Differential Revision: D53271742

Pulled By: algoriddle

fbshipit-source-id: b0f09e26ab0b4cfcbdb10528b2f57e15c10f4265
2024-01-31 14:25:13 -08:00
Gergely Szilvasy
31bddeb0cf add faiss_gpu lib (#3222)
Summary:
1. Split the GPU code into a separate static library to reduce build times.
2. faiss-gpu now depends on pytorch-cuda to stop clobbering of CUDA libraries when Faiss and Pytorch installed in the same environment
3. Add CUDA 12 (we support both 11.8 and 12.1)
4. Add Python 3.12

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

Reviewed By: mlomeli1

Differential Revision: D53215033

Pulled By: algoriddle

fbshipit-source-id: d48c5707af20b7e5ff72c3aa27b0e677259f22f8
2024-01-30 01:44:50 -08:00
Gergely Szilvasy
7e01b47a1c fix raft build
Summary:
Raft conda packages are built with conda-forge, which ships a newer version of swig, which broke the build. I'm pinning the version as a zero-effort attempt to fix this.

```
[ 80%] Building CXX object CMakeFiles/swigfaiss.dir/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx.o
/home/circleci/miniconda/conda-bld/faiss-pkg_1705881814815/work/_build_python_3.9/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx: In function 'PyObject* swig_ptr(PyObject*)':
/home/circleci/miniconda/conda-bld/faiss-pkg_1705881814815/work/_build_python_3.9/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx:6573:41: error: 'SWIGTYPE_p_unsigned_long_long' was not declared in this scope; did you mean 'SWIGTYPE_p_unsigned_long'?
 6573 |         return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long_long, 0);
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/circleci/miniconda/conda-bld/faiss-pkg_1705881814815/work/_build_python_3.9/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx:1136:94: note: in definition of macro 'SWIG_NewPointerObj'
 1136 | #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
      |                                                                                              ^~~~
/home/circleci/miniconda/conda-bld/faiss-pkg_1705881814815/work/_build_python_3.9/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx:6580:41: error: 'SWIGTYPE_p_long_long' was not declared in this scope; did you mean 'SWIGTYPE_p_MapLong2Long'?
 6580 |         return SWIG_NewPointerObj(data, SWIGTYPE_p_long_long, 0);
      |                                         ^~~~~~~~~~~~~~~~~~~~
/home/circleci/miniconda/conda-bld/faiss-pkg_1705881814815/work/_build_python_3.9/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx:1136:94: note: in definition of macro 'SWIG_NewPointerObj'
 1136 | #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
      |                                                                                              ^~~~
make[3]: *** [CMakeFiles/swigfaiss.dir/build.make:76: CMakeFiles/swigfaiss.dir/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx.o] Error 1
```

Reviewed By: mlomeli1

Differential Revision: D52962236

fbshipit-source-id: e1a6b4c6ba03c9a0a320b5dbb54a8d618b8f8e74
2024-01-22 09:51:35 -08:00
Kota Yamaguchi
c540e762ca Use packaging instead of deprecated distutils for version handling (#3191)
Summary:
This PR replaces deprecated `distutils.version.LooseVersion` with [`packaging.version.Version`](https://packaging.pypa.io/en/stable/index.html). This change is needed to support CPython 3.12+.

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

Reviewed By: algoriddle

Differential Revision: D52872218

Pulled By: mlomeli1

fbshipit-source-id: 336b2a618fde0a65d70b53c7d8a27aef3b62ece1
2024-01-18 11:15:03 -08:00
Gergely Szilvasy
b7efd3add7 bump libraft version to fix nightly
Summary:
Diff summary courtesy of Metamate:

This diff bumps the version of libraft to fix nightly issues in the faiss-gpu-raft package. The code changes include updating the libraft version in the meta.yaml file to 24.02. This change is necessary to ensure that the package is compatible with the latest version of libraft.

Reviewed By: mlomeli1

Differential Revision: D52736355

fbshipit-source-id: 7ac2427210c06eb2d1c3ab4a3d37d48494fb039e
2024-01-13 10:05:35 -08:00
Gergely Szilvasy
0c07a114ad fix raft contbuild and switch to libraft 23.12 (#3116)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3116

Test Plan: https://app.circleci.com/pipelines/github/facebookresearch/faiss/4839/workflows/cfd84a94-ca60-4128-96e6-db0f5afc69c4

Reviewed By: mdouze

Differential Revision: D50897934

Pulled By: algoriddle

fbshipit-source-id: 1422be39d640a2aec3ab6b4c68d3ef54900b5ba2
2023-11-01 14:37:21 -07:00
Gergely Szilvasy
2768fb38b2 faiss-gpu-raft package (#2992)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2992

Reviewed By: mdouze

Differential Revision: D48391366

Pulled By: algoriddle

fbshipit-source-id: 94b7f62afc8a09a9feaea47bf60e5358d89fcde5
2023-08-16 09:30:41 -07:00