From d50fe624b0c10c47144b91e8705f0433864d4362 Mon Sep 17 00:00:00 2001 From: regro-cf-autotick-bot <36490558+regro-cf-autotick-bot@users.noreply.github.com> Date: Mon, 23 Nov 2020 18:25:02 +0000 Subject: [PATCH 01/11] Rebuild for windows_cuda --- .ci_support/migrations/windows_cuda.yaml | 45 ++++++++++++++++++++++++ recipe/meta.yaml | 4 +-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 .ci_support/migrations/windows_cuda.yaml diff --git a/.ci_support/migrations/windows_cuda.yaml b/.ci_support/migrations/windows_cuda.yaml new file mode 100644 index 00000000..8a28aa68 --- /dev/null +++ b/.ci_support/migrations/windows_cuda.yaml @@ -0,0 +1,45 @@ +migrator_ts: 1604255168 +__migrator: + kind: + version + migration_number: + 1 + build_number: + 1 + override_cbc_keys: + - cuda_compiler_stub + +cuda_compiler: # [linux64 or win] + - nvcc # [linux64 or win] +cuda_compiler_version: + - None + - 9.2 # [linux64] + - 10.0 # [linux64 or win] + - 10.1 # [linux64 or win] + - 10.2 # [linux64 or win] + - 11.0 # [linux64 or win] + + +# cdt_name: # [os.environ.get("BUILD_PLATFORM", "").startswith("linux") or (os.environ.get("CONFIG_VERSION", "1") == "1" and linux)] +# - cos6 # [os.environ.get("BUILD_PLATFORM") == "linux-64" or (os.environ.get("CONFIG_VERSION", "1") == "1" and linux64)] +# - cos7 # [os.environ.get("BUILD_PLATFORM") == "linux-aarch64" or (os.environ.get("CONFIG_VERSION", "1") == "1" and aarch64)] +# - cos7 # [os.environ.get("BUILD_PLATFORM") == "linux-ppc64le" or (os.environ.get("CONFIG_VERSION", "1") == "1" and ppc64le)] +# - cos7 # [os.environ.get("BUILD_PLATFORM") == "linux-armv7l" or (os.environ.get("CONFIG_VERSION", "1") == "1" and armv7l)] +# +# - cos6 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] +# - cos6 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] +# - cos6 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] +# - cos6 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] +# - cos7 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] + +docker_image: # [os.environ.get("BUILD_PLATFORM", "").startswith("linux") or (os.environ.get("CONFIG_VERSION", "1") == "1" and linux)] + - quay.io/condaforge/linux-anvil-comp7 # [os.environ.get("BUILD_PLATFORM") == "linux-64" or (os.environ.get("CONFIG_VERSION", "1") == "1" and linux64)] + - quay.io/condaforge/linux-anvil-aarch64 # [os.environ.get("BUILD_PLATFORM") == "linux-aarch64" or (os.environ.get("CONFIG_VERSION", "1") == "1" and aarch64)] + - quay.io/condaforge/linux-anvil-ppc64le # [os.environ.get("BUILD_PLATFORM") == "linux-ppc64le" or (os.environ.get("CONFIG_VERSION", "1") == "1" and ppc64le)] + - quay.io/condaforge/linux-anvil-armv7l # [os.environ.get("BUILD_PLATFORM") == "linux-armv7l" or (os.environ.get("CONFIG_VERSION", "1") == "1" and armv7l)] + + - quay.io/condaforge/linux-anvil-cuda:9.2 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] + - quay.io/condaforge/linux-anvil-cuda:10.0 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] + - quay.io/condaforge/linux-anvil-cuda:10.1 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] + - quay.io/condaforge/linux-anvil-cuda:10.2 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] + - quay.io/condaforge/linux-anvil-cuda:11.0 # [linux64 and (os.environ.get("BUILD_PLATFORM") == "linux-64" or os.environ.get("CONFIG_VERSION", "1") == "1")] diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8e0b8b6d..fbaf412b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -79,8 +79,8 @@ source: build: number: {{ number }} - # GPU version only for linux - skip: true # [(win or osx) and cuda_compiler_version != "None"] + # GPU version for linux64 & win + skip: true # [osx and cuda_compiler_version != "None"] requirements: build: From b735c901b06d4f471d6acb4e86028bae589cda23 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 10 Dec 2020 00:04:47 +0100 Subject: [PATCH 02/11] update windows build scripts to enable GPU builds --- recipe/build-lib.bat | 43 ++++++++++++++++++++++++++++++++++++++++++- recipe/build-pkg.bat | 23 ++++++++++++++++++++++- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/recipe/build-lib.bat b/recipe/build-lib.bat index 9b97b2e6..302217eb 100644 --- a/recipe/build-lib.bat +++ b/recipe/build-lib.bat @@ -1,14 +1,55 @@ +SetLocal EnableDelayedExpansion + +if "%cuda_compiler_version%"=="None" ( + set "FAISS_ENABLE_GPU=OFF" + set "CUDA_CONFIG_ARGS=" +) else ( + set "FAISS_ENABLE_GPU=ON" + + REM for documentation see e.g. + REM docs.nvidia.com/cuda/cuda-c-best-practices-guide/index.html#building-for-maximum-compatibility + REM docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#major-components__table-cuda-toolkit-driver-versions + REM docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-feature-list + + REM for -real vs. -virtual, see cmake.org/cmake/help/latest/prop_tgt/CUDA_ARCHITECTURES.html + REM this is to support PTX JIT compilation; see first link above or cf. + REM devblogs.nvidia.com/cuda-pro-tip-understand-fat-binaries-jit-caching + + REM windows support start with cuda 10.0 + REM %MY_VAR:~0,2% selects first two characters + if "%cuda_compiler_version:~0,2%"=="10" ( + set "CMAKE_CUDA_ARCHS=35-virtual;50-virtual;52-virtual;60-virtual;61-virtual;70-virtual;75-virtual;75-real" + ) + if "%cuda_compiler_version:~0,2%"=="11" ( + REM cuda 11.0 deprecates arches 35, 50 + set "CMAKE_CUDA_ARCHS=52-virtual;60-virtual;61-virtual;70-virtual;75-virtual;80-virtual;80-real" + ) + + REM workaround for https://github.com/conda-forge/nvcc-feedstock/issues/53 + set "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%cuda_compiler_version%" + echo "Setting workaround CUDA_PATH=!CUDA_PATH!" + set "CUDA_HOME=!CUDA_PATH!" + REM With %MY_VAR:\=/% we replace backslashes with forward slashes + REM set "CUDA_TOOLKIT_ROOT_DIR=!CUDA_PATH:\=/!" + + set "CUDA_CONFIG_ARGS=-DCMAKE_CUDA_ARCHITECTURES=!CMAKE_CUDA_ARCHS! -DCUDAToolkit_ROOT=!CUDA_PATH!" + + REM cmake does not generate output for the call below; echo some info + echo "Set up extra cmake-args: CUDA_CONFIG_ARGS=!CUDA_CONFIG_ARGS!" +) + :: Build faiss.dll cmake -B _build ^ -DBUILD_SHARED_LIBS=ON ^ -DBUILD_TESTING=OFF ^ - -DFAISS_ENABLE_GPU=OFF ^ -DFAISS_ENABLE_PYTHON=OFF ^ + -DFAISS_ENABLE_GPU=!FAISS_ENABLE_GPU! ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^ -DCMAKE_INSTALL_BINDIR="%LIBRARY_BIN%" ^ -DCMAKE_INSTALL_LIBDIR="%LIBRARY_LIB%" ^ -DCMAKE_INSTALL_INCLUDEDIR="%LIBRARY_INC%" ^ + !CUDA_CONFIG_ARGS! ^ . if %ERRORLEVEL% neq 0 exit 1 diff --git a/recipe/build-pkg.bat b/recipe/build-pkg.bat index 0af669a0..2b66af71 100644 --- a/recipe/build-pkg.bat +++ b/recipe/build-pkg.bat @@ -1,9 +1,30 @@ +SetLocal EnableDelayedExpansion + +if "%cuda_compiler_version%"=="None" ( + set FAISS_ENABLE_GPU="OFF" +) else ( + set FAISS_ENABLE_GPU="ON" + + REM workaround for https://github.com/conda-forge/nvcc-feedstock/issues/53 + set "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%cuda_compiler_version%" + echo "Setting workaround CUDA_PATH=!CUDA_PATH!" + set "CUDA_HOME=!CUDA_PATH!" + REM With %MY_VAR:\=/% we replace backslashes with forward slashes + REM set "CUDA_TOOLKIT_ROOT_DIR=!CUDA_PATH:\=/!" + + set "CUDA_CONFIG_ARGS=-DCUDAToolkit_ROOT=!CUDA_PATH!" + + REM cmake does not generate output for the call below; echo some info + echo "Set up extra cmake-args: CUDA_CONFIG_ARGS=!CUDA_CONFIG_ARGS!" +) + :: Build vanilla version (no avx2). :: Do not use the Python3_* variants for cmake cmake -B _build_python ^ - -DFAISS_ENABLE_GPU=OFF ^ + -DFAISS_ENABLE_GPU=!FAISS_ENABLE_GPU! ^ -DCMAKE_BUILD_TYPE=Release ^ -DPython_EXECUTABLE="%PYTHON%" ^ + !CUDA_CONFIG_ARGS! ^ faiss/python if %ERRORLEVEL% neq 0 exit 1 From 23b57c718d36bb86ea69275aeffd91ccdf5eeb08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Tue, 15 Dec 2020 14:19:01 +0100 Subject: [PATCH 03/11] Debug VS / nvcc integration Co-Authored-By: H. Vetinari --- recipe/build-lib.bat | 16 ++++++++-------- recipe/build-pkg.bat | 17 ++++++----------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/recipe/build-lib.bat b/recipe/build-lib.bat index 302217eb..0a57844d 100644 --- a/recipe/build-lib.bat +++ b/recipe/build-lib.bat @@ -25,17 +25,17 @@ if "%cuda_compiler_version%"=="None" ( set "CMAKE_CUDA_ARCHS=52-virtual;60-virtual;61-virtual;70-virtual;75-virtual;80-virtual;80-real" ) - REM workaround for https://github.com/conda-forge/nvcc-feedstock/issues/53 - set "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%cuda_compiler_version%" - echo "Setting workaround CUDA_PATH=!CUDA_PATH!" - set "CUDA_HOME=!CUDA_PATH!" - REM With %MY_VAR:\=/% we replace backslashes with forward slashes - REM set "CUDA_TOOLKIT_ROOT_DIR=!CUDA_PATH:\=/!" + REM See more extensive comment in build-lib.sh + REM TODO: Fix this in nvcc-feedstock or cmake-feedstock. + del %BUILD_PREFIX%\bin\nvcc.bat - set "CUDA_CONFIG_ARGS=-DCMAKE_CUDA_ARCHITECTURES=!CMAKE_CUDA_ARCHS! -DCUDAToolkit_ROOT=!CUDA_PATH!" + REM ... and another workaround just to cover more bases + set "CudaToolkitDir=%CUDA_PATH%" + set "CUDAToolkit_ROOT=%CUDA_PATH%" + set CUDA_CONFIG_ARGS=-DCMAKE_CUDA_ARCHITECTURES=!CMAKE_CUDA_ARCHS! REM cmake does not generate output for the call below; echo some info - echo "Set up extra cmake-args: CUDA_CONFIG_ARGS=!CUDA_CONFIG_ARGS!" + echo Set up extra cmake-args: CUDA_CONFIG_ARGS=!CUDA_CONFIG_ARGS! ) :: Build faiss.dll diff --git a/recipe/build-pkg.bat b/recipe/build-pkg.bat index 2b66af71..49ab3e0b 100644 --- a/recipe/build-pkg.bat +++ b/recipe/build-pkg.bat @@ -5,17 +5,13 @@ if "%cuda_compiler_version%"=="None" ( ) else ( set FAISS_ENABLE_GPU="ON" - REM workaround for https://github.com/conda-forge/nvcc-feedstock/issues/53 - set "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%cuda_compiler_version%" - echo "Setting workaround CUDA_PATH=!CUDA_PATH!" - set "CUDA_HOME=!CUDA_PATH!" - REM With %MY_VAR:\=/% we replace backslashes with forward slashes - REM set "CUDA_TOOLKIT_ROOT_DIR=!CUDA_PATH:\=/!" + REM See more extensive comment in build-pkg.sh + REM TODO: Fix this in nvcc-feedstock or cmake-feedstock. + del %BUILD_PREFIX%\bin\nvcc.bat - set "CUDA_CONFIG_ARGS=-DCUDAToolkit_ROOT=!CUDA_PATH!" - - REM cmake does not generate output for the call below; echo some info - echo "Set up extra cmake-args: CUDA_CONFIG_ARGS=!CUDA_CONFIG_ARGS!" + REM ... and another workaround just to cover more bases + set "CudaToolkitDir=%CUDA_PATH%" + set "CUDAToolkit_ROOT=%CUDA_PATH%" ) :: Build vanilla version (no avx2). @@ -24,7 +20,6 @@ cmake -B _build_python ^ -DFAISS_ENABLE_GPU=!FAISS_ENABLE_GPU! ^ -DCMAKE_BUILD_TYPE=Release ^ -DPython_EXECUTABLE="%PYTHON%" ^ - !CUDA_CONFIG_ARGS! ^ faiss/python if %ERRORLEVEL% neq 0 exit 1 From 2dcfe4b8410f69cb2f3285e80558a18f7dc45cf3 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 4 Feb 2021 23:21:10 +0100 Subject: [PATCH 04/11] add upstream commit for missing includes --- recipe/meta.yaml | 4 +- recipe/patches/0001-use-c-14.patch | 2 +- ...ers-in-faiss-gpu-CMakeLists.txt-1666.patch | 2 +- ...003-update-util-guard-for-compute_86.patch | 2 +- ...missing-includes-for-std-min-std-max.patch | 116 ++++++++++++++++++ 5 files changed, 122 insertions(+), 4 deletions(-) create mode 100644 recipe/patches/0004-Add-missing-includes-for-std-min-std-max.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index fbaf412b..17dcf5c0 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -74,8 +74,10 @@ source: - patches/0001-use-c-14.patch # backport of facebookresearch/faiss#1666, can be dropped for ver>1.7.0 - patches/0002-Add-missing-headers-in-faiss-gpu-CMakeLists.txt-1666.patch - # update version-guard to build for compute_86 + # update version-guard to build for compute_86, can be dropped for ver>1.7.0 - patches/0003-update-util-guard-for-compute_86.patch + # single commit from facebookresearch/faiss#1610 + - patches/0004-Add-missing-includes-for-std-min-std-max.patch build: number: {{ number }} diff --git a/recipe/patches/0001-use-c-14.patch b/recipe/patches/0001-use-c-14.patch index a852b4be..bb1ca10c 100644 --- a/recipe/patches/0001-use-c-14.patch +++ b/recipe/patches/0001-use-c-14.patch @@ -1,7 +1,7 @@ From 1b4e6f16de1bc6e6e7a104647625f45956356df5 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 26 Oct 2020 22:44:44 +0100 -Subject: [PATCH 1/3] use c++14 +Subject: [PATCH 1/4] use c++14 --- CMakeLists.txt | 2 +- diff --git a/recipe/patches/0002-Add-missing-headers-in-faiss-gpu-CMakeLists.txt-1666.patch b/recipe/patches/0002-Add-missing-headers-in-faiss-gpu-CMakeLists.txt-1666.patch index b715ff75..86155b9c 100644 --- a/recipe/patches/0002-Add-missing-headers-in-faiss-gpu-CMakeLists.txt-1666.patch +++ b/recipe/patches/0002-Add-missing-headers-in-faiss-gpu-CMakeLists.txt-1666.patch @@ -1,7 +1,7 @@ From e4b94c8a5ad0fc7632cf05006865dbd8feac2ed4 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 4 Feb 2021 09:21:21 -0800 -Subject: [PATCH 2/3] Add missing headers in faiss/[gpu/]CMakeLists.txt (#1666) +Subject: [PATCH 2/4] Add missing headers in faiss/[gpu/]CMakeLists.txt (#1666) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/recipe/patches/0003-update-util-guard-for-compute_86.patch b/recipe/patches/0003-update-util-guard-for-compute_86.patch index ff8d4bec..2ff34ce2 100644 --- a/recipe/patches/0003-update-util-guard-for-compute_86.patch +++ b/recipe/patches/0003-update-util-guard-for-compute_86.patch @@ -1,7 +1,7 @@ From 84b98debfb92145a55e932aeb74eb0358ed15512 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 17 Feb 2021 18:16:11 +0100 -Subject: [PATCH 3/3] update util-guard for compute_86 +Subject: [PATCH 3/4] update util-guard for compute_86 --- faiss/gpu/utils/DeviceDefs.cuh | 2 +- diff --git a/recipe/patches/0004-Add-missing-includes-for-std-min-std-max.patch b/recipe/patches/0004-Add-missing-includes-for-std-min-std-max.patch new file mode 100644 index 00000000..e35d0e52 --- /dev/null +++ b/recipe/patches/0004-Add-missing-includes-for-std-min-std-max.patch @@ -0,0 +1,116 @@ +From c76bdcca995efee62144f0efbfdff1d7c7c3957c Mon Sep 17 00:00:00 2001 +From: Lucas Hosseini +Date: Thu, 7 Jan 2021 12:21:42 +0100 +Subject: [PATCH 4/4] Add missing includes for std::min/std::max. + +--- + faiss/gpu/GpuIndex.cu | 1 + + faiss/gpu/impl/DistanceUtils.cuh | 2 ++ + faiss/gpu/impl/IVFAppend.cu | 1 + + faiss/gpu/impl/IVFFlatScan.cu | 1 + + faiss/gpu/impl/IVFUtils.cu | 1 + + faiss/gpu/impl/L2Norm.cu | 1 + + faiss/gpu/impl/PQScanMultiPassPrecomputed.cu | 1 + + faiss/gpu/impl/VectorResidual.cu | 1 + + 8 files changed, 9 insertions(+) + +diff --git a/faiss/gpu/GpuIndex.cu b/faiss/gpu/GpuIndex.cu +index 0b73c1bd..f96a0b30 100644 +--- a/faiss/gpu/GpuIndex.cu ++++ b/faiss/gpu/GpuIndex.cu +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + #include + +diff --git a/faiss/gpu/impl/DistanceUtils.cuh b/faiss/gpu/impl/DistanceUtils.cuh +index 42d815a5..76db12f7 100644 +--- a/faiss/gpu/impl/DistanceUtils.cuh ++++ b/faiss/gpu/impl/DistanceUtils.cuh +@@ -8,6 +8,8 @@ + + #pragma once + ++#include ++ + #include + + // +diff --git a/faiss/gpu/impl/IVFAppend.cu b/faiss/gpu/impl/IVFAppend.cu +index 178d1662..e0530318 100644 +--- a/faiss/gpu/impl/IVFAppend.cu ++++ b/faiss/gpu/impl/IVFAppend.cu +@@ -5,6 +5,7 @@ + * LICENSE file in the root directory of this source tree. + */ + ++#include + + #include + #include +diff --git a/faiss/gpu/impl/IVFFlatScan.cu b/faiss/gpu/impl/IVFFlatScan.cu +index 99eb47e4..2917357b 100644 +--- a/faiss/gpu/impl/IVFFlatScan.cu ++++ b/faiss/gpu/impl/IVFFlatScan.cu +@@ -5,6 +5,7 @@ + * LICENSE file in the root directory of this source tree. + */ + ++#include + + #include + #include +diff --git a/faiss/gpu/impl/IVFUtils.cu b/faiss/gpu/impl/IVFUtils.cu +index f94ba414..020ce35c 100644 +--- a/faiss/gpu/impl/IVFUtils.cu ++++ b/faiss/gpu/impl/IVFUtils.cu +@@ -5,6 +5,7 @@ + * LICENSE file in the root directory of this source tree. + */ + ++#include + + #include + #include +diff --git a/faiss/gpu/impl/L2Norm.cu b/faiss/gpu/impl/L2Norm.cu +index f2243ea4..6113aa0f 100644 +--- a/faiss/gpu/impl/L2Norm.cu ++++ b/faiss/gpu/impl/L2Norm.cu +@@ -5,6 +5,7 @@ + * LICENSE file in the root directory of this source tree. + */ + ++#include + + #include + #include +diff --git a/faiss/gpu/impl/PQScanMultiPassPrecomputed.cu b/faiss/gpu/impl/PQScanMultiPassPrecomputed.cu +index 5eae1134..6334f2dc 100644 +--- a/faiss/gpu/impl/PQScanMultiPassPrecomputed.cu ++++ b/faiss/gpu/impl/PQScanMultiPassPrecomputed.cu +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + #include + + namespace faiss { namespace gpu { +diff --git a/faiss/gpu/impl/VectorResidual.cu b/faiss/gpu/impl/VectorResidual.cu +index 078e6604..35f5db5a 100644 +--- a/faiss/gpu/impl/VectorResidual.cu ++++ b/faiss/gpu/impl/VectorResidual.cu +@@ -11,6 +11,7 @@ + #include + #include + #include ++#include + #include // in CUDA SDK, for CUDART_NAN_F + + namespace faiss { namespace gpu { +-- +2.29.2.windows.3 + From 6c95ab31bf71d3ff97689400503925a454e6ad91 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 4 Feb 2021 23:32:59 +0100 Subject: [PATCH 05/11] run test suite with pytest --- recipe/meta.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 17dcf5c0..fc7d2c29 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -177,16 +177,16 @@ outputs: # - blas * *{{ blas_impl }} # testing with MKL, as upstream considers this the most important - blas =*=mkl - # this is necessary for a single test in the test suite - scipy + - pytest source_files: - tests/ imports: - faiss commands: - - python -m unittest discover tests + - pytest tests -v # running the following test requires an actual GPU device, which is not available in CI - # - python -m unittest discover faiss/gpu/test/ + # - pytest faiss/gpu/test/ -v # for compatibility with (& ease of migration from) existing packages in the pytorch channel - name: faiss-cpu From 25d0c7a617a4048c42a599cd8a8931bbc0107f35 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 17 Feb 2021 07:41:04 +0100 Subject: [PATCH 06/11] remove compiler pin for linux --- recipe/conda_build_config.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 4211237d..80298a04 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,6 +1,3 @@ -cxx_compiler_version: # [unix] +cxx_compiler_version: # [osx] # need to downgrade on osx due to a bug that breaks the test suite - 10 # [osx] - # need to downgrade on linux due to nvcc 9.2 not being able to deal with gcc>7, - # and conda-build not being able to zip this with cuda_compiler_version - - 7 # [linux] From beeae66c591f006558c8c71971af4f4c22474b1b Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 17 Feb 2021 09:43:46 +0100 Subject: [PATCH 07/11] add echo to bat-scripts --- recipe/build-lib.bat | 2 ++ recipe/build-pkg.bat | 2 ++ 2 files changed, 4 insertions(+) diff --git a/recipe/build-lib.bat b/recipe/build-lib.bat index 0a57844d..41b10282 100644 --- a/recipe/build-lib.bat +++ b/recipe/build-lib.bat @@ -1,3 +1,5 @@ +@echo on + SetLocal EnableDelayedExpansion if "%cuda_compiler_version%"=="None" ( diff --git a/recipe/build-pkg.bat b/recipe/build-pkg.bat index 49ab3e0b..c7b282ae 100644 --- a/recipe/build-pkg.bat +++ b/recipe/build-pkg.bat @@ -1,3 +1,5 @@ +@echo on + SetLocal EnableDelayedExpansion if "%cuda_compiler_version%"=="None" ( From aa27e65cda086a8dfd9cb920c5f0af199b142eaf Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 17 Feb 2021 09:48:06 +0100 Subject: [PATCH 08/11] MNT: Re-rendered with conda-build 3.21.4, conda-smithy 3.8.6, and conda-forge-pinning 2021.02.17.06.54.06 --- .azure-pipelines/azure-pipelines-win.yml | 12 +++++++ .../win_64_cuda_compiler_version10.2.yaml | 33 +++++++++++++++++++ .../win_64_cuda_compiler_version11.0.yaml | 33 +++++++++++++++++++ .../win_64_cuda_compiler_version11.1.yaml | 33 +++++++++++++++++++ .../win_64_cuda_compiler_version11.2.yaml | 33 +++++++++++++++++++ .../win_64_cuda_compiler_versionNone.yaml | 2 ++ README.md | 28 ++++++++++++++++ 7 files changed, 174 insertions(+) create mode 100644 .ci_support/win_64_cuda_compiler_version10.2.yaml create mode 100644 .ci_support/win_64_cuda_compiler_version11.0.yaml create mode 100644 .ci_support/win_64_cuda_compiler_version11.1.yaml create mode 100644 .ci_support/win_64_cuda_compiler_version11.2.yaml diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 956b996f..d81dc373 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -8,6 +8,18 @@ jobs: vmImage: vs2017-win2016 strategy: matrix: + win_64_cuda_compiler_version10.2: + CONFIG: win_64_cuda_compiler_version10.2 + UPLOAD_PACKAGES: 'True' + win_64_cuda_compiler_version11.0: + CONFIG: win_64_cuda_compiler_version11.0 + UPLOAD_PACKAGES: 'True' + win_64_cuda_compiler_version11.1: + CONFIG: win_64_cuda_compiler_version11.1 + UPLOAD_PACKAGES: 'True' + win_64_cuda_compiler_version11.2: + CONFIG: win_64_cuda_compiler_version11.2 + UPLOAD_PACKAGES: 'True' win_64_cuda_compiler_versionNone: CONFIG: win_64_cuda_compiler_versionNone UPLOAD_PACKAGES: 'True' diff --git a/.ci_support/win_64_cuda_compiler_version10.2.yaml b/.ci_support/win_64_cuda_compiler_version10.2.yaml new file mode 100644 index 00000000..b1251522 --- /dev/null +++ b/.ci_support/win_64_cuda_compiler_version10.2.yaml @@ -0,0 +1,33 @@ +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '10.2' +cxx_compiler: +- vs2017 +libblas: +- 3.8 *netlib +liblapack: +- 3.8 *netlib +numpy: +- '1.16' +- '1.16' +- '1.16' +- '1.19' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.6.* *_cpython +- 3.7.* *_cpython +- 3.8.* *_cpython +- 3.9.* *_cpython +target_platform: +- win-64 +zip_keys: +- - numpy + - python diff --git a/.ci_support/win_64_cuda_compiler_version11.0.yaml b/.ci_support/win_64_cuda_compiler_version11.0.yaml new file mode 100644 index 00000000..1586d850 --- /dev/null +++ b/.ci_support/win_64_cuda_compiler_version11.0.yaml @@ -0,0 +1,33 @@ +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.0' +cxx_compiler: +- vs2017 +libblas: +- 3.8 *netlib +liblapack: +- 3.8 *netlib +numpy: +- '1.16' +- '1.16' +- '1.16' +- '1.19' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.6.* *_cpython +- 3.7.* *_cpython +- 3.8.* *_cpython +- 3.9.* *_cpython +target_platform: +- win-64 +zip_keys: +- - numpy + - python diff --git a/.ci_support/win_64_cuda_compiler_version11.1.yaml b/.ci_support/win_64_cuda_compiler_version11.1.yaml new file mode 100644 index 00000000..f54dfd72 --- /dev/null +++ b/.ci_support/win_64_cuda_compiler_version11.1.yaml @@ -0,0 +1,33 @@ +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.1' +cxx_compiler: +- vs2017 +libblas: +- 3.8 *netlib +liblapack: +- 3.8 *netlib +numpy: +- '1.16' +- '1.16' +- '1.16' +- '1.19' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.6.* *_cpython +- 3.7.* *_cpython +- 3.8.* *_cpython +- 3.9.* *_cpython +target_platform: +- win-64 +zip_keys: +- - numpy + - python diff --git a/.ci_support/win_64_cuda_compiler_version11.2.yaml b/.ci_support/win_64_cuda_compiler_version11.2.yaml new file mode 100644 index 00000000..af167a27 --- /dev/null +++ b/.ci_support/win_64_cuda_compiler_version11.2.yaml @@ -0,0 +1,33 @@ +channel_sources: +- conda-forge,defaults +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.2' +cxx_compiler: +- vs2017 +libblas: +- 3.8 *netlib +liblapack: +- 3.8 *netlib +numpy: +- '1.16' +- '1.16' +- '1.16' +- '1.19' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.6.* *_cpython +- 3.7.* *_cpython +- 3.8.* *_cpython +- 3.9.* *_cpython +target_platform: +- win-64 +zip_keys: +- - numpy + - python diff --git a/.ci_support/win_64_cuda_compiler_versionNone.yaml b/.ci_support/win_64_cuda_compiler_versionNone.yaml index 08965d88..1c770972 100644 --- a/.ci_support/win_64_cuda_compiler_versionNone.yaml +++ b/.ci_support/win_64_cuda_compiler_versionNone.yaml @@ -2,6 +2,8 @@ channel_sources: - conda-forge,defaults channel_targets: - conda-forge main +cuda_compiler: +- nvcc cuda_compiler_version: - None cxx_compiler: diff --git a/README.md b/README.md index 546a045c..64af3fe6 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,34 @@ Current build status variant + + win_64_cuda_compiler_version10.2 + + + variant + + + + win_64_cuda_compiler_version11.0 + + + variant + + + + win_64_cuda_compiler_version11.1 + + + variant + + + + win_64_cuda_compiler_version11.2 + + + variant + + win_64_cuda_compiler_versionNone From 1331085612473e7914084418529e6b2805310c44 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 17 Feb 2021 18:06:18 +0100 Subject: [PATCH 09/11] add compute_86 in build-lib.bat --- recipe/build-lib.bat | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/recipe/build-lib.bat b/recipe/build-lib.bat index 41b10282..7465756d 100644 --- a/recipe/build-lib.bat +++ b/recipe/build-lib.bat @@ -10,7 +10,7 @@ if "%cuda_compiler_version%"=="None" ( REM for documentation see e.g. REM docs.nvidia.com/cuda/cuda-c-best-practices-guide/index.html#building-for-maximum-compatibility - REM docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#major-components__table-cuda-toolkit-driver-versions + REM docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#ptxas-options-gpu-name REM docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-feature-list REM for -real vs. -virtual, see cmake.org/cmake/help/latest/prop_tgt/CUDA_ARCHITECTURES.html @@ -23,8 +23,13 @@ if "%cuda_compiler_version%"=="None" ( set "CMAKE_CUDA_ARCHS=35-virtual;50-virtual;52-virtual;60-virtual;61-virtual;70-virtual;75-virtual;75-real" ) if "%cuda_compiler_version:~0,2%"=="11" ( - REM cuda 11.0 deprecates arches 35, 50 - set "CMAKE_CUDA_ARCHS=52-virtual;60-virtual;61-virtual;70-virtual;75-virtual;80-virtual;80-real" + if "%cuda_compiler_version:~0,4%"=="11.0" ( + REM cuda 11.0 deprecates arches 35, 50 + set "CMAKE_CUDA_ARCHS=52-virtual;60-virtual;61-virtual;70-virtual;75-virtual;80-virtual;80-real" + ) else ( + REM cuda>=11.1 adds arch 86 + set "CMAKE_CUDA_ARCHS=52-virtual;60-virtual;61-virtual;70-virtual;75-virtual;80-virtual;86-virtual;86-real" + ) ) REM See more extensive comment in build-lib.sh From 01bc3a6333a98a8a22ffd473d70b49daae5879ac Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 17 Feb 2021 18:38:15 +0100 Subject: [PATCH 10/11] skip test that fails without GPU drivers on win --- recipe/meta.yaml | 2 ++ recipe/patches/0001-use-c-14.patch | 2 +- ...ers-in-faiss-gpu-CMakeLists.txt-1666.patch | 2 +- ...003-update-util-guard-for-compute_86.patch | 2 +- ...missing-includes-for-std-min-std-max.patch | 2 +- ...-test-that-fails-without-GPU-drivers.patch | 26 +++++++++++++++++++ 6 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 recipe/patches/0005-skip-test-that-fails-without-GPU-drivers.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index fc7d2c29..80d220a0 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -78,6 +78,8 @@ source: - patches/0003-update-util-guard-for-compute_86.patch # single commit from facebookresearch/faiss#1610 - patches/0004-Add-missing-includes-for-std-min-std-max.patch + # skip test that fails without GPU drivers on windows + - patches/0005-skip-test-that-fails-without-GPU-drivers.patch # [win] build: number: {{ number }} diff --git a/recipe/patches/0001-use-c-14.patch b/recipe/patches/0001-use-c-14.patch index bb1ca10c..b0e2ace9 100644 --- a/recipe/patches/0001-use-c-14.patch +++ b/recipe/patches/0001-use-c-14.patch @@ -1,7 +1,7 @@ From 1b4e6f16de1bc6e6e7a104647625f45956356df5 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 26 Oct 2020 22:44:44 +0100 -Subject: [PATCH 1/4] use c++14 +Subject: [PATCH 1/5] use c++14 --- CMakeLists.txt | 2 +- diff --git a/recipe/patches/0002-Add-missing-headers-in-faiss-gpu-CMakeLists.txt-1666.patch b/recipe/patches/0002-Add-missing-headers-in-faiss-gpu-CMakeLists.txt-1666.patch index 86155b9c..75c47df7 100644 --- a/recipe/patches/0002-Add-missing-headers-in-faiss-gpu-CMakeLists.txt-1666.patch +++ b/recipe/patches/0002-Add-missing-headers-in-faiss-gpu-CMakeLists.txt-1666.patch @@ -1,7 +1,7 @@ From e4b94c8a5ad0fc7632cf05006865dbd8feac2ed4 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 4 Feb 2021 09:21:21 -0800 -Subject: [PATCH 2/4] Add missing headers in faiss/[gpu/]CMakeLists.txt (#1666) +Subject: [PATCH 2/5] Add missing headers in faiss/[gpu/]CMakeLists.txt (#1666) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/recipe/patches/0003-update-util-guard-for-compute_86.patch b/recipe/patches/0003-update-util-guard-for-compute_86.patch index 2ff34ce2..6004601e 100644 --- a/recipe/patches/0003-update-util-guard-for-compute_86.patch +++ b/recipe/patches/0003-update-util-guard-for-compute_86.patch @@ -1,7 +1,7 @@ From 84b98debfb92145a55e932aeb74eb0358ed15512 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 17 Feb 2021 18:16:11 +0100 -Subject: [PATCH 3/4] update util-guard for compute_86 +Subject: [PATCH 3/5] update util-guard for compute_86 --- faiss/gpu/utils/DeviceDefs.cuh | 2 +- diff --git a/recipe/patches/0004-Add-missing-includes-for-std-min-std-max.patch b/recipe/patches/0004-Add-missing-includes-for-std-min-std-max.patch index e35d0e52..16240d4c 100644 --- a/recipe/patches/0004-Add-missing-includes-for-std-min-std-max.patch +++ b/recipe/patches/0004-Add-missing-includes-for-std-min-std-max.patch @@ -1,7 +1,7 @@ From c76bdcca995efee62144f0efbfdff1d7c7c3957c Mon Sep 17 00:00:00 2001 From: Lucas Hosseini Date: Thu, 7 Jan 2021 12:21:42 +0100 -Subject: [PATCH 4/4] Add missing includes for std::min/std::max. +Subject: [PATCH 4/5] Add missing includes for std::min/std::max. --- faiss/gpu/GpuIndex.cu | 1 + diff --git a/recipe/patches/0005-skip-test-that-fails-without-GPU-drivers.patch b/recipe/patches/0005-skip-test-that-fails-without-GPU-drivers.patch new file mode 100644 index 00000000..d8760a47 --- /dev/null +++ b/recipe/patches/0005-skip-test-that-fails-without-GPU-drivers.patch @@ -0,0 +1,26 @@ +From 1b4f509cdc91d38fecca58709093748324821931 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Wed, 17 Feb 2021 18:36:12 +0100 +Subject: [PATCH 5/5] skip test that fails without GPU drivers + +--- + tests/test_contrib.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tests/test_contrib.py b/tests/test_contrib.py +index 85990813..65811c4d 100644 +--- a/tests/test_contrib.py ++++ b/tests/test_contrib.py +@@ -22,8 +22,7 @@ except: + + + +-@unittest.skipIf(platform.python_version_tuple()[0] < '3', \ +- 'Submodule import broken in python 2.') ++@unittest.skipIf(True, 'No CUDA drivers in windows CI') + class TestComputeGT(unittest.TestCase): + + def test_compute_GT(self): +-- +2.29.2.windows.3 + From e2f408d71660a399813ed9de6cbea13b2e37b117 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 17 Feb 2021 23:36:53 +0100 Subject: [PATCH 11/11] bump build number --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 80d220a0..8c068815 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,5 @@ {% set version = "1.7.0" %} -{% set number = 1 %} +{% set number = 2 %} # see github.com/conda-forge/conda-forge.github.io/issues/1059 for naming discussion {% set faiss_proc_type = "cuda" if cuda_compiler_version != "None" else "cpu" %}