Skip to content

COO matrices support #607

@CarloLucibello

Description

@CarloLucibello

Currently, the default storage type for our graphs is the COO format, which for us is a tuple of 3 vectors, (source, target, edge_weight).

This format is convenient for gather/scatter operations. On the other hand, as we move to using more and more sparse-dense multiplication for efficiency, it would be nice to construct without allocations a COO Sparse Matrix type out of the tuple to perform algebraic allocations. AFAIK, this is also what PyG does.

On CPU, this should be doable using https://github.com/JuliaSmoothOptimizers/SparseMatricesCOO.jl

On CUDA, we have CUSPARSE.CuSparseMatrixCOO. Unfortunately, this format requires edge ordering, which we currently don't guarantee.

  • additional note: PyG/pytorch coo matrix type doesn't enforce edge ordering. Do they bypass CUSPARSE and provide their own multiplication kernels?

What to do:

  • make sure that most layers and operations work we construct a graph with underlying MatrixCOO storage
  • decide if we want to require our COO storage to be sorted

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions