GraphBLAS
GraphBLAS copied to clipboard
PLUS_POW semirings
I am creating aggregators in grblas (because they are oh-so-nice to use!) using straightforward recipes in anticipation of SuiteSparse 5 with O(1) dense vectors. I currently have 10 aggregators that use PLUS_POW semirings.
Would you consider adding PLUS_POW semirings? Am I correct in thinking that they can be faster if you include them? Fwiw, it's not difficult for me to create the semirings from plus monoid and pow binaryop.
It would be difficult. All of my built-in semirings must either use commutative binary ops (like TIMES for PLUS_TIMES, where xy == yx), or I have to have them in pairs (like MINUS and RMINUS). This is so that I can handle the "flip" where A*B can be written as B'*A' but only if the multiplicative op can be "flipped". Yes, they would be much faster as built-in semirings. I'm worried about the library size though. Each built-in semiring adds about 200KB to the libgraphblas.so, for each type. So PLUS_POW_T would add about 4MB or so to the *.so, at least. Maybe more. I've trimmed down the # of semirings I create in Source/GB_control. I would also have to have an "RPOW" operator which would compute y^x, which adds still more to the binary size.
Understood, thanks for explaining the benefits and costs. If these are ever available--even optionally--I would opt-in to include them. I'm not so sensitive to binary size, but I know this is a concern for some.
Let's keep this in the potential list of changes to make, so let's leave this as an open issue on github. It needs to be done carefully because of code size, but I might be able to add them yet disable them in the Source/GB_control.h file, like how I disable so many semirings already, to reduce code size. This might have a minimal effect on the total default binary size, yet be extendable to a bigger binary size but with faster PLUS_POW and PLUS_RPOW semirings.
On Tue, May 4, 2021 at 5:44 PM Erik Welch @.***> wrote:
Understood, thanks for explaining the benefits and costs. If these are ever available--even optionally--I would opt-in to include them. I'm not so sensitive to binary size, but I know this is a concern for some.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DrTimothyAldenDavis/GraphBLAS/issues/38#issuecomment-832295689, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYIIOKEQWGA5HAVV2JDRRDTMB2FVANCNFSM44DRI3XA .
The JIT in v8.0.x and later should resolve this issue. Any PLUS_POW semiring should now be just as fast as any built-in semiring. Can we close this issue?
This is handled efficiently by the JIT so there's no need to add built-in operators.