memgraph / mage

MAGE - Memgraph Advanced Graph Extensions :crystal_ball:
Apache License 2.0
238 stars 23 forks source link

Add latest cuGraph #458

Open gitbuda opened 3 months ago

gitbuda commented 3 months ago

Docker Build Commands

docker build -f Dockerfile.experiment_partial -t mage-cugraph-part --progress plain .
docker run -it --rm --gpus all mage-cugraph-part bash

docker build -f Dockerfile.experiment_full -t mage-cugraph-full --progress plain .

docker run -it --rm --gpus all mage-cugraph-full bash
cd /mage/cpp/build
cmake -DMAGE_CUGRAPH_ENABLE=ON -DMAGE_CUGRAPH_ROOT=/opt/conda ..
VERBOSE=1 make cugraph.pagerank
make cugraph.pagerank cugraph.personalized_pagerank cugraph.louvain cugraph.katz_centrality cugraph.leiden cugraph.betweenness_centrality cugraph.balanced_cut_clustering cugraph.spectral_clustering cugraph.hits cugraph.generator

python3 /mage/setup build --gpu --cpp-build-flags CMAKE_BUILD_TYPE=Release MAGE_CUGRAPH_ROOT=/opt/conda/ -p /usr/lib/memgraph/query_modules/

docker run -it --rm --gpus all -p 7687:7687 mage-cugraph-full --log-level=TRACE --also-log-to-stderr

# if building memgraph, do it outside the /mage/cpp/memgraph because that's copied to during Docker build
cd /tmp/mage/cpp/dist
cp ../build/cugraph_module/cugraph.pagerank.so ./

cd /tmp/mage && ./test_e2e -k "pagerank_test-test_cugraph_influential"

Docker Base Images

Done

Experiment / 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

nad010286 commented 1 month ago

any update? look like cugraph.pagerank still results different output compared with pagerank cpu version

gitbuda commented 1 month ago

@nad010286 nothing yet, just didn't have a chance to finish this work, but it's still on the short-term TODO list 😄

gitbuda commented 1 month ago

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 e2e test format 🙏:

sonarcloud[bot] commented 1 month ago

Quality Gate Failed Quality Gate failed

Failed conditions
6 Security Hotspots

See analysis details on SonarCloud

nad010286 commented 1 month ago

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 e2e test format 🙏:

  • The graph should be in the .cyp format (it's actually cypher per line, it can be many lines, but it's important to not break down single query into multiple lines) GRAPH INPUT EXAMPLE
  • The test case should be in the .yml format (make sure you have everything, the exact query, and exact outputs) TEST CASE EXAMPLE

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

intuitiveminds commented 1 month ago

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 e2e test format 🙏:

  • The graph should be in the .cyp format (it's actually cypher per line, it can be many lines, but it's important to not break down single query into multiple lines) GRAPH INPUT EXAMPLE
  • The test case should be in the .yml format (make sure you have everything, the exact query, and exact outputs) TEST CASE EXAMPLE

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.

nad010286 commented 2 weeks ago

managed to build and run some tests @gitbuda The results are similar with very small difference. But processing time is worse than CPU. Not sure if GPU is used because by monitoring the GPU via nvidia-smi, I can only see power consumption increase after the result is out. Also no VRAM is used.