Skip to content
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

[BUG]: Nx-cuGraph caching not working with documentation example #4466

Open
2 tasks done
beckernick opened this issue Jun 5, 2024 · 2 comments · May be fixed by #4478
Open
2 tasks done

[BUG]: Nx-cuGraph caching not working with documentation example #4466

beckernick opened this issue Jun 5, 2024 · 2 comments · May be fixed by #4478
Assignees
Labels
bug Something isn't working

Comments

@beckernick
Copy link
Member

beckernick commented Jun 5, 2024

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)
Screenshot 2024-06-05 at 5 36 54 PM

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

  • I agree to follow cuGraph's Code of Conduct
  • I have searched the open bugs and have found no duplicates for this bug report
@beckernick beckernick added bug Something isn't working ? - Needs Triage Need team to review and classify labels Jun 5, 2024
@beckernick
Copy link
Member Author

beckernick commented Jun 5, 2024

It looks like our docs are wrong (screenshot below). We should be using NETWORKX_CACHE_CONVERTED_GRAPHS not CACHE_CONVERTED_GRAPH to configure caching behavior.

Screenshot 2024-06-05 at 6 22 25 PM

@rlratzel
Copy link
Contributor

Thanks @beckernick for finding this. I've submitted this PR to fix those docs.

@rlratzel rlratzel removed the ? - Needs Triage Need team to review and classify label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants