Updates to make nx_cugraph.Graph
a drop-in replacement for nx.Graph
, adds attrs for auto-dispatch for generators
#4558
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.
TODO:
add_node()
, et.al.)This 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