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

Example using nx dispatch hooks (WIP) to print timing #57

Draft
wants to merge 1 commit into
base: branch-25.02
Choose a base branch
from

Conversation

eriknw
Copy link
Contributor

@eriknw eriknw commented Dec 11, 2024

Companion to networkx/networkx#7765, which adds runtime dispatch hooks to networkx.

Example output:

>>> pr = nx.pagerank(nx.complete_graph(1000))
'networkx' backend ran empty_graph in 0.00101 seconds
'networkx' backend ran complete_graph in 0.295 seconds
'networkx' backend ran to_scipy_sparse_array in 0.591 seconds
'networkx' backend ran pagerank in 0.6 seconds

>>> pr = nx.pagerank(nx.complete_graph(1000), backend="cugraph")
'networkx' backend ran empty_graph in 0.000839 seconds
'networkx' backend ran complete_graph in 0.296 seconds
'cugraph' backend ran pagerank in 0.0625 seconds

>>> pr = nx.pagerank(nx.complete_graph(1000, backend="cugraph"))
'cugraph' backend ran complete_graph in 0.00999 seconds
'cugraph' backend ran pagerank in 0.0264 seconds

This is super-basic to begin with. Let's try to find somebody who would want to create (and maintain) a fancier profiling backend.

@eriknw eriknw added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Dec 11, 2024
@eriknw eriknw requested a review from a team as a code owner December 11, 2024 02:12
@eriknw eriknw requested a review from msarahan December 11, 2024 02:12
@eriknw eriknw marked this pull request as draft December 11, 2024 02:13
Copy link

copy-pr-bot bot commented Dec 11, 2024

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improves an existing functionality non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant