memgraph / mage

MAGE - Memgraph Advanced Graph Extensions :crystal_ball:
Apache License 2.0
259 stars 27 forks source link

[BUG] CPU PageRank faster than cuGraph #482

Open Josipmrden opened 5 months ago

Josipmrden commented 5 months ago

Describe the bug CPU PageRank seems to be faster than cuGraph. Analysis needs to be conducted to investigate why is cuGraph slower. Potentially due to copying of the subgraph to the GPU

Expected behavior cuGraph should perform faster.

Screenshot 2024-06-21 at 13 50 28

Additional context CPU

PROFILE WITH range(95000, 95980) + 
     range(154000, 154776) + 
     range(301000, 301471) + 
     range(397000, 397855) + 
     range(519000, 519881) + 
     range(593000, 593507) + 
     range(691000, 691399) + 
     range(813000, 813407) + 
     range(700000, 700001) +  // Additional range for more coverage
     range(800000, 800001) +  // Additional range for more coverage
     range(848000, 848001)    // Including the latest block height
AS block_heights
UNWIND block_heights AS block_height
MATCH p=(sender:Address)-[sent1:SENT]->(t:Transaction)-[sent2:SENT]->(receiver:Address)
WHERE t.block_height = block_height
WITH project(p) AS subgraph
CALL pagerank.get(subgraph) YIELD node, rank
RETURN round(rank * 100000) / 100000 AS roundedRank 
ORDER BY roundedRank DESC
LIMIT 1;

GPU

PROFILE WITH range(95000, 95980) + 
     range(154000, 154776) + 
     range(301000, 301471) + 
     range(397000, 397855) + 
     range(519000, 519881) + 
     range(593000, 593507) + 
     range(691000, 691399) + 
     range(813000, 813407) + 
     range(700000, 700001) +  // Additional range for more coverage
     range(800000, 800001) +  // Additional range for more coverage
     range(848000, 848001)    // Including the latest block height
AS block_heights
UNWIND block_heights AS block_height
MATCH p=(sender:Address)-[sent1:SENT]->(t:Transaction)-[sent2:SENT]->(receiver:Address)
WHERE t.block_height = block_height
WITH project(p) AS subgraph
CALL cugraph.pagerank.get(subgraph) YIELD node, pagerank
RETURN round(pagerank * 100000) / 100000 AS roundedRank 
ORDER BY roundedRank DESC
LIMIT 1;
Josipmrden commented 5 months ago

{"size(subgraph.nodes)":16048073,"size(subgraph.edges)":23539951}