Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEA] Support for half-float mixed precise in brute-force #225

Merged
merged 25 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f2d3e20
[FEA] Support for half-float mixed precise in brute-force
rhdong Jul 17, 2024
28c8686
TBR: for compile
rhdong Jul 17, 2024
8b6e96a
Merge remote-tracking branch 'origin/branch-24.08' into rhdong/half-knn
rhdong Jul 18, 2024
34ec3bf
Process the conflictions with the new col_major feature
rhdong Jul 18, 2024
ec3c663
TBR II: get raft from rhdong fork
rhdong Jul 18, 2024
1984385
add more test cases
rhdong Jul 19, 2024
91dc5d7
Merge branch 'branch-24.08' into rhdong/half-knn
benfred Jul 19, 2024
53d260b
half2float -> to_float
rhdong Jul 22, 2024
8a7e922
Merge branch 'branch-24.08' into rhdong/half-knn
rhdong Jul 23, 2024
b47e8b0
fix: jensen-shannon python f64 test fail
rhdong Jul 24, 2024
c3eb8bd
Merge branch 'branch-24.08' into rhdong/half-knn
rhdong Jul 24, 2024
6b42b7c
add knn benchmark
rhdong Jul 25, 2024
2433687
Merge branch 'branch-24.10' into rhdong/half-knn
rhdong Jul 26, 2024
42ad854
revert a unnecessary change
rhdong Jul 27, 2024
264a9a5
Reduce the binary size by eliminating duplicate distance instantiation
rhdong Aug 1, 2024
1933db6
Merge remote-tracking branch 'origin/branch-24.10' into rhdong/half-knn
rhdong Aug 1, 2024
3ee9f8a
process confliction with latest 24.10
rhdong Aug 1, 2024
426be8b
Merge branch 'branch-24.10' into rhdong/half-knn
rhdong Aug 1, 2024
0ec4dae
Merge branch 'branch-24.10' into rhdong/half-knn
rhdong Aug 1, 2024
f817a12
Merge branch 'branch-24.10' into rhdong/half-knn
rhdong Aug 7, 2024
3bb7b94
process confliction with latest 24.10(2nd)
rhdong Aug 7, 2024
1fff543
Merge branch 'branch-24.10' into rhdong/half-knn
rhdong Aug 13, 2024
ca79e08
Merge remote-tracking branch 'origin/branch-24.10' into rhdong/half-knn
rhdong Aug 19, 2024
2d76643
[Opt] Introduce `CUVS_EXPLICIT_INSTANTIATE_ONLY` back for binary size…
rhdong Aug 19, 2024
6a91b15
Merge branch 'rhdong/half-knn' of https://github.com/rhdong/cuvs into…
rhdong Aug 19, 2024
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
15 changes: 15 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,30 +216,43 @@ add_library(
src/cluster/kmeans_transform_float.cu
src/cluster/single_linkage_float.cu
src/distance/detail/pairwise_matrix/dispatch_canberra_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_canberra_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_canberra_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_correlation_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_correlation_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_correlation_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_cosine_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_cosine_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_cosine_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_hamming_unexpanded_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_hamming_unexpanded_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_hamming_unexpanded_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_hellinger_expanded_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_hellinger_expanded_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_hellinger_expanded_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_jensen_shannon_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_jensen_shannon_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_jensen_shannon_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_kl_divergence_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_kl_divergence_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_kl_divergence_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_l1_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_l1_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_l1_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_l2_expanded_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_l2_expanded_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_l2_expanded_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_l2_unexpanded_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_l2_unexpanded_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_l2_unexpanded_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_l_inf_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_l_inf_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_l_inf_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_lp_unexpanded_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_lp_unexpanded_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_lp_unexpanded_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_russel_rao_float_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_russel_rao_half_float_float_int.cu
src/distance/detail/pairwise_matrix/dispatch_russel_rao_double_double_double_int.cu
src/distance/detail/pairwise_matrix/dispatch_rbf.cu
src/distance/detail/fused_distance_nn.cu
Expand Down Expand Up @@ -413,6 +426,8 @@ add_library(
src/selection/select_k_half_uint32_t.cu
)

target_compile_definitions(cuvs PRIVATE "CUVS_EXPLICIT_INSTANTIATE_ONLY")

target_compile_options(
cuvs INTERFACE $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:--expt-extended-lambda
--expt-relaxed-constexpr>
Expand Down
18 changes: 18 additions & 0 deletions cpp/bench/ann/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ option(CUVS_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF)
option(CUVS_ANN_BENCH_SINGLE_EXE
"Make a single executable with benchmark as shared library modules" OFF
)
option(CUVS_KNN_BENCH_USE_CUVS_BRUTE_FORCE "Include cuVS brute force knn in benchmark" ON)

# ##################################################################################################
# * Process options ----------------------------------------------------------
Expand All @@ -53,6 +54,9 @@ if(BUILD_CPU_ONLY)
set(CUVS_ANN_BENCH_USE_CUVS_BRUTE_FORCE OFF)
set(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB OFF)
set(CUVS_ANN_BENCH_USE_GGNN OFF)
set(CUVS_KNN_BENCH_USE_CUVS_BRUTE_FORCE OFF)
else()
set(CUVS_FAISS_ENABLE_GPU ON)
endif()

set(CUVS_ANN_BENCH_USE_CUVS OFF)
Expand All @@ -61,6 +65,7 @@ if(CUVS_ANN_BENCH_USE_CUVS_IVF_PQ
OR CUVS_ANN_BENCH_USE_CUVS_IVF_FLAT
OR CUVS_ANN_BENCH_USE_CUVS_CAGRA
OR CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB
OR CUVS_KNN_BENCH_USE_CUVS_BRUTE_FORCE
)
set(CUVS_ANN_BENCH_USE_CUVS ON)
endif()
Expand Down Expand Up @@ -169,6 +174,8 @@ function(ConfigureAnnBench)
)
endif()

target_compile_definitions(${BENCH_NAME} PRIVATE "CUVS_EXPLICIT_INSTANTIATE_ONLY")

target_include_directories(
${BENCH_NAME}
PUBLIC "$<BUILD_INTERFACE:${CUVS_SOURCE_DIR}/include>"
Expand Down Expand Up @@ -223,6 +230,17 @@ if(CUVS_ANN_BENCH_USE_CUVS_BRUTE_FORCE)
ConfigureAnnBench(NAME CUVS_BRUTE_FORCE PATH src/cuvs/cuvs_benchmark.cu LINKS cuvs)
endif()

if(CUVS_KNN_BENCH_USE_CUVS_BRUTE_FORCE)
ConfigureAnnBench(
NAME
CUVS_KNN_BRUTE_FORCE
PATH
$<$<BOOL:${CUVS_KNN_BENCH_USE_CUVS_BRUTE_FORCE}>:src/cuvs/cuvs_brute_force_knn.cu>
LINKS
cuvs
)
endif()

if(CUVS_ANN_BENCH_USE_CUVS_CAGRA)
ConfigureAnnBench(
NAME
Expand Down
Loading
Loading