-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add latest cuGraph #458
base: main
Are you sure you want to change the base?
Add latest cuGraph #458
Conversation
@@ -108,6 +110,6 @@ macro(target_mage_cugraph target_name) | |||
PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${MAGE_CXX_FLAGS}>" | |||
"$<$<COMPILE_LANGUAGE:CUDA>:${MAGE_CUDA_FLAGS}>" | |||
) | |||
target_link_libraries("${target_name}" PRIVATE mage_cugraph) | |||
target_link_libraries("${target_name}" PRIVATE mage_cugraph CUDA::toolkit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CUDA::toolkit
here probably should be deleted here because it's already included.
@@ -64,8 +64,8 @@ void BetweennessProc(mgp_list *args, mgp_graph *graph, mgp_result *result, mgp_m | |||
weight_property, kDefaultWeight); | |||
if (mg_graph->Empty()) return; | |||
|
|||
// TODO(gitbuda): The betweenness_centrality legacy function still works -> try to replace with latest option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO(gitbuda): Update types and inject valid ids / edge types. | ||
rmm::device_uvector<int64_t> cu_edge_ids(mg_edge_ids.size(), stream); | ||
raft::update_device(cu_edge_ids.data(), mg_edge_ids.data(), mg_edge_ids.size(), stream); | ||
rmm::device_uvector<int32_t> cu_edge_types(mg_edge_types.size(), stream); | ||
raft::update_device(cu_edge_types.data(), mg_edge_types.data(), mg_edge_types.size(), stream); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all optional, the only algo using edge edge ids and types, uniform_neighbor sampling, part of the GNN workflow
handle, std::move(cu_vertices), std::move(cu_src), std::move(cu_dst), std::move(cu_weight), | ||
cugraph::graph_properties_t{false, false}, false, false); | ||
std::move(cu_edge_ids), std::move(cu_edge_types), cugraph::graph_properties_t{false, false}, false, false); | ||
stream.synchronize_no_throw(); | ||
|
||
return std::move(cu_graph); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add weights here that's 100% required
// TODO(gitbuda): Update types and inject valid ids / edge types. | ||
rmm::device_uvector<int64_t> cu_edge_ids(mg_edge_ids.size(), stream); | ||
raft::update_device(cu_edge_ids.data(), mg_edge_ids.data(), mg_edge_ids.size(), stream); | ||
rmm::device_uvector<int32_t> cu_edge_types(mg_edge_types.size(), stream); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edge type is int32_t if prebuilt libraries are use
but since this is not used in our current use-cases, delete this part because it will just do useless work
// Define handle and operation stream | ||
raft::handle_t handle{}; | ||
auto stream = handle.get_stream(); | ||
// TODO(gitbuda): Inject the valid seed. | ||
raft::random::RngState rng_state(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some mechanism for selecting random seed
depends on the use-case, param to the caller, there is a parallel race condition 10% of the times with the same seed
any update? look like cugraph.pagerank still results different output compared with pagerank cpu version |
@nad010286 nothing yet, just didn't have a chance to finish this work, but it's still on the short-term TODO list 😄 |
Hi @nad010286! I've made some progress on a small scale. Seems like the regular CPU pagerank and cugraph pagerank are producing the same outputs (CPU test case vs cugraph test case) 🤔 Can you please provide a test case from your side (something reasonable in size, max 100k nodes + edges), in the
|
Quality Gate failedFailed conditions |
hey, Im having issue to build the cuGraph and MAGE from source :( any instructions or things I have to pay attention to? Or if you can send me the docker image that you already built, Im happy to perform some tests for you with loads of graph data |
I would also be very interested in an updated guide on how to build cugraph mage - I tried building the main branch with CUDA 11.8 but the nvcc compiler does not support C++ 20, so it fails with unorder_map::contains later on. |
managed to build and run some tests @gitbuda |
Quality Gate passedIssues Measures |
Quality Gate passedIssues Measures |
laiden
andbetweenness_centrality
/opt/conda/include/cugraph/algorithms.hpp
contains functions that could be compiled,/opt/conda/lib/libcugraph.so
only contains certain instantiations of these functions (NOTE: it's not just template arguments, also whole functions are missing) -> a useful command to figure stuff out is `nm -C /opt/conda/lib/libcugraph.so | grep "cugraph::betweenness"main
and resolve conflictssystemctl restart docker
; rundocker run -it --rm --gpus all ubuntu nvidia-smi
to verify (source)mage/setup
to pick individual libraries to install -> add that as a docker argument because usually, someone needs a specific binary (while the whole think doesn't compile); consider addinginit
bash script because usually, installation of deps fails (e.g.gdl
is a very complex dependency)Docker Build Commands
Docker Base Images
Done
python3 /mage/setup build --gpu --cpp-build-flags MAGE_CUGRAPH_ROOT=/opt/conda CMAKE_C_COMPILER=gcc CMAKE_CXX_COMPILER=g++ -p /usr/lib/memgraph/query_modules
fmt
(when all is compiled), again issues with fmt+spdlog, spdlog from/opt/conda
is not ok (maybe interesting Unable to compile spdlog with GCC gabime/spdlog#2825); fmt v9 doesn't compile with used g++, fmt v10 doesn't work with the spdlog in the/opt/conda
spdlog/fmt/bundled/core.h
gabime/spdlog#1897cugraph/algorithms.hpp
for some reason doesn't work -> make sure GPU+Docker is oklibcugraph-ops++.so
andlibraft.so
-> taken fromrapidsai/base
Docker image under/opt/conda/lib
cugraph.pagerank
to work correctly, implement the package process and release Docker image only withmemgraph
andpagerank
internallyExperiment / Optional
Description
Please briefly explain the changes you made here.
Pull request type
Related issues
Delete if this PR doesn't resolve any issues. Link the issue if it does.
######################################
Reviewer checklist (the reviewer checks this part)
Module/Algorithm
Documentation checklist