Skip to content

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