Skip to content

Split #75

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

Merged
merged 46 commits into from
Apr 29, 2023
Merged

Split #75

merged 46 commits into from
Apr 29, 2023

Conversation

IgorErin
Copy link
Contributor

@IgorErin IgorErin commented Apr 21, 2023

Proposed Changes

  • LIL matrix format
  • Row wise SpGeMM

Types of changes

What types of changes does your code introduce to GraphBLAS-sharp?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

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.

  • Build and tests pass locally
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

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...

<Compile Include="Vector\Dense\Vector.fs" />
<Compile Include="Vector/Sparse/Common.fs" />
<Compile Include="Vector/Sparse/Map2AtLeastOne.fs" />
<Compile Include="Vector/Sparse/Map2.fs" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path style.

@IgorErin IgorErin requested a review from gsvgit April 22, 2023 07:28
README.md Outdated
- [ ] `iter`
- [ ] ...
- **Vector**
- [ ] `map`
- [x] `map`
- [ ] `iter`
- [ ] `filter`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about filter and contains?

README.md Outdated
- [ ] CSR-CSR multiplication
- [ ] COO transpose
- [ ] CSR transpose
- [x] COO-COO `map2`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about masking?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand, masking is expressed through map2. Should I explicitly state this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... I think, you are right. I guess, we should provide mapping between GraphBLAS# and GraphBLAS API.

@@ -470,3 +471,232 @@ module ClArray =
assignValues processor firstValues secondValues positions result

result

let getChunk (clContext: ClContext) workGroupSize =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be unified with Array.Copy?

|> Seq.map (fun lazyValue -> lazyValue.Value)
|> Seq.toArray

let blit<'a> (clContext: ClContext) workGroupSize =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array.Copy again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's still a blit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well. I was confused by differences between .net and f# libraries. For our library f# stile is preferred.

if firstPosition + count > targetArray.Length then
failwith "The array should fit completely"

if firstPosition < 0 then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we can not require firstPosition ti be uint? The same for other parameters that must be nonnegative.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original api uses ints...


processor.Post(Msg.CreateRunMsg<_, _>(kernel))

let pairwise (clContext: ClContext) workGroupSize =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it zip?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it's still pairwise

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A... Ok. I see.

let copy = ClArray.copy clContext workGroupSize

let copyData = ClArray.copy clContext workGroupSize

let vectorCopy =
Vector.Sparse.Vector.copy clContext workGroupSize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vector.Sparse.Vector looks strange. Can one of Vector-s be removed?

open GraphBLAS.FSharp.Backend.Objects.ClVector
open GraphBLAS.FSharp.Backend.Objects.ClMatrix

type Indices = ClArray<int>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is really useful, can it be used everywhere we use indices?

But I'm quite sceptical about type aliases in F# because one still can pass ClArray as a parameter. So, type aliases are not restrictive enough to be useful.

@IgorErin IgorErin requested a review from gsvgit April 29, 2023 13:39
let map2 =
map2Inplace<'a, 'b, 'c> clContext workGroupSize map
map2InPlace<'a, 'b, 'c> map clContext workGroupSize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is map2InPlace actually iter2?

@gsvgit gsvgit merged commit fb1909c into SparseLinearAlgebra:dev Apr 29, 2023
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

Successfully merging this pull request may close these issues.

2 participants