-
Notifications
You must be signed in to change notification settings - Fork 17
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
>10X slower for zeroing out row and column slice #109
Comments
So what exactly do you want to do here? What you're doing is setting all those indices to be explicitly I probably need better docs and apis for this. You want those to become implicit zeros? |
Without changing the sparsity, I want the nonzero entries at this row and column to be ZERO. |
When doing this for the default CSC matrix, it is actually only changing those nonzeros to 0-value nonzeros. |
I think I can find a relatively performant solution involving masks. I have to update the package though to fix a bug I found writing the solution. @DrTimothyAldenDavis what's the fastest way of doing these operations? This is one use-case where the range based masks I've discussed with you before would be useful. We want to do something like |
Probably the best way to do this would be GrB_assign, with a structural mask that is the same as the matrix you are modifying. So It looks like this will select my internal kernel called GB_subassign_05, which is a bit more general, doing But it doesn't seem that I exploit it in this case. I'll get a binary search in the inner loop, as a result. It will be decent in performance but I could do better. I have a blizzard of methods for GrB_assign (about 40?). A 41st method, which did would speed this up quite a bit. |
Note that in the assignnment, the scalar 0 is an explicit zero, not an implicit one. I do have "zombie assignment" methods that delete all entries in a single row or single column, but that's not what you want here. |
No need to construct a special mask for this case, if that's what I understand what is meant by the dot equal ( |
Using the mask as is with assign I didn't think of! That's great thank you. Dot assignment lowers to subassign. I need to automatically dispatch to assign when I detect the larger mask, I'll release that change shortly. |
For the above code, GBMatrix is > 13.5 times slower than the default sparse matrix for a 20k * 20k sparse matrix with 0.018% sparsity.
The text was updated successfully, but these errors were encountered: