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

Fix primitives benchmarks #1389

Merged
merged 2 commits into from
Mar 31, 2023
Merged
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
141 changes: 0 additions & 141 deletions cpp/bench/CMakeLists.txt

This file was deleted.

6 changes: 4 additions & 2 deletions cpp/bench/prims/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ function(ConfigureBench)
"$<$<COMPILE_LANGUAGE:CUDA>:${RAFT_CUDA_FLAGS}>"
)

target_include_directories(${BENCH_NAME} PUBLIC "$<BUILD_INTERFACE:${RAFT_SOURCE_DIR}/bench>")
target_include_directories(
${BENCH_NAME} PUBLIC "$<BUILD_INTERFACE:${RAFT_SOURCE_DIR}/bench/prims>"
)

install(
TARGETS ${BENCH_NAME}
Expand All @@ -66,7 +68,7 @@ function(ConfigureBench)

endfunction()

if(BUILD_BENCH)
if(BUILD_PRIMS_BENCH)
ConfigureBench(
NAME CLUSTER_BENCH PATH bench/prims/cluster/kmeans_balanced.cu bench/prims/cluster/kmeans.cu
bench/prims/main.cpp OPTIONAL LIB
Expand Down
6 changes: 3 additions & 3 deletions cpp/bench/prims/neighbors/knn.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,11 @@ struct knn : public fixture {
RAFT_CUDA_TRY(cudaHostGetDevicePointer(&data_ptr, data_host_.data(), 0));
break;
case TransferStrategy::MANAGED: // sic! using std::memcpy rather than cuda copy
CUDA_CHECK(cudaMemAdvise(
RAFT_CUDA_TRY(cudaMemAdvise(
data_ptr, allocation_size, cudaMemAdviseSetPreferredLocation, handle.get_device()));
CUDA_CHECK(cudaMemAdvise(
RAFT_CUDA_TRY(cudaMemAdvise(
data_ptr, allocation_size, cudaMemAdviseSetAccessedBy, handle.get_device()));
CUDA_CHECK(cudaMemAdvise(
RAFT_CUDA_TRY(cudaMemAdvise(
data_ptr, allocation_size, cudaMemAdviseSetReadMostly, handle.get_device()));
std::memcpy(data_ptr, data_host_.data(), allocation_size);
break;
Expand Down
2 changes: 1 addition & 1 deletion cpp/internal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# the License.
# =============================================================================

if(BUILD_TESTS OR BUILD_BENCH)
if(BUILD_TESTS OR BUILD_PRIMS_BENCH)
add_library(raft_internal INTERFACE)
target_include_directories(
raft_internal INTERFACE "$<BUILD_INTERFACE:${RAFT_SOURCE_DIR}/internal>"
Expand Down
3 changes: 2 additions & 1 deletion cpp/template/cmake/thirdparty/get_raft.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function(find_and_configure_raft)
SOURCE_SUBDIR cpp
OPTIONS
"BUILD_TESTS OFF"
"BUILD_BENCH OFF"
"BUILD_PRIMS_BENCH OFF"
"BUILD_ANN_BENCH OFF"
"RAFT_NVTX ${ENABLE_NVTX}"
"RAFT_COMPILE_LIBRARY ${PKG_COMPILE_LIBRARY}"
)
Expand Down
8 changes: 5 additions & 3 deletions docs/source/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ RAFT's cmake has the following configurable flags available:.
| Flag | Possible Values | Default Value | Behavior |
|---------------------------|----------------------| --- | --- |
| BUILD_TESTS | ON, OFF | ON | Compile Googletests |
| BUILD_BENCH | ON, OFF | OFF | Compile benchmarks |
| BUILD_PRIMS_BENCH | ON, OFF | OFF | Compile benchmarks |
| BUILD_ANN_BENCH | ON, OFF | OFF | Compile end-to-end ANN benchmarks |
| raft_FIND_COMPONENTS | compiled distributed | | Configures the optional components as a space-separated list |
| RAFT_COMPILE_LIBRARY | ON, OFF | ON if either BUILD_TESTS or BUILD_BENCH is ON; otherwise OFF | Compiles all `libraft` shared libraries (these are required for Googletests) |
| RAFT_COMPILE_LIBRARY | ON, OFF | ON if either BUILD_TESTS or BUILD_PRIMS_BENCH is ON; otherwise OFF | Compiles all `libraft` shared libraries (these are required for Googletests) |
| DETECT_CONDA_ENV | ON, OFF | ON | Enable detection of conda environment for dependencies |
| RAFT_NVTX | ON, OFF | OFF | Enable NVTX Markers |
| CUDA_ENABLE_KERNELINFO | ON, OFF | OFF | Enables `kernelinfo` in nvcc. This is useful for `compute-sanitizer` |
Expand Down Expand Up @@ -315,7 +316,8 @@ function(find_and_configure_raft)
FIND_PACKAGE_ARGUMENTS "COMPONENTS compiled distributed"
OPTIONS
"BUILD_TESTS OFF"
"BUILD_BENCH OFF"
"BUILD_PRIMS_BENCH OFF"
"BUILD_ANN_BENCH OFF"
"RAFT_COMPILE_LIBRARY ${PKG_COMPILE_LIBRARY}"
)

Expand Down
3 changes: 2 additions & 1 deletion python/pylibraft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ if(NOT raft_FOUND)
include("${CMAKE_PROJECT_pylibraft_INCLUDE}")

set(BUILD_TESTS OFF)
set(BUILD_BENCH OFF)
set(BUILD_PRIMS_BENCH OFF)
set(BUILD_ANN_BENCH OFF)
set(RAFT_COMPILE_LIBRARY ON)

set(_exclude_from_all "")
Expand Down
3 changes: 2 additions & 1 deletion python/raft-dask/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ if(NOT raft_FOUND)
# raft-dask doesn't actually use raft libraries, it just needs the headers, so we can turn off all
# library compilation and we don't need to install anything here.
set(BUILD_TESTS OFF)
set(BUILD_BENCH OFF)
set(BUILD_ANN_BENCH OFF)
set(BUILD_PRIMS_BENCH OFF)
set(RAFT_COMPILE_LIBRARIES OFF)
set(RAFT_COMPILE_DIST_LIBRARY OFF)
set(RAFT_COMPILE_NN_LIBRARY OFF)
Expand Down