Update conda packages build. (#1422)

Summary:
This PR paves the way for nightly builds.

+ Get rid of cmake 3.17 manual install as cmake 3.18 is now available
in conda.
+ Update docker files for conda packages.
+ Specify CUDA architectures via CMake's `CMAKE_CUDA_ARCHITECTURES`.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/1422

Reviewed By: mdouze

Differential Revision: D23870447

Pulled By: beauby

fbshipit-source-id: 40ae7517e83356443a007a43261713e7e3a140d4
pull/1431/head
Lucas Hosseini 2020-09-23 10:16:56 -07:00 committed by Facebook GitHub Bot
parent d8af5138cd
commit 3ac3ca0fab
7 changed files with 39 additions and 57 deletions

View File

@ -1,33 +0,0 @@
FROM soumith/conda-cuda:latest
COPY ./ faiss
WORKDIR /faiss/conda
ENV FAISS_BUILD_VERSION 1.5.3
ENV FAISS_BUILD_NUMBER 0
RUN conda build faiss --no-anaconda-upload -c pytorch
RUN CUDA_ROOT=/usr/local/cuda-8.0 \
CUDA_ARCH="-gencode=arch=compute_35,code=compute_35 \
-gencode=arch=compute_52,code=compute_52 \
-gencode=arch=compute_60,code=compute_60 \
-gencode=arch=compute_61,code=compute_61" \
conda build faiss-gpu --variants '{ "cudatoolkit": "8.0" }' \
--no-anaconda-upload -c pytorch --no-test
RUN CUDA_ROOT=/usr/local/cuda-9.0 \
CUDA_ARCH="-gencode=arch=compute_35,code=compute_35 \
-gencode=arch=compute_52,code=compute_52 \
-gencode=arch=compute_60,code=compute_60 \
-gencode=arch=compute_61,code=compute_61 \
-gencode=arch=compute_70,code=compute_70" \
conda build faiss-gpu --variants '{ "cudatoolkit": "9.0" }' \
--no-anaconda-upload -c pytorch --no-test
RUN CUDA_ROOT=/usr/local/cuda-10.0 \
CUDA_ARCH="-gencode=arch=compute_35,code=compute_35 \
-gencode=arch=compute_52,code=compute_52 \
-gencode=arch=compute_60,code=compute_60 \
-gencode=arch=compute_61,code=compute_61 \
-gencode=arch=compute_70,code=compute_70 \
-gencode=arch=compute_72,code=compute_72 \
-gencode=arch=compute_75,code=compute_75" \
conda build faiss-gpu --variants '{ "cudatoolkit": "10.0" }' \
--no-anaconda-upload -c pytorch --no-test

View File

@ -0,0 +1,14 @@
FROM nvidia/cuda:10.2-devel-ubuntu18.04
RUN apt-get update && apt-get install -y wget git
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash Miniconda3-latest-Linux-x86_64.sh -b -p ~/miniconda3
ENV PATH="/root/miniconda3/condabin:${PATH}"
RUN conda install conda-build
COPY ./ faiss
WORKDIR /faiss/conda
RUN conda build faiss --no-anaconda-upload -c pytorch

View File

@ -0,0 +1,16 @@
FROM nvidia/cuda:10.2-devel-ubuntu18.04
RUN apt-get update && apt-get install -y wget git libcublas-dev
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash Miniconda3-latest-Linux-x86_64.sh -b -p ~/miniconda3
ENV PATH="/root/miniconda3/condabin:${PATH}"
RUN conda install conda-build
COPY ./ faiss
WORKDIR /faiss/conda
RUN CUDA_ARCHS="35;52;60;61;70;72;75" \
conda build faiss-gpu --variants '{ "cudatoolkit": "10.2" }' \
--no-anaconda-upload -c pytorch --no-test

View File

@ -1,7 +1,6 @@
CONDA_BUILD_SYSROOT: CONDA_BUILD_SYSROOT:
- /opt/MacOSX10.9.sdk # [osx] - /opt/MacOSX10.9.sdk # [osx]
python: python:
- 2.7 # [not win]
- 3.6 - 3.6
- 3.7 - 3.7
- 3.8 - 3.8

View File

@ -13,6 +13,7 @@ cmake -B _build_avx2 \
-DBUILD_TESTING=OFF \ -DBUILD_TESTING=OFF \
-DFAISS_OPT_LEVEL=avx2 \ -DFAISS_OPT_LEVEL=avx2 \
-DFAISS_ENABLE_GPU=ON \ -DFAISS_ENABLE_GPU=ON \
-DCMAKE_CUDA_ARCHITECTURES="${CUDA_ARCHS}" \
-DFAISS_ENABLE_PYTHON=OFF \ -DFAISS_ENABLE_PYTHON=OFF \
-DBLA_VENDOR=Intel10_64lp \ -DBLA_VENDOR=Intel10_64lp \
-DCMAKE_BUILD_TYPE=Release . -DCMAKE_BUILD_TYPE=Release .
@ -28,6 +29,7 @@ cmake -B _build_generic \
-DBUILD_SHARED_LIBS=ON \ -DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \ -DBUILD_TESTING=OFF \
-DFAISS_ENABLE_GPU=ON \ -DFAISS_ENABLE_GPU=ON \
-DCMAKE_CUDA_ARCHITECTURES="${CUDA_ARCHS}" \
-DFAISS_ENABLE_PYTHON=OFF \ -DFAISS_ENABLE_PYTHON=OFF \
-DBLA_VENDOR=Intel10_64lp \ -DBLA_VENDOR=Intel10_64lp \
-DCMAKE_BUILD_TYPE=Release . -DCMAKE_BUILD_TYPE=Release .

View File

@ -30,11 +30,13 @@ outputs:
string: "h{{ PKG_HASH }}_{{ number }}_cuda{{ cudatoolkit }}" string: "h{{ PKG_HASH }}_{{ number }}_cuda{{ cudatoolkit }}"
run_exports: run_exports:
- {{ pin_compatible('libfaiss', exact=True) }} - {{ pin_compatible('libfaiss', exact=True) }}
script_env:
- CUDA_ARCHS
requirements: requirements:
build: build:
- {{ compiler('cxx') }} - {{ compiler('cxx') }}
- llvm-openmp # [osx] - llvm-openmp # [osx]
- cmake-local - cmake >=3.18
host: host:
- mkl >=2018 - mkl >=2018
- blas =*=mkl - blas =*=mkl
@ -42,7 +44,7 @@ outputs:
run: run:
- mkl >=2018 - mkl >=2018
- blas =*=mkl - blas =*=mkl
- {{ pin_compatible('cudatoolkit') }} - {{ pin_compatible('cudatoolkit', max_pin='x') }}
test: test:
commands: commands:
- test -f $PREFIX/lib/libfaiss.so # [linux] - test -f $PREFIX/lib/libfaiss.so # [linux]
@ -58,7 +60,7 @@ outputs:
build: build:
- {{ compiler('cxx') }} - {{ compiler('cxx') }}
- swig - swig
- cmake-local - cmake >=3.17
host: host:
- python {{ python }} - python {{ python }}
- numpy 1.11.* - numpy 1.11.*
@ -76,10 +78,3 @@ outputs:
- python -m unittest discover faiss/gpu/test/ - python -m unittest discover faiss/gpu/test/
source_files: source_files:
- tests/ - tests/
- name: cmake-local
version: 3.17
script: install-cmake.sh
requirements:
build:
- {{ compiler('cxx') }}

View File

@ -35,8 +35,7 @@ outputs:
build: build:
- {{ compiler('cxx') }} - {{ compiler('cxx') }}
- llvm-openmp # [osx] - llvm-openmp # [osx]
- cmake >=3.17 # [win] - cmake >=3.17
- cmake-local # [not win]
host: host:
- mkl-devel >=2018 - mkl-devel >=2018
- blas =*=mkl - blas =*=mkl
@ -59,8 +58,7 @@ outputs:
build: build:
- {{ compiler('cxx') }} - {{ compiler('cxx') }}
- swig - swig
- cmake >=3.17 # [win] - cmake >=3.17
- cmake-local # [not win]
host: host:
- python {{ python }} - python {{ python }}
- numpy 1.11.* - numpy 1.11.*
@ -77,12 +75,3 @@ outputs:
- python -m unittest discover tests/ - python -m unittest discover tests/
source_files: source_files:
- tests/ - tests/
- name: cmake-local
version: 3.17
script: install-cmake.sh
build:
skip: True # [win]
requirements:
build:
- {{ compiler('cxx') }}