| 1 |
# Copyright (c) Facebook, Inc. and its affiliates. |
| 2 |
# |
| 3 |
# This source code is licensed under the MIT license found in the |
| 4 |
# LICENSE file in the root directory of this source tree. |
| 5 |
|
| 6 |
{% set version = environ.get('GIT_DESCRIBE_TAG').lstrip('v') %} |
| 7 |
{% set suffix = "_nightly" if environ.get('PACKAGE_TYPE') == 'nightly' else "" %} |
| 8 |
{% set number = GIT_DESCRIBE_NUMBER %} |
| 9 |
{% set cuda_constraints=">=12.6,<12.7" %} |
| 10 |
{% set libcublas_constraints=">=12.6,<12.7" %} |
| 11 |
{% set cudart_constraints=">=12.6,<12.7" %} |
| 12 |
|
| 13 |
package: |
| 14 |
name: faiss-pkg |
| 15 |
version: {{ version }} |
| 16 |
|
| 17 |
build: |
| 18 |
number: {{ number }} |
| 19 |
|
| 20 |
about: |
| 21 |
home: https://github.com/facebookresearch/faiss |
| 22 |
license: MIT |
| 23 |
license_family: MIT |
| 24 |
license_file: LICENSE |
| 25 |
summary: A library for efficient similarity search and clustering of dense vectors. |
| 26 |
|
| 27 |
source: |
| 28 |
git_url: ../../ |
| 29 |
|
| 30 |
outputs: |
| 31 |
- name: libfaiss |
| 32 |
script: build-lib.sh # [x86_64 and not win and not osx] |
| 33 |
script: build-lib-osx.sh # [x86_64 and osx] |
| 34 |
script: build-lib-arm64.sh # [not x86_64] |
| 35 |
script: build-lib.bat # [win] |
| 36 |
build: |
| 37 |
string: "h{{ PKG_HASH }}_{{ number }}_cuda{{ cudatoolkit }}_cuvs{{ suffix }}" |
| 38 |
run_exports: |
| 39 |
- {{ pin_compatible('libfaiss', exact=True) }} |
| 40 |
script_env: |
| 41 |
- CUDA_ARCHS |
| 42 |
requirements: |
| 43 |
build: |
| 44 |
- {{ compiler('cxx') }} =12.4 |
| 45 |
- sysroot_linux-64 =2.17 # [linux64] |
| 46 |
- llvm-openmp # [osx] |
| 47 |
- cmake >=3.30.4 |
| 48 |
- make =4.2 # [not win] |
| 49 |
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64] |
| 50 |
- mkl >=2024.2.2,<2025.0a0 # [x86_64] |
| 51 |
- mkl-devel >=2024.2.2,<2025.0a0 # [x86_64] |
| 52 |
- cuda-toolkit {{ cudatoolkit }} |
| 53 |
- cuda-cudart {{ cudart_constraints }} |
| 54 |
- cuda-cudart-dev {{ cudart_constraints }} |
| 55 |
- cuda-cudart-static {{ cudart_constraints }} |
| 56 |
- cuda-cudart_linux-64 {{ cudart_constraints }} # [linux64] |
| 57 |
- cuda-cudart-dev_linux-64 {{ cudart_constraints }} # [linux64] |
| 58 |
- cuda-cudart-static_linux-64 {{ cudart_constraints }} # [linux64] |
| 59 |
host: |
| 60 |
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64] |
| 61 |
- mkl >=2024.2.2,<2025.0a0 # [x86_64] |
| 62 |
- openblas =0.3.30 # [not x86_64] |
| 63 |
- libcuvs =25.10 |
| 64 |
- cuda-version {{ cuda_constraints }} |
| 65 |
run: |
| 66 |
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64] |
| 67 |
- mkl >=2024.2.2,<2025.0a0 # [x86_64] |
| 68 |
- openblas =0.3.30 # [not x86_64] |
| 69 |
- cuda-cudart {{ cuda_constraints }} |
| 70 |
- libcublas {{ libcublas_constraints }} |
| 71 |
- libcuvs =25.10 |
| 72 |
- cuda-version {{ cuda_constraints }} |
| 73 |
- libnvjitlink |
| 74 |
test: |
| 75 |
requires: |
| 76 |
- conda-build |
| 77 |
commands: |
| 78 |
- test -f $PREFIX/lib/libfaiss$SHLIB_EXT # [not win] |
| 79 |
- test -f $PREFIX/lib/libfaiss_avx2$SHLIB_EXT # [x86_64 and not win] |
| 80 |
- conda inspect linkages -p $PREFIX $PKG_NAME # [not win] |
| 81 |
- conda inspect objects -p $PREFIX $PKG_NAME # [osx] |
| 82 |
|
| 83 |
- name: faiss-gpu-cuvs |
| 84 |
script: build-pkg.sh # [x86_64 and not win and not osx] |
| 85 |
script: build-pkg-osx.sh # [x86_64 and osx] |
| 86 |
script: build-pkg-arm64.sh # [not x86_64] |
| 87 |
script: build-pkg.bat # [win] |
| 88 |
build: |
| 89 |
string: "py{{ PY_VER }}_h{{ PKG_HASH }}_{{ number }}_cuda{{ cudatoolkit }}{{ suffix }}" |
| 90 |
requirements: |
| 91 |
build: |
| 92 |
- {{ compiler('cxx') }} =12.4 |
| 93 |
- sysroot_linux-64 =2.17 # [linux64] |
| 94 |
- swig =4.0 |
| 95 |
- cmake >=3.26.4 |
| 96 |
- make =4.2 # [not win] |
| 97 |
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64] |
| 98 |
- mkl >=2024.2.2,<2025.0a0 # [x86_64] |
| 99 |
- cuda-toolkit {{ cudatoolkit }} |
| 100 |
host: |
| 101 |
- mkl >=2024.2.2,<2025.0a0 # [x86_64] |
| 102 |
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64] |
| 103 |
- python {{ python }} |
| 104 |
- numpy >=2.0,<2.3 |
| 105 |
- {{ pin_subpackage('libfaiss', exact=True) }} |
| 106 |
run: |
| 107 |
- mkl >=2024.2.2,<2025.0a0 # [x86_64] |
| 108 |
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64] |
| 109 |
- python {{ python }} |
| 110 |
- numpy >=2.0,<2.3 |
| 111 |
- packaging |
| 112 |
- {{ pin_subpackage('libfaiss', exact=True) }} |
| 113 |
test: |
| 114 |
requires: |
| 115 |
- numpy >=2.0,<2.3 |
| 116 |
- scipy |
| 117 |
- pytorch-gpu >=2.7 |
| 118 |
commands: |
| 119 |
- python -X faulthandler -m unittest discover -v -s tests/ -p "test_*" |
| 120 |
- python -X faulthandler -m unittest discover -v -s tests/ -p "torch_*" |
| 121 |
- cp tests/common_faiss_tests.py faiss/gpu/test |
| 122 |
- python -X faulthandler -m unittest discover -v -s faiss/gpu/test/ -p "test_*" |
| 123 |
- python -X faulthandler -m unittest discover -v -s faiss/gpu/test/ -p "torch_*" |
| 124 |
- sh test_cpu_dispatch.sh # [linux64] |
| 125 |
files: |
| 126 |
- test_cpu_dispatch.sh # [linux64] |
| 127 |
source_files: |
| 128 |
- tests/ |
| 129 |
- faiss/gpu/test/ |