Skip to content

Commit

Permalink
Merge pull request #41 from kyamagu/faiss-v1.7.1
Browse files Browse the repository at this point in the history
faiss v1.7.1
  • Loading branch information
kyamagu authored May 30, 2021
2 parents 782d329 + 604308d commit 5d534ee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 35 deletions.
44 changes: 12 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
-DFAISS_OPT_LEVEL=${FAISS_OPT_LEVEL} \
-DCMAKE_CUDA_ARCHITECTURES="35-real;50-real;60-real;70-real;75" \
-DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release -j2
cmake --build build --config Release -j2 # Limit to 2 to avoid OOM...
cmake --install build -v
cd ..
- name: Build package
Expand Down Expand Up @@ -185,15 +185,16 @@ jobs:
export FAISS_LDFLAGS="/usr/local/lib/libfaiss${FAISS_LIBRARY_SUFFIX}.a /usr/local/lib/libomp.a -framework Accelerate"
pip install --no-cache-dir -U pip
pip install --no-cache-dir wheel numpy==${NUMPY_VERSION}
pip install --no-cache-dir wheel numpy==${NUMPY_VERSION} delocate
pip wheel . -w dist --no-deps --verbose
delocate-wheel -v dist/faiss*.whl
ls -lh dist
- name: Install and test
if: matrix.python-version != 3.9 && matrix.opt != 'avx2'
run: |
pip install --no-cache-dir dist/faiss*.whl
pip install --no-cache-dir pytest scipy
pytest
pytest --deselect=faiss/tests/test_index_binary.py::TestReplicasAndShards::test_replicas
- name: Publish to PyPI
if: github.event_name == 'release' && github.event.action == 'created' && matrix.opt == 'generic'
run: |
Expand All @@ -211,7 +212,6 @@ jobs:
opt:
- 'generic'
env:
OPENBLAS_VERSION: v0.3.12
CMAKE_PREFIX_PATH: c:\opt
steps:
- uses: actions/checkout@v2
Expand All @@ -238,33 +238,10 @@ jobs:
- name: Install build tools
run: |
conda config --add channels conda-forge
conda install -y flang clangdev perl libflang ninja swig
conda install -y swig openblas
cmake --version
echo "LIB=${env:LIB};${env:CONDA_PREFIX}\Library\lib" >> ${env:GITHUB_ENV}
echo "CPATH=${env:CPATH};${env:CONDA_PREFIX}\Library\include" >> ${env:GITHUB_ENV}
- uses: actions/cache@v2
id: cache-openblas
with:
path: ${{ env.CMAKE_PREFIX_PATH }}
key: ${{ runner.os }}-openblas-${{ env.OPENBLAS_VERSION }}
- name: Build OpenBLAS
if: steps.cache-openblas.outputs.cache-hit != 'true'
run: |
git clone https://github.com/xianyi/OpenBLAS.git -b ${env:OPENBLAS_VERSION}
cd OpenBLAS
cmake . `
-B build `
-G "Ninja" `
-DCMAKE_CXX_COMPILER=clang-cl `
-DCMAKE_C_COMPILER=clang-cl `
-DCMAKE_Fortran_COMPILER=flang `
-DBUILD_WITHOUT_LAPACK=no `
-DNOFORTRAN=0 `
-DDYNAMIC_ARCH=ON `
-DCMAKE_BUILD_TYPE=Release `
-DQUIET_MAKE=1
cmake --build build --config Release -j
cmake --install build --prefix ${env:CMAKE_PREFIX_PATH} -v
cd ..
- name: Build and install faiss
run: |
cd faiss
Expand All @@ -291,18 +268,21 @@ jobs:
mv faiss\faiss\python\swigfaiss.swig faiss\faiss\python\swigfaiss.i
New-Item -ItemType file faiss\contrib\__init__.py
$Env:FAISS_INCLUDE = "${env:CMAKE_PREFIX_PATH}\include"
$Env:FAISS_LDFLAGS = "${env:CMAKE_PREFIX_PATH}\lib\faiss${env:FAISS_LIBRARY_SUFFIX}.lib ${env:CMAKE_PREFIX_PATH}\lib\openblas.lib"
$Env:FAISS_LDFLAGS = "${env:CMAKE_PREFIX_PATH}\lib\faiss${env:FAISS_LIBRARY_SUFFIX}.lib ${env:CONDA_PREFIX}\Library\lib\openblas.lib"
pip install --no-cache-dir -U pip
pip install --no-cache-dir wheel numpy==${env:NUMPY_VERSION}
pip install --no-cache-dir wheel numpy==${env:NUMPY_VERSION} delvewheel
pip wheel . -w dist --no-deps --verbose
delvewheel repair (Get-Item .\dist\faiss*.whl)
Get-ChildItem -Path dist
- name: Install and test
if: matrix.python-version != 3.9
run: |
pip install --no-cache-dir (Get-Item .\dist\faiss*.whl)
pip install --no-cache-dir pytest scipy
pytest
pytest `
--deselect=faiss/tests/test_clustering.py::TestCompositeClustering::test_redo `
--deselect=faiss/tests/test_lsq.py::TestComponents::test_compute_binary_terms
- name: Publish to PyPI
if: github.event_name == 'release' && github.event.action == 'created' && matrix.opt == 'generic'
run: |
Expand Down
2 changes: 1 addition & 1 deletion faiss
Submodule faiss updated 500 files
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool:pytest]
minversion = 6.0
addopts = -ra -q
addopts = -s -v
testpaths =
faiss/tests
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os

NAME = 'faiss-cpu'
VERSION = '1.7.0'
VERSION = '1.7.1'

LONG_DESCRIPTION = """
Faiss is a library for efficient similarity search and clustering of dense
Expand Down

0 comments on commit 5d534ee

Please sign in to comment.