Skip to content

Commit 7f5b22b

Browse files
authored
Add conda packages metadata + tests. (#769)
+ 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).
1 parent 6c1cb3c commit 7f5b22b

34 files changed

+2435
-200269
lines changed

.travis.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ matrix:
1515
- liblapack-dev
1616
- python-numpy
1717
- python-dev
18-
# - swig
18+
# - swig3.0
19+
env:
20+
- PYTHON_CFLAGS="-I/usr/include/python2.7"
1921
- os: linux
2022
compiler: gcc
2123
addons:
@@ -25,7 +27,9 @@ matrix:
2527
- liblapack-dev
2628
- python-numpy
2729
- python-dev
28-
# - swig
30+
# - swig3.0
31+
env:
32+
- PYTHON_CFLAGS="-I/usr/include/python2.7"
2933
- os: linux
3034
compiler: gcc
3135
addons:
@@ -35,7 +39,9 @@ matrix:
3539
- liblapack-dev
3640
- python-numpy
3741
- python-dev
38-
# - swig
42+
# - swig3.0
43+
env:
44+
- PYTHON_CFLAGS="-I/usr/include/python2.7"
3945
- os: linux
4046
compiler: clang
4147
addons:
@@ -45,8 +51,9 @@ matrix:
4551
- liblapack-dev
4652
- python-numpy
4753
- python-dev
48-
# - swig
54+
# - swig3.0
4955
env:
56+
- PYTHON_CFLAGS="-I/usr/include/python2.7"
5057
# NOTE: Hack, c.f. https://github.com/travis-ci/travis-ci/issues/8613
5158
- LD_LIBRARY_PATH="/usr/local/clang/lib"
5259
- os: osx
@@ -69,8 +76,9 @@ install:
6976
- ./.travis/install.sh
7077
- aclocal
7178
- autoconf
72-
- ./configure
79+
- ./configure --without-cuda
7380
- make
81+
- make -C python
7482

7583
script:
7684
- make test

.travis/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function installswig() {
77
cd /tmp/ &&
88
wget https://github.com/swig/swig/archive/rel-3.0.12.tar.gz &&
99
tar zxf rel-3.0.12.tar.gz && cd swig-rel-3.0.12 &&
10-
./autogen.sh && ./configure --prefix "${HOME}"/swig/ 1>/dev/null &&
10+
./autogen.sh && ./configure --prefix "${HOME}" 1>/dev/null &&
1111
make >/dev/null &&
1212
make install >/dev/null
1313
}

Dockerfile

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,30 @@
1-
FROM nvidia/cuda:8.0-devel-ubuntu16.04
2-
MAINTAINER Pierre Letessier <[email protected]>
1+
FROM nvidia/cuda:8.0-devel-centos7
32

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

7-
RUN pip install --upgrade pip
8-
RUN pip install matplotlib
13+
# Install necessary build tools
14+
RUN yum install -y gcc-c++ make swig3
15+
16+
# Install necesary headers/libs
17+
RUN yum install -y python-devel numpy
918

1019
COPY . /opt/faiss
1120

1221
WORKDIR /opt/faiss
1322

14-
ENV BLASLDFLAGS /usr/lib/libopenblas.so.0
15-
16-
RUN mv example_makefiles/makefile.inc.Linux ./makefile.inc
17-
18-
RUN make tests/test_blas -j $(nproc) && \
19-
make -j $(nproc) && \
20-
make demos/demo_sift1M -j $(nproc) && \
21-
make py
22-
23-
RUN cd gpu && \
24-
make -j $(nproc) && \
25-
make test/demo_ivfpq_indexing_gpu && \
26-
make py
27-
28-
ENV PYTHONPATH $PYTHONPATH:/opt/faiss
29-
30-
# RUN ./tests/test_blas && \
31-
# tests/demo_ivfpq_indexing
32-
33-
34-
# RUN wget ftp://ftp.irisa.fr/local/texmex/corpus/sift.tar.gz && \
35-
# tar xf sift.tar.gz && \
36-
# mv sift sift1M
37-
38-
# RUN tests/demo_sift1M
23+
# --with-cuda=/usr/local/cuda-8.0
24+
RUN ./configure --without-cuda
25+
RUN make -j $(nproc)
26+
RUN make -C python
27+
RUN make test
28+
RUN make install
29+
RUN make -C demos demo_ivfpq_indexing && \
30+
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH ./demos/demo_ivfpq_indexing

0 commit comments

Comments
 (0)