Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 24 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ if (NOT CMAKE_TOOLCHAIN_FILE)
endif ()
endif ()

set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_SOURCE_DIR}/custom_ports"
CACHE STRING "Custom vcpkg ports")

project(infinity VERSION 0.6.11)

set(CMAKE_CXX_STANDARD 23)
Expand Down Expand Up @@ -123,7 +126,9 @@ find_package(CLI11 CONFIG REQUIRED)
find_package(GTest CONFIG REQUIRED)
find_package(Libevent CONFIG REQUIRED)
find_package(magic_enum CONFIG REQUIRED)
#find_package(miniocpp CONFIG REQUIRED) # wait for s3
find_package(miniocpp CONFIG REQUIRED) # wait for s3
find_package(onnxruntime CONFIG REQUIRED)

#nanobind don't need it
find_package(nlohmann_json CONFIG REQUIRED)
find_package(oatpp CONFIG REQUIRED)
Expand Down Expand Up @@ -168,6 +173,24 @@ message(STATUS "Found oatpp include directories: ${OATPP_INCLUDE_DIRS}")
include_directories(${OATPP_INCLUDE_DIRS})
message(STATUS "Using vcpkg toolchain - automatic package discovery enabled")

# Copy mlas headers in onnxruntime to project
if (CMAKE_TOOLCHAIN_FILE)
get_filename_component(VCPKG_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE)
get_filename_component(VCPKG_BUILDSYSTEMS_DIR "${VCPKG_TOOLCHAIN_FILE}" DIRECTORY) # 得到 .../vcpkg/scripts/buildsystems
get_filename_component(VCPKG_SCRIPTS_DIR "${VCPKG_BUILDSYSTEMS_DIR}" DIRECTORY) # 得到 .../vcpkg/scripts
get_filename_component(VCPKG_ROOT "${VCPKG_SCRIPTS_DIR}" DIRECTORY)

set(MLAS_INC_SRC_PATTERN "${VCPKG_ROOT}/buildtrees/onnxruntime/src/*/onnxruntime/core/mlas/inc")
file(GLOB MLAS_INC_SRC_DIR LIST_DIRECTORIES true "${MLAS_INC_SRC_PATTERN}")
message(STATUS "MLAS_INC_SRC_DIR: ${MLAS_INC_SRC_DIR}")

set(MLAS_DEST_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake-build-debug/vcpkg_installed/x64-linux/include/onnxruntime/core/mlas")
file(MAKE_DIRECTORY "${MLAS_DEST_DIR}")
message(STATUS "MLAS_DEST_DIR: ${MLAS_DEST_DIR}")

file(INSTALL "${MLAS_INC_SRC_DIR}/" DESTINATION "${MLAS_DEST_DIR}" FILES_MATCHING PATTERN "*.h")
message(STATUS "Copied mlas headers")
endif ()

# https://youtrack.jetbrains.com/issue/CPP-39632/import-std-CLion-cant-resolve-module-std-in-case-of-clang
add_library(unused_std_target STATIC)
Expand Down
79 changes: 22 additions & 57 deletions benchmark/local_infinity/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
find_package(miniocpp REQUIRED)

# infinity benchmark
add_executable(infinity_benchmark
infinity_benchmark.cpp
Expand All @@ -8,8 +10,8 @@ target_link_libraries(infinity_benchmark
benchmark_profiler
infinity_core
sql_parser
onnxruntime_mlas
zsv_parser
onnxruntime::onnxruntime
zsv
newpfor
fastpfor
jma
Expand All @@ -22,12 +24,10 @@ target_link_libraries(infinity_benchmark
Parquet::parquet_static
Arrow::arrow_static
${JEMALLOC_STATIC_LIB}
miniocpp.a
miniocpp::miniocpp
pugixml::static
curlpp_static
unofficial::inih::libinih
unofficial::inih::inireader
libcurl_static
OpenSSL::SSL
OpenSSL::Crypto
re2::re2
Expand All @@ -43,9 +43,6 @@ target_link_libraries(infinity_benchmark
)

target_link_directories(infinity_benchmark PUBLIC "${CMAKE_BINARY_DIR}/lib")
target_link_directories(infinity_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/minio-cpp/")
target_link_directories(infinity_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curlpp/")
target_link_directories(infinity_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curl/")
target_link_directories(infinity_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/")

# ########################################
Expand All @@ -54,15 +51,14 @@ target_link_directories(infinity_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_par
add_executable(knn_import_benchmark
./knn/knn_import_benchmark.cpp
)
add_dependencies(knn_import_benchmark miniocpp)

target_include_directories(knn_import_benchmark PUBLIC "${CMAKE_SOURCE_DIR}/src")
target_link_libraries(knn_import_benchmark
infinity_core
benchmark_profiler
sql_parser
onnxruntime_mlas
zsv_parser
onnxruntime::onnxruntime
zsv
newpfor
fastpfor
jma
Expand All @@ -75,12 +71,10 @@ target_link_libraries(knn_import_benchmark
Parquet::parquet_static
Arrow::arrow_static
${JEMALLOC_STATIC_LIB}
miniocpp.a
miniocpp::miniocpp
pugixml::static
curlpp_static
unofficial::inih::libinih
unofficial::inih::inireader
libcurl_static
OpenSSL::SSL
OpenSSL::Crypto
re2::re2
Expand All @@ -96,24 +90,20 @@ target_link_libraries(knn_import_benchmark
)

target_link_directories(knn_import_benchmark PUBLIC "${CMAKE_BINARY_DIR}/lib")
target_link_directories(knn_import_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/minio-cpp/")
target_link_directories(knn_import_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curlpp/")
target_link_directories(knn_import_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curl/")
target_link_directories(knn_import_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/")

# query benchmark
add_executable(knn_query_benchmark
./knn/knn_query_benchmark.cpp
)
add_dependencies(knn_query_benchmark miniocpp)

target_include_directories(knn_query_benchmark PUBLIC "${CMAKE_SOURCE_DIR}/src")
target_link_libraries(knn_query_benchmark
infinity_core
benchmark_profiler
sql_parser
onnxruntime_mlas
zsv_parser
onnxruntime::onnxruntime
zsv
newpfor
fastpfor
jma
Expand All @@ -126,12 +116,10 @@ target_link_libraries(knn_query_benchmark
libevent::core
oatpp::oatpp
${JEMALLOC_STATIC_LIB}
miniocpp.a
miniocpp::miniocpp
pugixml::static
curlpp_static
unofficial::inih::libinih
unofficial::inih::inireader
libcurl_static
OpenSSL::SSL
OpenSSL::Crypto
re2::re2
Expand All @@ -147,9 +135,6 @@ target_link_libraries(knn_query_benchmark
)

target_link_directories(knn_query_benchmark PUBLIC "${CMAKE_BINARY_DIR}/lib")
target_link_directories(knn_query_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/minio-cpp/")
target_link_directories(knn_query_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curlpp/")
target_link_directories(knn_query_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curl/")
target_link_directories(knn_query_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/")

# ########################################
Expand All @@ -164,7 +149,7 @@ target_link_libraries(fulltext_benchmark
infinity_core
benchmark_profiler
sql_parser
onnxruntime_mlas
onnxruntime::onnxruntime
zsv_parser
newpfor
fastpfor
Expand All @@ -178,12 +163,10 @@ target_link_libraries(fulltext_benchmark
Parquet::parquet_static
Arrow::arrow_static
${JEMALLOC_STATIC_LIB}
miniocpp.a
miniocpp::miniocpp
pugixml::static
curlpp_static
unofficial::inih::libinih
unofficial::inih::inireader
libcurl_static
OpenSSL::SSL
OpenSSL::Crypto
re2::re2
Expand All @@ -199,9 +182,6 @@ target_link_libraries(fulltext_benchmark
)

target_link_directories(fulltext_benchmark PUBLIC "${CMAKE_BINARY_DIR}/lib")
target_link_directories(fulltext_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/minio-cpp/")
target_link_directories(fulltext_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curlpp/")
target_link_directories(fulltext_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curl/")
target_link_directories(fulltext_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/")

# ########################################
Expand All @@ -214,8 +194,8 @@ target_link_libraries(sparse_benchmark
infinity_core
benchmark_profiler
sql_parser
onnxruntime_mlas
zsv_parser
onnxruntime::onnxruntime
zsv
newpfor
fastpfor
jma
Expand All @@ -224,12 +204,10 @@ target_link_libraries(sparse_benchmark
Parquet::parquet_static
Arrow::arrow_static
${JEMALLOC_STATIC_LIB}
miniocpp.a
miniocpp::miniocpp
pugixml::static
curlpp_static
unofficial::inih::libinih
unofficial::inih::inireader
libcurl_static
OpenSSL::SSL
OpenSSL::Crypto
re2::re2
Expand All @@ -245,9 +223,6 @@ target_link_libraries(sparse_benchmark
)

target_link_directories(sparse_benchmark PUBLIC "${CMAKE_BINARY_DIR}/lib")
target_link_directories(sparse_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/minio-cpp/")
target_link_directories(sparse_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curlpp/")
target_link_directories(sparse_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curl/")
target_link_directories(sparse_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/")

add_executable(bmp_benchmark
Expand All @@ -259,8 +234,8 @@ target_link_libraries(bmp_benchmark
infinity_core
benchmark_profiler
sql_parser
onnxruntime_mlas
zsv_parser
onnxruntime::onnxruntime
zsv
newpfor
fastpfor
jma
Expand All @@ -273,12 +248,10 @@ target_link_libraries(bmp_benchmark
Parquet::parquet_static
Arrow::arrow_static
${JEMALLOC_STATIC_LIB}
miniocpp.a
miniocpp::miniocpp
pugixml::static
curlpp_static
unofficial::inih::libinih
unofficial::inih::inireader
libcurl_static
OpenSSL::SSL
OpenSSL::Crypto
re2::re2
Expand All @@ -294,9 +267,6 @@ target_link_libraries(bmp_benchmark
)

target_link_directories(bmp_benchmark PUBLIC "${CMAKE_BINARY_DIR}/lib")
target_link_directories(bmp_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/minio-cpp/")
target_link_directories(bmp_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curlpp/")
target_link_directories(bmp_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curl/")
target_link_directories(bmp_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/")

add_executable(hnsw_benchmark
Expand All @@ -308,8 +278,8 @@ target_link_libraries(hnsw_benchmark
infinity_core
benchmark_profiler
sql_parser
onnxruntime_mlas
zsv_parser
onnxruntime::onnxruntime
zsv
newpfor
fastpfor
jma
Expand All @@ -322,12 +292,10 @@ target_link_libraries(hnsw_benchmark
libevent::core
oatpp::oatpp
${JEMALLOC_STATIC_LIB}
miniocpp.a
miniocpp::miniocpp
pugixml::static
curlpp_static
unofficial::inih::libinih
unofficial::inih::inireader
libcurl_static
OpenSSL::SSL
OpenSSL::Crypto
re2::re2
Expand All @@ -343,9 +311,6 @@ target_link_libraries(hnsw_benchmark
)

target_link_directories(hnsw_benchmark PUBLIC "${CMAKE_BINARY_DIR}/lib")
target_link_directories(hnsw_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/minio-cpp/")
target_link_directories(hnsw_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curlpp/")
target_link_directories(hnsw_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curl/")
target_link_directories(hnsw_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/")

# add_definitions(-march=native)
Expand Down
12 changes: 4 additions & 8 deletions benchmark/remote_infinity/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
find_package(miniocpp REQUIRED)

# query benchmark
add_executable(remote_query_benchmark
Expand All @@ -9,18 +10,15 @@ add_executable(remote_query_benchmark
target_include_directories(remote_query_benchmark PUBLIC "${CMAKE_SOURCE_DIR}/src")
target_include_directories(remote_query_benchmark PUBLIC "${CMAKE_SOURCE_DIR}/src/network/infinity_thrift")
target_link_directories(remote_query_benchmark PUBLIC "${CMAKE_BINARY_DIR}/lib")
target_link_directories(remote_query_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/minio-cpp/")
target_link_directories(remote_query_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curlpp/")
target_link_directories(remote_query_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/curl/")
target_link_directories(remote_query_benchmark PUBLIC "${CMAKE_BINARY_DIR}/third_party/")

target_link_libraries(
remote_query_benchmark
infinity_core
benchmark_profiler
sql_parser
onnxruntime_mlas
zsv_parser
onnxruntime::onnxruntime
zsv
newpfor
fastpfor
jma
Expand All @@ -32,15 +30,13 @@ target_link_libraries(
Parquet::parquet_static
Arrow::arrow_static
${JEMALLOC_STATIC_LIB}
miniocpp.a
miniocpp::miniocpp
re2::re2
absl::any absl::log absl::base absl::bits
PCRE2::8BIT
pugixml::static
curlpp_static
unofficial::inih::libinih
unofficial::inih::inireader
libcurl_static
OpenSSL::SSL
OpenSSL::Crypto
RocksDB::rocksdb
Expand Down
13 changes: 13 additions & 0 deletions custom_ports/curlpp/fix-Multi_hpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/include/curlpp/Multi.hpp
+++ b/include/curlpp/Multi.hpp
@@ -62,6 +62,10 @@
fd_set * exc_fd_set,
int * max_fd);

+ void timeout(long * curl_timeo){
+ curl_multi_timeout(mMultiHandle, curl_timeo);
+ }
+
typedef std::list<std::pair<const curlpp::Easy *, Multi::Info> >
Msgs;

Loading
Loading