mirror of
https://github.com/facebookresearch/faiss.git
synced 2026-10-11 22:50:00 +00:00
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/5713 Two Local Search Quantizer tests are numerically flaky under ARM NEON FMA ordering: - `TestComponents_ARM_NEON.test_update_codebooks_with_double`: `err_double` can exceed `err_float` on ARM even though it is better on x86. - `TestProductLocalSearchQuantizer.test_lut`: `compute_LUT` rounds differently on NEON; max relative diff reaches ~1.7e-3, above the x86-tuned `rtol=5e-4`. D121930308 already skips both via `pytest -k` on `osx and arm64`. This widens the conda selectors to `arm64` so linux-aarch64 nightly builds skip them too: - `pytest` test requirement and the `pytest -k` command: `[osx and arm64]` -> `[arm64]` - `unittest` `test_*` command: `[not (osx and arm64)]` -> `[not arm64]` The root fix (platform guards / looser `rtol` in the test files) is still pending. Reviewed By: mnorris11 Differential Revision: D122238335 fbshipit-source-id: c18fa2ecec29602e758bc20e2bc0dfc3e5d207d0
181 lines
6.6 KiB
YAML
181 lines
6.6 KiB
YAML
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
{% set version = environ.get('GIT_DESCRIBE_TAG').lstrip('v') %}
|
|
{% set suffix = "_nightly" if environ.get('PACKAGE_TYPE') == 'nightly' else "" %}
|
|
{% set number = GIT_DESCRIBE_NUMBER %}
|
|
|
|
package:
|
|
name: faiss-pkg
|
|
version: {{ version }}
|
|
|
|
build:
|
|
number: {{ number }}
|
|
|
|
about:
|
|
home: https://github.com/facebookresearch/faiss
|
|
license: MIT
|
|
license_family: MIT
|
|
license_file: LICENSE
|
|
summary: A library for efficient similarity search and clustering of dense vectors.
|
|
|
|
source:
|
|
git_url: ../../
|
|
|
|
outputs:
|
|
- name: libfaiss
|
|
script: build-lib.sh # [x86_64 and not win and not osx]
|
|
script: build-lib-osx.sh # [x86_64 and osx]
|
|
script: build-lib-arm64.sh # [not x86_64]
|
|
script: build-lib.bat # [win]
|
|
build:
|
|
string: "py{{ PY_VER }}_h{{ PKG_HASH }}_{{ number }}_cpu{{ suffix }}"
|
|
run_exports:
|
|
- {{ pin_compatible('libfaiss', exact=True) }}
|
|
requirements:
|
|
build:
|
|
- python {{ python }}
|
|
- {{ compiler('cxx') }}
|
|
- libcxx =20.1.1 # [osx and arm64]
|
|
- sysroot_linux-64 =2.17 # [linux64]
|
|
- llvm-openmp # [osx or linux64]
|
|
- cmake >=3.24.0
|
|
- make =4.2 # [not win and not (osx and arm64)]
|
|
- make =4.4 # [osx and arm64]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl-devel >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl-devel >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl-devel >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% else %}
|
|
- mkl-devel >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl-devel >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi
|
|
{% endif %}
|
|
- libopenblas =0.3.34 # [osx]
|
|
host:
|
|
- python {{ python }}
|
|
- libcxx =20.1.1 # [osx and arm64]
|
|
- libsvs-runtime =0.4.0 # [x86_64 and linux]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% endif %}
|
|
- openblas =0.3.34 # [linux and not x86_64]
|
|
- libopenblas =0.3.34 # [osx]
|
|
run:
|
|
- python {{ python }}
|
|
- libcxx =20.1.1 # [osx and arm64]
|
|
- libsvs-runtime =0.4.0 # [x86_64 and linux]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% endif %}
|
|
- openblas =0.3.34 # [linux and not x86_64]
|
|
- libopenblas =0.3.34 # [osx]
|
|
test:
|
|
requires:
|
|
- conda-build =25.3.1
|
|
commands:
|
|
- test -f $PREFIX/lib/libfaiss$SHLIB_EXT # [not win]
|
|
- test -f $PREFIX/lib/libfaiss_avx2$SHLIB_EXT # [x86_64 and not win]
|
|
- test -f $PREFIX/lib/libfaiss_metal.a # [osx and arm64]
|
|
- test -f $PREFIX/lib/MetalDistance.metallib # [osx and arm64]
|
|
- conda inspect linkages -p $PREFIX $PKG_NAME # [not win]
|
|
- conda inspect objects -p $PREFIX $PKG_NAME # [osx]
|
|
|
|
- name: faiss-cpu
|
|
script: build-pkg.sh # [x86_64 and not win and not osx]
|
|
script: build-pkg-osx.sh # [x86_64 and osx]
|
|
script: build-pkg-arm64.sh # [not x86_64]
|
|
script: build-pkg.bat # [win]
|
|
build:
|
|
string: "py{{ PY_VER }}_h{{ PKG_HASH }}_{{ number }}_cpu{{ suffix }}"
|
|
requirements:
|
|
build:
|
|
- python {{ python }}
|
|
- {{ compiler('cxx') }}
|
|
- libcxx =20.1.1 # [osx and arm64]
|
|
- sysroot_linux-64 =2.17 # [linux64]
|
|
- swig =4.0
|
|
- cmake >=3.24.0
|
|
- make =4.2 # [not win and not (osx and arm64)]
|
|
- make =4.4 # [osx and arm64]
|
|
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% endif %}
|
|
- libopenblas =0.3.34 # [osx]
|
|
host:
|
|
- python {{ python }}
|
|
- numpy >=2.0,<3.0
|
|
- setuptools
|
|
- {{ pin_subpackage('libfaiss', exact=True) }}
|
|
- libcxx =20.1.1 # [osx and arm64]
|
|
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% endif %}
|
|
- libopenblas =0.3.34 # [osx]
|
|
run:
|
|
- python {{ python }}
|
|
- numpy >=2.0,<3.0
|
|
- packaging
|
|
- {{ pin_subpackage('libfaiss', exact=True) }}
|
|
- libcxx =20.1.1 # [osx and arm64]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% endif %}
|
|
- libopenblas =0.3.34 # [osx]
|
|
test:
|
|
requires:
|
|
- numpy >=2.0,<3.0
|
|
- scipy
|
|
- pytest # [arm64]
|
|
- pytorch-cpu >=2.7 # [not win]
|
|
- pytorch >=2.7 # [win]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% endif %}
|
|
commands:
|
|
- python -X faulthandler -m pytest tests/ --ignore=tests/external_module_test.py -q -k 'not test_update_codebooks_with_double and not (TestProductLocalSearchQuantizer and test_lut)' # [arm64]
|
|
- python -X faulthandler -m unittest discover -v -s tests/ -p "test_*" # [not arm64]
|
|
- python -X faulthandler -m unittest discover -v -s tests/ -p "torch_*"
|
|
- sh test_cpu_dispatch.sh # [linux64]
|
|
files:
|
|
- test_cpu_dispatch.sh # [linux64]
|
|
source_files:
|
|
- tests/
|