Skip to content

Commit

Permalink
Add conda packages metadata + tests. (#769)
Browse files Browse the repository at this point in the history
+ Add conda packages metadata (now building Faiss using conda's toolchain);
+ add Dockerfile for building conda packages (for all CUDA versions);
+ add working Dockerfile building faiss on Centos7;
+ simplify GPU build;
+ avoid falling back to CPU-only version (python);
+ simplify TravisCI config;
+ update INSTALL.md;
+ add configure flag for specifying target architectures (--with-cuda-arch);
+ fix Makefile for gpu tests;
+ fix various Makefile issues;
+ remove stale file (gpu/utils/DeviceUtils.cpp).
  • Loading branch information
beauby authored Apr 5, 2019
1 parent 6c1cb3c commit 7f5b22b
Show file tree
Hide file tree
Showing 34 changed files with 2,435 additions and 200,269 deletions.
18 changes: 13 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ matrix:
- liblapack-dev
- python-numpy
- python-dev
# - swig
# - swig3.0
env:
- PYTHON_CFLAGS="-I/usr/include/python2.7"
- os: linux
compiler: gcc
addons:
Expand All @@ -25,7 +27,9 @@ matrix:
- liblapack-dev
- python-numpy
- python-dev
# - swig
# - swig3.0
env:
- PYTHON_CFLAGS="-I/usr/include/python2.7"
- os: linux
compiler: gcc
addons:
Expand All @@ -35,7 +39,9 @@ matrix:
- liblapack-dev
- python-numpy
- python-dev
# - swig
# - swig3.0
env:
- PYTHON_CFLAGS="-I/usr/include/python2.7"
- os: linux
compiler: clang
addons:
Expand All @@ -45,8 +51,9 @@ matrix:
- liblapack-dev
- python-numpy
- python-dev
# - swig
# - swig3.0
env:
- PYTHON_CFLAGS="-I/usr/include/python2.7"
# NOTE: Hack, c.f. https:/travis-ci/travis-ci/issues/8613
- LD_LIBRARY_PATH="/usr/local/clang/lib"
- os: osx
Expand All @@ -69,8 +76,9 @@ install:
- ./.travis/install.sh
- aclocal
- autoconf
- ./configure
- ./configure --without-cuda
- make
- make -C python

script:
- make test
2 changes: 1 addition & 1 deletion .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function installswig() {
cd /tmp/ &&
wget https:/swig/swig/archive/rel-3.0.12.tar.gz &&
tar zxf rel-3.0.12.tar.gz && cd swig-rel-3.0.12 &&
./autogen.sh && ./configure --prefix "${HOME}"/swig/ 1>/dev/null &&
./autogen.sh && ./configure --prefix "${HOME}" 1>/dev/null &&
make >/dev/null &&
make install >/dev/null
}
Expand Down
54 changes: 23 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,30 @@
FROM nvidia/cuda:8.0-devel-ubuntu16.04
MAINTAINER Pierre Letessier <[email protected]>
FROM nvidia/cuda:8.0-devel-centos7

RUN apt-get update -y
RUN apt-get install -y libopenblas-dev python-numpy python-dev swig git python-pip wget
# Install MKL
RUN yum-config-manager --add-repo https://yum.repos.intel.com/mkl/setup/intel-mkl.repo
RUN rpm --import https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
RUN yum install -y intel-mkl-2019.3-062
ENV LD_LIBRARY_PATH /opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH
ENV LIBRARY_PATH /opt/intel/mkl/lib/intel64:$LIBRARY_PATH
ENV LD_PRELOAD /usr/lib64/libgomp.so.1:/opt/intel/mkl/lib/intel64/libmkl_def.so:\
/opt/intel/mkl/lib/intel64/libmkl_avx2.so:/opt/intel/mkl/lib/intel64/libmkl_core.so:\
/opt/intel/mkl/lib/intel64/libmkl_intel_lp64.so:/opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so

RUN pip install --upgrade pip
RUN pip install matplotlib
# Install necessary build tools
RUN yum install -y gcc-c++ make swig3

# Install necesary headers/libs
RUN yum install -y python-devel numpy

COPY . /opt/faiss

WORKDIR /opt/faiss

ENV BLASLDFLAGS /usr/lib/libopenblas.so.0

RUN mv example_makefiles/makefile.inc.Linux ./makefile.inc

RUN make tests/test_blas -j $(nproc) && \
make -j $(nproc) && \
make demos/demo_sift1M -j $(nproc) && \
make py

RUN cd gpu && \
make -j $(nproc) && \
make test/demo_ivfpq_indexing_gpu && \
make py

ENV PYTHONPATH $PYTHONPATH:/opt/faiss

# RUN ./tests/test_blas && \
# tests/demo_ivfpq_indexing


# RUN wget ftp://ftp.irisa.fr/local/texmex/corpus/sift.tar.gz && \
# tar xf sift.tar.gz && \
# mv sift sift1M

# RUN tests/demo_sift1M
# --with-cuda=/usr/local/cuda-8.0
RUN ./configure --without-cuda
RUN make -j $(nproc)
RUN make -C python
RUN make test
RUN make install
RUN make -C demos demo_ivfpq_indexing && \
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH ./demos/demo_ivfpq_indexing
Loading

0 comments on commit 7f5b22b

Please sign in to comment.