mirror of
https://github.com/facebookresearch/faiss.git
synced 2026-10-12 02:13:36 +00:00
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/5507 `SIMDConfig::has_dynamic_dispatch()` was defined inline in `simd_levels.h`, where it resolved `#ifdef FAISS_ENABLE_DD` at include time. That macro is only set while faiss itself is compiled, so any code outside the library that included the header always evaluated it to `false` — reporting that dynamic dispatch was unavailable even when linked against a faiss built with it enabled. Callers using it to decide whether `SIMDConfig::set_level()` will do anything would therefore skip setting the SIMD level, and silently fall back to the auto-detected one. Move the definition into `simd_levels.cpp`, which is compiled as part of the library and does see the macro. Callers now get the answer for the faiss they actually link against. The function is no longer `constexpr` and so cannot be used in constant expressions. It had no such uses. Also bumps the conda `openblas` pin for non-x86_64 platforms from 0.3.33 to 0.3.34, which is required to get the `Linux arm64 (conda)` build green. conda-forge now serves `libopenblas 0.3.34`, which depends on `openblas >=0.3.34,<0.3.35`, so the old pin left the environment unsolvable: ``` ExplainedDependencyNeedsBuildingError: Unsatisfiable dependencies for platform linux-aarch64 - package libfaiss-1.15.0-py3.12_h3f4af3b_10_cpu requires openblas 0.3.33.*, but none of the providers can be installed ``` The separate `libopenblas` pins for osx are left at 0.3.33, since that package is resolving fine. Reviewed By: junjieqi Differential Revision: D115218647 fbshipit-source-id: 7163e18011dc9b82e93cd68fb600d24ef7012732