Skip to content

Commit

Permalink
Use AVX2 on x86_64 architectures only
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham authored Jan 4, 2023
1 parent 1e67bc4 commit 4bf398a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ outputs:
commands:
- exit 0

# build two separate C++ libs, one for generic x64, and one for AVX2
{% for CF_FAISS_BUILD in ["avx2", "generic"] %}
# build two separate C++ libs, one generic, and one for AVX2 on x86_64
{% for CF_FAISS_BUILD in ["generic"] %} # [arm64 or aarch64]
{% for CF_FAISS_BUILD in ["avx2", "generic"] %} # [x86_64]
# order libfaiss last in loop due to conda/conda-build#4090; libfaiss-avx2
# is only used for faiss and not important enough to work-around for this bug
{% if CF_FAISS_BUILD == "generic" %}
Expand Down Expand Up @@ -191,13 +192,13 @@ outputs:
- pip
- numpy
- libfaiss ={{ version }}=*_{{ faiss_proc_type }}
- libfaiss-avx2 ={{ version }}=*_{{ faiss_proc_type }}
- libfaiss-avx2 ={{ version }}=*_{{ faiss_proc_type }} # [x86_64]
- libblas
- liblapack
run:
- python
- libfaiss ={{ version }}=*_{{ faiss_proc_type }}
- libfaiss-avx2 ={{ version }}=*_{{ faiss_proc_type }}
- libfaiss-avx2 ={{ version }}=*_{{ faiss_proc_type }} # [x86_64]
- {{ pin_compatible('numpy') }}
run_constrained:
- faiss-cpu ==9999999999 # [cuda_compiler_version != "None"]
Expand All @@ -223,7 +224,7 @@ outputs:
# the linux & windows CI agents support AVX2 (OSX doesn't yet), so by default,
# we expect faiss will load the library with AVX2-support, see
# https://github.com/facebookresearch/faiss/blob/v1.7.1/faiss/python/loader.py#L52-L66
- export HAS_AVX2=YES && ./test-pkg.sh # [linux]
- export HAS_AVX2=YES && ./test-pkg.sh # [linux64]
- export HAS_AVX2=NO && ./test-pkg.sh # [osx]
# skip test suite on win + cuda < 11.2 due to time outs (note: "None" >= "11.2")
{% if cuda_compiler_version|string >= "11.2" %}
Expand Down

0 comments on commit 4bf398a

Please sign in to comment.