cugraph
cugraph copied to clipboard
[BUG]: Nx-cuGraph caching not working with documentation example
trafficstars
Version
24.06
Which installation method(s) does this occur on?
Conda
Describe the bug.
When I ran the documentation example multiple times, I expected performance to be significantly better the second time with caching enabled. Instead, performance was the same and the CPU to GPU conversion was happening every time.
Minimum reproducible example
%env NETWORKX_BACKEND_PRIORITY=cugraph
%env CACHE_CONVERTED_GRAPH=True
import pandas as pd
import networkx as nx
url = "https://data.rapids.ai/cugraph/datasets/cit-Patents.csv"
df = pd.read_csv(url, sep=" ", names=["src", "dst"], dtype="int32")
G = nx.from_pandas_edgelist(df, source="src", target="dst")
env: NETWORKX_BACKEND_PRIORITY=cugraph
env: CACHE_CONVERTED_GRAPH=True
%time result = nx.betweenness_centrality(G, k=10)
CPU times: user 18.1 s, sys: 1.69 s, total: 19.8 s
Wall time: 20.7 s
%time result = nx.betweenness_centrality(G, k=10)
CPU times: user 19.6 s, sys: 859 ms, total: 20.4 s
Wall time: 20.6 s
%%snakeviz
result = nx.betweenness_centrality(G, k=10)
Relevant log output
No response
Environment details
!conda list | grep "cugraph\|networkx"
cugraph 24.06.00a94 cuda12_py310_240604_g1667f7a43_94 rapidsai-nightly
libcugraph 24.06.00a94 cuda12_240604_g1667f7a43_94 rapidsai-nightly
libcugraph_etl 24.06.00a94 cuda12_240604_g1667f7a43_94 rapidsai-nightly
libcugraphops 24.06.00a24 cuda12_240603_gac69d0a6_24 rapidsai-nightly
networkx 3.3 pyhd8ed1ab_1 conda-forge
nx-cugraph 24.06.00a94 py310_94 rapidsai-nightly
pylibcugraph 24.06.00a94 cuda12_py310_240604_g1667f7a43_94 rapidsai-nightly
Other/Misc.
No response
Code of Conduct
- [X] I agree to follow cuGraph's Code of Conduct
- [X] I have searched the open bugs and have found no duplicates for this bug report