Skip to content

CUDA copy_xj propagate sparse support and benchmarks #605

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

Merged
merged 3 commits into from
Jul 6, 2025

Conversation

dferre97
Copy link
Contributor

@dferre97 dferre97 commented Jul 3, 2025

Added fast copy_xj propagate CUDA support for sparse graphs using SpMM.
Added benchmarks to compare with gather/scatter approach, speedup of 100-200x on average.

@@ -213,7 +213,7 @@ end
## COPY_XJ

function propagate(::typeof(copy_xj), g::GNNGraph, ::typeof(+), xi, xj::AbstractMatrix, e)
A = adjacency_matrix(g, weighted = false)
A = adjacency_matrix(g, eltype(xj); weighted = false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the cast to the xj type necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, for the sparse case, because the SpMM mm! function in CUSPASE expects the type of the adjmat and the feature matrix to be the same, so we need to cast the adjmat before multiplying.

@CarloLucibello CarloLucibello merged commit 0221593 into JuliaGraphs:master Jul 6, 2025
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants