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

Support for SparseMatrixCSC{Float64, Int32} #144

Open
RoyiAvital opened this issue Sep 21, 2024 · 7 comments
Open

Support for SparseMatrixCSC{Float64, Int32} #144

RoyiAvital opened this issue Sep 21, 2024 · 7 comments

Comments

@RoyiAvital
Copy link

See the code below:

mT = SparseMatrixCSC{Float64, int32}(sprand(1_000, 1_000, 0.01));
GBMatrix(mT); #<! Error!

The last line will just error.
It would be great to have support for SparseMatrixCSC{T, N} where T <: Union{Float16, Float32, Float64, Float128}, N <: Union{Int16, Int32, Int64}.

@rayegun
Copy link
Member

rayegun commented Sep 21, 2024 via email

@RoyiAvital
Copy link
Author

Support does not mean change the underlying.
Just support converting it without creating an error.

Even something like that:

GBMatrix(SparseMatrixCSC{elttype(mT), Int64}(mT));

Will do.

@rayegun
Copy link
Member

rayegun commented Sep 21, 2024 via email

@RoyiAvital
Copy link
Author

Is there a real reason not to support Int32 in the c code?
Does it mean a lot of work?

Just wonder if there any point in asking for it.

@rayegun
Copy link
Member

rayegun commented Sep 21, 2024 via email

@RoyiAvital
Copy link
Author

The added value is speed.
The throughput with 32 Bit is twice.

I don't know about GraphBLAS, but for certain in many sparse related algorithms it makes a difference since most of the data to process are indices. So the cache is twice as big effectively, the bandwidth, etc...

@rayegun
Copy link
Member

rayegun commented Sep 21, 2024

As I mentioned it's only valuable when the data type of your values is small, and it's not twice always twice as fast. It depends on the internal representation.

I agree with you, it's very valuable especially as people often deal with smaller types these days. I'll bring it up in committee meetings but I wouldn't expect progress on that front until next year at the earliest.

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

No branches or pull requests

2 participants