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] Fix build with latest RAFT branch-21.08 #4012

Merged
merged 10 commits into from
Jun 29, 2021
3 changes: 1 addition & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ rapids_export(BUILD cuml

if(BUILD_CUML_BENCH OR BUILD_CUML_PRIMS_BENCH)
add_subdirectory(bench)
endif(BUILD_CUML_BENCH)
endif()

##############################################################################
# - doxygen targets ----------------------------------------------------------
Expand All @@ -482,4 +482,3 @@ include(cmake/doxygen.cmake)
add_doxygen_target(IN_DOXYFILE Doxyfile.in
OUT_DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
CWD ${CMAKE_CURRENT_BINARY_DIR})

5 changes: 2 additions & 3 deletions cpp/cmake/modules/ConfigureCUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ endif()
# Option to enable line info in CUDA device compilation to allow introspection when profiling / memchecking
if(CUDA_ENABLE_LINE_INFO)
list(APPEND CUML_CUDA_FLAGS -lineinfo)
endif(LINE_INFO)
endif()

if(CUDA_ENABLE_KERNEL_INFO)
list(APPEND CUML_CUDA_FLAGS -Xptxas=-v)
endif(KERNEL_INFO)
endif()

if(OpenMP_FOUND)
list(APPEND CUML_CUDA_FLAGS -Xcompiler=${OpenMP_CXX_FLAGS})
Expand All @@ -51,4 +51,3 @@ if(CMAKE_BUILD_TYPE MATCHES Debug)
message(VERBOSE "CUML: Building with debugging flags")
list(APPEND CUML_CUDA_FLAGS -G -Xcompiler=-rdynamic)
endif()

8 changes: 2 additions & 6 deletions cpp/src/knn/knn_sparse.cu
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,11 @@ void brute_force_knn(raft::handle_t &handle, const int *idx_indptr,
size_t batch_size_index, // approx 1M
size_t batch_size_query,
raft::distance::DistanceType metric, float metricArg) {
auto d_alloc = handle.get_device_allocator();
cusparseHandle_t cusparse_handle = handle.get_cusparse_handle();
cudaStream_t stream = handle.get_stream();

raft::sparse::selection::brute_force_knn(
idx_indptr, idx_indices, idx_data, idx_nnz, n_idx_rows, n_idx_cols,
query_indptr, query_indices, query_data, query_nnz, n_query_rows,
n_query_cols, output_indices, output_dists, k, cusparse_handle, d_alloc,
stream, batch_size_index, batch_size_query, metric, metricArg);
n_query_cols, output_indices, output_dists, k, handle, batch_size_index,
batch_size_query, metric, metricArg);
}
}; // namespace Sparse
}; // namespace ML
7 changes: 2 additions & 5 deletions cpp/src/metrics/pairwise_distance.cu
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ void pairwiseDistance_sparse(const raft::handle_t &handle, value_t *x,
value_idx *x_indices, value_idx *y_indices,
raft::distance::DistanceType metric,
float metric_arg) {
raft::sparse::distance::distances_config_t<value_idx, value_t> dist_config;
raft::sparse::distance::distances_config_t<value_idx, value_t> dist_config(
handle);

dist_config.b_nrows = x_nrows;
dist_config.b_ncols = n_cols;
Expand All @@ -73,10 +74,6 @@ void pairwiseDistance_sparse(const raft::handle_t &handle, value_t *x,
dist_config.a_indices = y_indices;
dist_config.a_data = y;

dist_config.handle = handle.get_cusparse_handle();
dist_config.allocator = handle.get_device_allocator();
dist_config.stream = handle.get_stream();

raft::sparse::distance::pairwiseDistance(dist, dist_config, metric,
metric_arg);
}
Expand Down
3 changes: 1 addition & 2 deletions cpp/src/tsne/distances.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ void get_distances(const raft::handle_t &handle,
raft::sparse::selection::brute_force_knn(
input.indptr, input.indices, input.data, input.nnz, input.n, input.d,
input.indptr, input.indices, input.data, input.nnz, input.n, input.d,
k_graph.knn_indices, k_graph.knn_dists, k_graph.n_neighbors,
handle.get_cusparse_handle(), handle.get_device_allocator(), stream,
k_graph.knn_indices, k_graph.knn_dists, k_graph.n_neighbors, handle,
ML::Sparse::DEFAULT_BATCH_SIZE, ML::Sparse::DEFAULT_BATCH_SIZE,
DEFAULT_DISTANCE_METRIC);
}
Expand Down
3 changes: 1 addition & 2 deletions cpp/src/umap/knn_graph/algo.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ void launcher(const raft::handle_t &handle,
raft::sparse::selection::brute_force_knn(
inputsA.indptr, inputsA.indices, inputsA.data, inputsA.nnz, inputsA.n,
inputsA.d, inputsB.indptr, inputsB.indices, inputsB.data, inputsB.nnz,
inputsB.n, inputsB.d, out.knn_indices, out.knn_dists, n_neighbors,
handle.get_cusparse_handle(), d_alloc, stream,
inputsB.n, inputsB.d, out.knn_indices, out.knn_dists, n_neighbors, handle,
ML::Sparse::DEFAULT_BATCH_SIZE, ML::Sparse::DEFAULT_BATCH_SIZE,
raft::distance::DistanceType::L2Expanded);
}
Expand Down
2 changes: 1 addition & 1 deletion python/cuml/test/test_dbscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_dbscan_precomputed(datatype, nrows, max_mbytes_per_batch, out_dtype):

# Precompute distances
Xc = np.array([[complex(p[0], p[1]) for p in X]])
X_dist = np.abs(Xc - Xc.T, dtype=datatype)
X_dist = np.abs(Xc - Xc.T).astype(datatype)
trxcllnt marked this conversation as resolved.
Show resolved Hide resolved

eps = 1
cuml_dbscan = cuDBSCAN(eps=eps, min_samples=2, metric='precomputed',
Expand Down