-
Notifications
You must be signed in to change notification settings - Fork 310
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
nx-cugraph: Fixes dependency on missing feature, adds attrs to allow auto-dispatch for generators #4558
Closed
rlratzel
wants to merge
12
commits into
rapidsai:branch-24.10
from
rlratzel:branch-24.10-nxcg_new_graph_proto
Closed
nx-cugraph: Fixes dependency on missing feature, adds attrs to allow auto-dispatch for generators #4558
rlratzel
wants to merge
12
commits into
rapidsai:branch-24.10
from
rlratzel:branch-24.10-nxcg_new_graph_proto
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…n replacement for networkx.Graph.
…0-nxcg_new_graph_proto
rlratzel
added
improvement
Improvement / enhancement to an existing function
non-breaking
Non-breaking change
labels
Jul 27, 2024
rlratzel
changed the title
Updates to make
Updates to make Jul 31, 2024
nx_cugraph.Graph
a subclass of nx.Graph
, adds attrs for auto-dispatch for generatorsnx_cugraph.Graph
a drop-in replacement for nx.Graph
, adds attrs for auto-dispatch for generators
…0-nxcg_new_graph_proto
…0-nxcg_new_graph_proto
rapids-bot bot
pushed a commit
that referenced
this pull request
Sep 24, 2024
…workX Graph classes, needed for zero code change graph generators (#4629) This is an alternative approach to #4558 for enabling GPU-accelerated NetworkX to "just work". It has similarities to #4558. I opted to make separate classes such as `ZeroGraph`, which I think makes for cleaner separation and gives us and users more control. There are a few lingering TODOs and code comments to tidy up, but I don't think there are any show-stoppers. I have not updated methods (such as `number_of_nodes`) to optimistically try to use GPU if possible, b/c this is not strictly necessary, but we should update these soon. I have run NetworkX tests with these classes using networkx/networkx#7585 and networkx/networkx#7600. We need the behavior in 7585, and 7600 is only useful for testing. There are only 3 new failing tests, and 3 tests that hang (I'll run them overnight to see if they finish). Here's a test summary: ``` 5548 passed, 24 skipped, 16 xfailed, 25 xpassed ``` Note that 25 tests that were failing now pass. I have not investigated test failures, xfails, or xpasses yet. I would like to add tests too. We rely heavily on the networkx cache. I think this is preferred. It is late for me. I will describe and show how and why this works later. I opted for `zero=` and `ZeroGraph`, because I find them delightful! Renaming is trivial if other terms are preferred. CC @quasiben Authors: - Erik Welch (https://github.com/eriknw) Approvers: - Bradley Dice (https://github.com/bdice) - Rick Ratzel (https://github.com/rlratzel) URL: #4629
rlratzel
changed the title
Updates to make
nx-cugraph: Adds attrs to allow auto-dispatch for generators
Sep 25, 2024
nx_cugraph.Graph
a drop-in replacement for nx.Graph
, adds attrs for auto-dispatch for generators
rlratzel
changed the title
nx-cugraph: Adds attrs to allow auto-dispatch for generators
nx-cugraph: Fixes dependency on missing feature, adds attrs to allow auto-dispatch for generators
Sep 26, 2024
rlratzel
added
bug
Something isn't working
and removed
improvement
Improvement / enhancement to an existing function
labels
Sep 26, 2024
Closing this now that networkx/networkx#7578 has been merged and the upstream code dependency is in place as well as the needed dispatching feature. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a breaking change that was merged in #4629, based on an assumption the NetworkX 3.4 will have that feature.
Resulting from a dependency on a feature in an unmerged NetworkX PR. We may revisit this fix later and possibly just close this PR if that feature is merged into NetworkX.
This PR also updates nx-cugraph
Graph
andDiGraph
classes to inherit fromnx.Graph
, and adds the appropriatecached_properties
to lazily convert and cache to a NetworkX Graph and expose the appropriate dictionaries accordingly. These changes allow anx_cugraph.Graph
instance to be drop-in compatible with networkx functions that are not yet supported by nx_cugraph.Combine this with the changes to NetworkX in this PR to auto dispatch generators if they return compatible backend types and allow compatible backend types to fallback to networkx, and users can maximize e2e acceleration for their workflows without code changes.
No backends used:
nx-cugraph backend used - nx-cugraph does not yet support
coloring.greedy_color()
ornx.coloring.equitable_coloring.pad_graph()
, note the first call to coloring includes the conversion to a networkx Graph, but the second uses the cached conversion:Also note, when debug logging is enabled, you can see calls made from within networkx functions being dispatched appropriately:
zcc_demo.py.txt