Repository navigation
Conversation
…kx into test_backend_graph_classes
Perhaps it makes the most sense to test with the default "networkx" implementation for everything when using a backend graph as a networkx graph since this will exercise the graph the most.
rapids-bot Bot
pushed a commit
to rapidsai/cugraph
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
This branch has not been deployed
This file contains hidden or 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
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.
Previously, running networkx tests with backends allowed backend algorithms to be tested. This PR makes it so that backend graph classes can be tested directly by e.g. running tests in
networkx/classes/or running dispatchable functions with backend graphs using the default networkx implementation.This uses trickery with
__new__, so there may be a few rough edges, although it seemed to work quite well overall in my experiments. Another approach could be to monkey patch e.g.nx.Graph = backend_interface.Graph, but I think this approach would also need to update all modules whereGraphwas imported and functions that useGraphas a default argument. The approach with__new__does not test subclassing.For CI, I only run tests in
networkx.classesfor the sake of time. I ran all tests locally. The only failures were a couple doctests that print the repr oftype(G).CC @aMahanna; you may find this useful.
CC @rlratzel; this may be useful for testing nx-cugraph graphs for networkx compatibility.