Skip to content

Commit 21fe2aa

Browse files
committed
Merge branch 'branch-21.08' of https://github.com/rapidsai/cugraph into fea_dcsr_prim
2 parents 0b6e4c6 + aba3445 commit 21fe2aa

File tree

4 files changed

+65
-22
lines changed

4 files changed

+65
-22
lines changed

cpp/cmake/thirdparty/get_faiss.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ function(find_and_configure_faiss)
4040

4141
if(FAISS_ADDED)
4242
set(FAISS_GPU_HEADERS ${FAISS_SOURCE_DIR} PARENT_SCOPE)
43-
add_library(FAISS::FAISS ALIAS faiss)
43+
endif()
44+
45+
if(TARGET faiss AND NOT TARGET FAISS::FAISS)
46+
add_library(FAISS::FAISS ALIAS faiss)
4447
endif()
4548

4649
endfunction()

cpp/include/cugraph/prims/copy_v_transform_reduce_key_aggregated_out_nbr.cuh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@
3636
namespace cugraph {
3737
namespace experimental {
3838

39+
namespace detail {
40+
41+
// a workaround for cudaErrorInvalidDeviceFunction error when device lambda is used
42+
template <typename VertexIterator>
43+
struct minor_to_key_t {
44+
using vertex_t = typename std::iterator_traits<VertexIterator>::value_type;
45+
VertexIterator adj_matrix_col_key_first{};
46+
vertex_t minor_first{};
47+
__device__ vertex_t operator()(vertex_t minor)
48+
{
49+
return *(adj_matrix_col_key_first + (minor - minor_first));
50+
}
51+
};
52+
53+
} // namespace detail
54+
3955
/**
4056
* @brief Iterate over every vertex's key-aggregated outgoing edges to update vertex properties.
4157
*
@@ -255,10 +271,8 @@ void copy_v_transform_reduce_key_aggregated_out_nbr(
255271
if (matrix_partition.get_major_size() > 0) {
256272
auto minor_key_first = thrust::make_transform_iterator(
257273
matrix_partition.get_indices(),
258-
[adj_matrix_col_key_first, matrix_partition] __device__(auto minor) {
259-
return *(adj_matrix_col_key_first +
260-
matrix_partition.get_minor_offset_from_minor_nocheck(minor));
261-
});
274+
detail::minor_to_key_t<VertexIterator0>{adj_matrix_col_key_first,
275+
matrix_partition.get_minor_first()});
262276
thrust::copy(rmm::exec_policy(handle.get_stream())->on(handle.get_stream()),
263277
minor_key_first,
264278
minor_key_first + matrix_partition.get_number_of_edges(),

cpp/tests/community/louvain_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ TEST_P(Tests_Louvain, CheckInt32Int32FloatFloat)
312312
run_current_test<int32_t, int32_t, float, float>(GetParam());
313313
}
314314

315+
TEST_P(Tests_Louvain, CheckInt64Int64FloatFloat)
316+
{
317+
run_current_test<int64_t, int64_t, float, float>(GetParam());
318+
}
319+
315320
// FIXME: Expand testing once we evaluate RMM memory use
316321
INSTANTIATE_TEST_SUITE_P(
317322
simple_test,

python/setup.py

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import os
1515
import sys
16+
import sysconfig
1617
import shutil
1718

1819
from setuptools import setup, find_packages, Command
@@ -29,13 +30,25 @@
2930

3031

3132
INSTALL_REQUIRES = ['numba', 'cython']
33+
CYTHON_FILES = ['cugraph/**/*.pyx']
34+
35+
UCX_HOME = get_environment_option("UCX_HOME")
36+
CUDA_HOME = get_environment_option('CUDA_HOME')
37+
CONDA_PREFIX = get_environment_option('CONDA_PREFIX')
3238

3339
conda_lib_dir = os.path.normpath(sys.prefix) + '/lib'
3440
conda_include_dir = os.path.normpath(sys.prefix) + '/include'
3541

36-
CYTHON_FILES = ['cugraph/**/*.pyx']
42+
if CONDA_PREFIX:
43+
conda_include_dir = CONDA_PREFIX + '/include'
44+
conda_lib_dir = CONDA_PREFIX + '/lib'
45+
46+
if not UCX_HOME:
47+
UCX_HOME = CONDA_PREFIX if CONDA_PREFIX else os.sys.prefix
48+
49+
ucx_include_dir = os.path.join(UCX_HOME, "include")
50+
ucx_lib_dir = os.path.join(UCX_HOME, "lib")
3751

38-
CUDA_HOME = os.environ.get("CUDA_HOME", False)
3952
if not CUDA_HOME:
4053
path_to_cuda_gdb = shutil.which("cuda-gdb")
4154
if path_to_cuda_gdb is None:
@@ -53,11 +66,7 @@
5366
)
5467

5568
cuda_include_dir = os.path.join(CUDA_HOME, "include")
56-
57-
if (os.environ.get('CONDA_PREFIX', None)):
58-
conda_prefix = os.environ.get('CONDA_PREFIX')
59-
conda_include_dir = conda_prefix + '/include'
60-
conda_lib_dir = conda_prefix + '/lib'
69+
cuda_lib_dir = os.path.join(CUDA_HOME, "lib64")
6170

6271
# Optional location of C++ build folder that can be configured by the user
6372
libcugraph_path = get_environment_option('CUGRAPH_BUILD_PATH')
@@ -69,6 +78,9 @@
6978
# https://github.com/rapidsai/raft/issues/83
7079
raft_include_dir = use_raft_package(raft_path, libcugraph_path)
7180

81+
if not libcugraph_path:
82+
libcugraph_path = conda_lib_dir
83+
7284

7385
class CleanCommand(Command):
7486
"""Custom clean command to tidy up the project root."""
@@ -101,16 +113,25 @@ def run(self):
101113
EXTENSIONS = [
102114
Extension("*",
103115
sources=CYTHON_FILES,
104-
include_dirs=[conda_include_dir,
105-
'../cpp/include',
106-
"../thirdparty/cub",
107-
raft_include_dir,
108-
os.path.join(
109-
conda_include_dir, "libcudacxx"),
110-
cuda_include_dir],
111-
library_dirs=[get_python_lib()],
112-
runtime_library_dirs=[conda_lib_dir],
113-
libraries=['cugraph', 'nccl'],
116+
include_dirs=[
117+
conda_include_dir,
118+
ucx_include_dir,
119+
'../cpp/include',
120+
"../thirdparty/cub",
121+
raft_include_dir,
122+
os.path.join(conda_include_dir, "libcudacxx"),
123+
cuda_include_dir,
124+
os.path.dirname(sysconfig.get_path("include"))
125+
],
126+
library_dirs=[
127+
get_python_lib(),
128+
conda_lib_dir,
129+
libcugraph_path,
130+
ucx_lib_dir,
131+
cuda_lib_dir,
132+
os.path.join(os.sys.prefix, "lib")
133+
],
134+
libraries=['cudart', 'cusparse', 'cusolver', 'cugraph', 'nccl'],
114135
language='c++',
115136
extra_compile_args=['-std=c++17'])
116137
]

0 commit comments

Comments
 (0)