Debian Codegraph @

conda/faiss-gpu/meta.yaml

raw
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 }}{{ suffix }}"
38 run_exports:
39 - {{ pin_compatible('libfaiss', exact=True) }}
40 script_env:
41 - CUDA_ARCHS
42 - FAISS_FLATTEN_CONDA_INCLUDES
43 requirements:
44 build:
45 - {{ compiler('cxx') }} =12.4
46 - sysroot_linux-64 =2.17 # [linux64]
47 - llvm-openmp # [osx]
48 - cmake >=3.24.0
49 - make =4.2 # [not win and not (osx and arm64)]
50 - make =4.4 # [osx and arm64]
51 - mkl-devel >=2024.2.2,<2025.0a0 # [x86_64]
52 - cuda-toolkit {{ cudatoolkit }}
53 host:
54 - mkl >=2024.2.2,<2025.0a0 # [x86_64]
55 - openblas =0.3.30 # [not x86_64]
56 run:
57 - mkl >=2024.2.2,<2025.0a0 # [x86_64]
58 - openblas =0.3.30 # [not x86_64]
59 - cuda-cudart {{ cuda_constraints }}
60 - libcublas {{ libcublas_constraints }}
61 test:
62 requires:
63 - conda-build
64 commands:
65 - test -f $PREFIX/lib/libfaiss$SHLIB_EXT # [not win]
66 - test -f $PREFIX/lib/libfaiss_avx2$SHLIB_EXT # [x86_64 and not win]
67 - conda inspect linkages -p $PREFIX $PKG_NAME # [not win]
68 - conda inspect objects -p $PREFIX $PKG_NAME # [osx]
69
70 - name: faiss-gpu
71 script: build-pkg.sh # [x86_64 and not win and not osx]
72 script: build-pkg-osx.sh # [x86_64 and osx]
73 script: build-pkg-arm64.sh # [not x86_64]
74 script: build-pkg.bat # [win]
75 build:
76 string: "py{{ PY_VER }}_h{{ PKG_HASH }}_{{ number }}_cuda{{ cudatoolkit }}{{ suffix }}"
77 requirements:
78 build:
79 - {{ compiler('cxx') }} =12.4
80 - sysroot_linux-64 =2.17 # [linux64]
81 - swig =4.0
82 - cmake >=3.24.0
83 - make =4.2 # [not win and not (osx and arm64)]
84 - make =4.4 # [osx and arm64]
85 - _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
86 - cuda-toolkit {{ cudatoolkit }}
87 - mkl-devel >=2024.2.2,<2025.0a0 # [x86_64]
88 host:
89 - mkl >=2024.2.2,<2025.0a0 # [x86_64]
90 - python {{ python }}
91 - numpy >=2.0,<3.0
92 - _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
93 - {{ pin_subpackage('libfaiss', exact=True) }}
94 run:
95 - mkl >=2024.2.2,<2025.0a0 # [x86_64]
96 - python {{ python }}
97 - numpy >=2.0,<3.0
98 - packaging
99 - {{ pin_subpackage('libfaiss', exact=True) }}
100 test:
101 requires:
102 - numpy >=2.0,<3.0
103 - scipy
104 - pytorch-gpu >=2.7
105 commands:
106 - python -X faulthandler -m unittest discover -v -s tests/ -p "test_*"
107 - python -X faulthandler -m unittest discover -v -s tests/ -p "torch_*"
108 - cp tests/common_faiss_tests.py faiss/gpu/test
109 - python -X faulthandler -m unittest discover -v -s faiss/gpu/test/ -p "test_*"
110 - python -X faulthandler -m unittest discover -v -s faiss/gpu/test/ -p "torch_*"
111 - sh test_cpu_dispatch.sh # [linux64]
112 files:
113 - test_cpu_dispatch.sh # [linux64]
114 source_files:
115 - tests/
116 - faiss/gpu/test/