JuliaSparse / SuiteSparseGraphBLAS.jl

Sparse, General Linear Algebra for Graphs!
MIT License
102 stars 16 forks source link

Porting GraphBLAS to pure Julia? #116

Closed tr00 closed 10 months ago

tr00 commented 1 year ago

Hello everyone,

when browsing thru the C implementation of SuiteSparse:GraphBLAS I couldn't stop asking myself how appealing an implementation would be in a more composable language such as Julia.

TLDR: My question is, has this been considered and what are arguments in favor/against writing a GraphBLAS-like library in pure Julia?

(I know the scope of this package is something else but I figured this would be the best place to ask)

Julia's strong points are comparable performs to C (when avoiding common pitfalls), a high degree of composability and ergonomic/modern language features. The weaknesses of a collection of kernels written in C, Fortran or Assembly are limited composability (or performance degradation) and absence of modern language features.

Especially GraphBLAS which is already quite flexible by allowing arbitrary semirings but needs to dispatch at runtime to the concrete op or rely on indirect calls. Julia can shine here!

We have nice task parallelism, we have SIMD.jl, we have CUDA.jl, we have everything required to make a julian GraphBLAS competitive!

I imagine even the users of GraphBLAS overlap nicely with the scientific community of Julia.

The contra-points I came up with are the Garbage Collector may be interfering and it would be a big undertaking which may never pay off compared to using a wrapper around C.

Anyways, I assume you, the authors & friends of this package, have also played with this thought, so I would like to hear what your considerations are.

Nice regards, Tarik.

rayegun commented 10 months ago

This is eventually the plan, and something I'm actively working on. Garbage collection is not an issue here.

The real issue is that the GraphBLAS spec is notably complex. That's part of the reason we only have 1 real implementation so far. I hope to have a complete but lower performance implementation by the end of the year.