-
Notifications
You must be signed in to change notification settings - Fork 7
MSBFS #90
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
MSBFS #90
Conversation
Benchmarks fix
open GraphBLAS.FSharp.Backend.Matrix.LIL | ||
open GraphBLAS.FSharp.Backend.Matrix.COO | ||
|
||
module internal MSBFS = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can BFS also be Parents and Leveles? Can unified interface be created?
/// </remarks> | ||
/// <param name="clContext">OpenCL context.</param> | ||
/// <param name="workGroupSize">Should be a power of 2 and greater than 1.</param> | ||
let mergeDisjoint (clContext: ClContext) workGroupSize = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it is not an element-wise operation over two matrices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Element-wise operations are slow due to the use of a prefix sum. And they allocate much more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can implement it using map2, but, I guess, it will be less efficient, because inside map2 dense matrix is allocated first. MergeDisjoint allocates matrix of the required size without the need to truncate it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Looks reasonable.
@@ -393,8 +393,7 @@ module Matrix = | |||
{ Context = clContext | |||
RowCount = matrix.RowCount | |||
ColumnCount = matrix.ColumnCount | |||
Rows = rows | |||
NNZ = matrix.NNZ } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why NNZ is removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a property inside LIL for recounting NNZ instead of keeping fixed NNZ in this field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
/// </remarks> | ||
/// <param name="clContext">OpenCL context.</param> | ||
/// <param name="workGroupSize">Should be a power of 2 and greater than 1.</param> | ||
let mergeDisjoint (clContext: ClContext) workGroupSize = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Element-wise operations are slow due to the use of a prefix sum. And they allocate much more
Proposed Changes
Types of changes
What types of changes does your code introduce to GraphBLAS-sharp?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...