-
Notifications
You must be signed in to change notification settings - Fork 33
Add latest cuGraph #458
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
base: main
Are you sure you want to change the base?
Add latest cuGraph #458
Conversation
| "$<$<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.
| 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
| 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
| 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
|
|
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 |
|
|





laidenandbetweenness_centrality/opt/conda/include/cugraph/algorithms.hppcontains functions that could be compiled,/opt/conda/lib/libcugraph.soonly 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"mainand resolve conflictssystemctl restart docker; rundocker run -it --rm --gpus all ubuntu nvidia-smito verify (source)mage/setupto 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 addinginitbash script because usually, installation of deps fails (e.g.gdlis 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_modulesfmt(when all is compiled), again issues with fmt+spdlog, spdlog from/opt/condais 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/condaspdlog/fmt/bundled/core.hgabime/spdlog#1897cugraph/algorithms.hppfor some reason doesn't work -> make sure GPU+Docker is oklibcugraph-ops++.soandlibraft.so-> taken fromrapidsai/baseDocker image under/opt/conda/libcugraph.pagerankto work correctly, implement the package process and release Docker image only withmemgraphandpagerankinternallyExperiment / 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