Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions ports/faiss/fix-dependencies.patch

This file was deleted.

13 changes: 13 additions & 0 deletions ports/faiss/msvc-template.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/faiss/gpu/impl/PQCodeDistances-inl.cuh b/faiss/gpu/impl/PQCodeDistances-inl.cuh
index e2e66f3..309187e 100644
--- a/faiss/gpu/impl/PQCodeDistances-inl.cuh
+++ b/faiss/gpu/impl/PQCodeDistances-inl.cuh
@@ -544,7 +544,7 @@ void runPQCodeDistancesMM(

// View output as (q * c)(sub q * code), and add centroid norm to
// each row
- auto outDistancesCodeViewCols = outCodeDistancesView.view<2>(
+ auto outDistancesCodeViewCols = outCodeDistancesView.template view<2>(
{coarseIndices.getSize(0) * coarseIndices.getSize(1),
outCodeDistances.getSize(2) * outCodeDistances.getSize(3)});

76 changes: 39 additions & 37 deletions ports/faiss/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO facebookresearch/faiss
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO facebookresearch/faiss
REF "v${VERSION}"
SHA512 38d4215e3e019915d8b367ff0e8d14901b1495f6f45b835e9248276567a422b0370baab6bd887045442dd1e268b7fe7c347107162e66bb3ec6b1a53be4b2e441
HEAD_REF master
PATCHES
fix-dependencies.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
gpu FAISS_ENABLE_GPU
)

if ("${FAISS_ENABLE_GPU}")
if (NOT VCPKG_CMAKE_SYSTEM_NAME AND NOT ENV{CUDACXX})
set(ENV{CUDACXX} "$ENV{CUDA_PATH}/bin/nvcc.exe")
endif()
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DFAISS_ENABLE_PYTHON=OFF # Requires SWIG
-DBUILD_TESTING=OFF
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup()

vcpkg_copy_pdbs()

file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
SHA512 739641644a6a0b12430ab172fdd7c657b4c88e6389688c359919e2286bb494ff2011a33905719dc9dd95116c7c834f76969c457b67104223447ac04de339000d
HEAD_REF master
PATCHES
msvc-template.diff
undef-small.diff
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
gpu FAISS_ENABLE_GPU
)

if ("gpu" IN_LIST FEATURES)
vcpkg_find_cuda(OUT_CUDA_TOOLKIT_ROOT cuda_toolkit_root)
list(APPEND FEATURE_OPTIONS
"-DCMAKE_CUDA_COMPILER=${NVCC}"
"-DCUDAToolkit_ROOT=${cuda_toolkit_root}"
)
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DFAISS_ENABLE_MKL=OFF
-DFAISS_ENABLE_PYTHON=OFF # Requires SWIG
-DBUILD_TESTING=OFF
)

vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
15 changes: 15 additions & 0 deletions ports/faiss/undef-small.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/faiss/gpu/utils/MergeNetworkWarp.cuh b/faiss/gpu/utils/MergeNetworkWarp.cuh
index 39b3008..06d0c91 100644
--- a/faiss/gpu/utils/MergeNetworkWarp.cuh
+++ b/faiss/gpu/utils/MergeNetworkWarp.cuh
@@ -13,6 +13,10 @@
#include <faiss/gpu/utils/PtxUtils.cuh>
#include <faiss/gpu/utils/WarpShuffles.cuh>

+#ifdef small
+#undef small
+#endif
+
namespace faiss {
namespace gpu {

9 changes: 4 additions & 5 deletions ports/faiss/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "faiss",
"version": "1.8.0",
"version": "1.13.0",
"description": "Faiss is a library for efficient similarity search and clustering of dense vectors.",
"homepage": "https://github.com/facebookresearch/faiss",
"homepage": "https://faiss.ai/",
"license": "MIT",
"supports": "!uwp & !osx & !x86 & !(arm64 & windows)",
"supports": "!x86 & !uwp",
"dependencies": [
"blas",
"lapack",
"openblas",
{
"name": "vcpkg-cmake",
"host": true
Expand All @@ -20,7 +20,6 @@
"features": {
"gpu": {
"description": "Whether to enable GPU support",
"supports": "!uwp & !osx & !x86 & !windows",
"dependencies": [
"cuda"
]
Expand Down
1 change: 1 addition & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ eathread:x64-android=fail
ecal:arm-neon-android=fail
ecal:arm64-android=fail
ecal:x64-android=fail
faiss:arm64-osx=fail # No openmp on default osx toolchain
flint:arm-neon-android=fail
flint:arm64-android=fail
flint:x64-android=fail
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci.feature.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ discord-rpc(uwp)=fail
dmlc(uwp) = fail
ecal(android)=fail
ensmallen[openmp](osx) = feature-fails # No openmp on default osx toolchain
faiss:arm64-windows=fail
faiss(osx)=fail # No openmp on default osx toolchain
fmi4cpp(uwp)=fail
forge:x86-windows=fail
freeglut(android)=fail
Expand Down Expand Up @@ -439,7 +439,7 @@ elements:arm64-uwp = cascade
elements:x64-uwp = cascade
evpp:arm64-uwp = cascade
evpp:x64-uwp = cascade
faiss[gpu]:arm64-windows = cascade
faiss[gpu](!(windows & x64 & !uwp) & !(linux & x64)) = cascade
fbgemm:arm64-osx = cascade
fbgemm:arm64-windows = cascade
fbthrift(android) = cascade
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2821,7 +2821,7 @@
"port-version": 2
},
"faiss": {
"baseline": "1.8.0",
"baseline": "1.13.0",
"port-version": 0
},
"fakeit": {
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/faiss.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "aceaa4aa15670ff48eabf4325ec074110015578c",
"version": "1.13.0",
"port-version": 0
},
{
"git-tree": "e711ba8ab9d73c53bfe501023ae42a46b0de7f03",
"version": "1.8.0",
Expand Down
Loading