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)
It looks like our docs are wrong (screenshot below). We should be usingNETWORKX_CACHE_CONVERTED_GRAPHS not CACHE_CONVERTED_GRAPH to configure caching behavior.
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
Relevant log output
No response
Environment details
Other/Misc.
No response
Code of Conduct