Skip to content

Commit 48404f9

Browse files
committed
Merge remote-tracking branch 'YaccConstructor/master' into pr
2 parents 1302d8e + 8a79b41 commit 48404f9

File tree

201 files changed

+3183
-1605
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+3183
-1605
lines changed

.github/workflows/build-docs.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: BuildDocs
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
win-build:
10+
name: Windows Build Docs
11+
runs-on: windows-latest
12+
defaults:
13+
run:
14+
shell: cmd
15+
steps:
16+
- name: System Info
17+
run: systeminfo
18+
19+
- uses: actions/checkout@v3
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v3
22+
with:
23+
global-json-file: global.json
24+
25+
- name: Build
26+
run: ./build.cmd BuildDocs
27+
env:
28+
CI: true
29+
30+
linux-build:
31+
name: Linux Build Docs
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: System Info
35+
run: lscpu
36+
37+
- uses: actions/checkout@v3
38+
- name: Setup .NET
39+
uses: actions/setup-dotnet@v3
40+
with:
41+
global-json-file: global.json
42+
43+
- name: Build
44+
run: |
45+
chmod +x ./build.sh
46+
./build.sh BuildDocs
47+
env:
48+
CI: true

.github/workflows/build-on-push.yml

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
win-build:
11-
name: Windows Build (No Tests)
10+
win-build-release:
11+
name: Windows Release Build (No Tests)
1212
runs-on: windows-latest
1313
defaults:
1414
run:
@@ -28,9 +28,34 @@ jobs:
2828
# Work around https://github.com/actions/setup-dotnet/issues/29
2929
DOTNET_ROOT: ${{ runner.tool_cache }}/dncs/${{ matrix.dotnet }}/x64
3030
CI: true
31+
CONFIGURATION: Release
32+
33+
win-build-debug:
34+
name: Windows Debug Build (No Tests)
35+
runs-on: windows-latest
36+
defaults:
37+
run:
38+
shell: cmd
39+
steps:
40+
- name: System Info
41+
run: systeminfo
42+
43+
- uses: actions/checkout@v2
44+
45+
- name: Setup .NET Core
46+
uses: actions/setup-dotnet@v1
47+
48+
- name: Build
49+
run: ./build.cmd DotnetBuild
50+
env:
51+
# Work around https://github.com/actions/setup-dotnet/issues/29
52+
DOTNET_ROOT: ${{ runner.tool_cache }}/dncs/${{ matrix.dotnet }}/x64
53+
CI: true
54+
CONFIGURATION: Debug
55+
3156

3257
win-test:
33-
name: Windows Build And Test
58+
name: Windows Release Build And Test
3459
if: github.repository_owner != 'YaccConstructor'
3560
runs-on: windows-latest
3661
defaults:
@@ -68,9 +93,32 @@ jobs:
6893
# Work around https://github.com/actions/setup-dotnet/issues/29
6994
DOTNET_ROOT: ${{ runner.tool_cache }}/dncs/${{ matrix.dotnet }}/x64
7095
CI: true
96+
CONFIGURATION: Release
97+
98+
linux-build-debug:
99+
name: Linux Debug Build (No Tests)
100+
runs-on: ubuntu-latest
101+
steps:
102+
- name: System Info
103+
run: lscpu
104+
105+
- uses: actions/checkout@v1
106+
107+
- name: Setup .NET
108+
uses: actions/setup-dotnet@v1
109+
110+
- name: Build
111+
run: |
112+
chmod +x ./build.sh
113+
./build.sh DotnetBuild
114+
env:
115+
# Work around https://github.com/actions/setup-dotnet/issues/29
116+
DOTNET_ROOT: ${{ runner.tool_cache }}/dncs/${{ matrix.dotnet }}/x64
117+
CI: true
118+
CONFIGURATION: Debug
71119

72-
linux-build:
73-
name: Linux Build (No Tests)
120+
linux-build-release:
121+
name: Linux Release Build (No Tests)
74122
runs-on: ubuntu-latest
75123
steps:
76124
- name: System Info
@@ -89,9 +137,10 @@ jobs:
89137
# Work around https://github.com/actions/setup-dotnet/issues/29
90138
DOTNET_ROOT: ${{ runner.tool_cache }}/dncs/${{ matrix.dotnet }}/x64
91139
CI: true
140+
CONFIGURATION: Release
92141

93142
linux-test:
94-
name: Linux Build And Test
143+
name: Linux Release Build And Test
95144
if: github.repository_owner != 'YaccConstructor'
96145
runs-on: ubuntu-latest
97146
steps:
@@ -121,6 +170,7 @@ jobs:
121170
# Work around https://github.com/actions/setup-dotnet/issues/29
122171
DOTNET_ROOT: ${{ runner.tool_cache }}/dncs/${{ matrix.dotnet }}/x64
123172
CI: true
173+
CONFIGURATION: Release
124174

125175
linux-test-self-hosted:
126176
name: Linux Self-Hosted Test
@@ -143,3 +193,4 @@ jobs:
143193
# Work around https://github.com/actions/setup-dotnet/issues/29
144194
DOTNET_ROOT: ${{ runner.tool_cache }}/dncs/${{ matrix.dotnet }}/x64
145195
CI: true
196+
CONFIGURATION: Release

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish Nuget packages
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish-self-hosted:
10+
name: Build, test, and publish Nuget packages on self-hosted server with GPU
11+
if: github.repository_owner == 'YaccConstructor'
12+
runs-on: self-hosted
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: OpenCL Info
17+
run: clinfo
18+
19+
- name: Build, test, publish
20+
env:
21+
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
22+
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }}
23+
FAKE_DETAILED_ERRORS: true
24+
CI: true
25+
run: |
26+
chmod +x ./build.sh
27+
./build.sh Publish

.github/workflows/release-docs.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release Docs
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
10+
linux-build:
11+
name: Linux Release Docs
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v3
17+
with:
18+
global-json-file: global.json
19+
20+
- name: ReleaseDocs
21+
run: |
22+
chmod +x ./build.sh
23+
./build.sh ReleaseDocs
24+
env:
25+
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }}
26+
FAKE_DETAILED_ERRORS: true
27+
CI: true

CHANGELOG.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

7-
## [Unreleased]
8+
## [0.1.0-alpha1] - 2023-05-18
89

9-
## [0.1.0] - 2017-03-17
10-
First release
10+
First release. For demo and tests. Basic linear algebra only. No graph algorithms.
1111

1212
### Added
13-
- This release already has lots of features
13+
- Basic functions for vectors and matrices creation
14+
- Basic functions for vectors manipulation: map, reduce
15+
- Basic functions for matrices manipulation: map, transpose
16+
- Matrix-matrix element-wise functions (map2)
17+
- Vector-vector element-wise functions (map2)
18+
- Sparse matrix multiplication
19+
- Kronecker product
1420

15-
[0.1.0]: https://github.com/user/MyCoolNewLib.git/releases/tag/v0.1.0
21+
[Unreleased]: https://github.com/YaccConstructor/GraphBLAS-sharp/compare/v0.1.0-alpha1...HEAD
22+
[0.1.0-alpha1]: https://github.com/YaccConstructor/GraphBLAS-sharp/releases/tag/v0.1.0-alpha1

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ GraphBLAS# is a GPGPU-based [GraphBLAS](https://graphblas.org/)-like API impleme
3030
- [x] COO-COO `map2`
3131
- [x] COO-COO `map2AtLeastOne`
3232
- [x] CSR-CSR multiplication
33+
- [x] CSR-CSR Kronecker product
3334
- **Vector-Matrix**
3435
- [x] Dense-CSR multiplication
3536
- [ ] Sparse-CSR multiplication
@@ -231,6 +232,13 @@ build.cmd
231232
```
232233
To find more options look at [MiniScaffold](https://github.com/TheAngryByrd/MiniScaffold). We use it in our project.
233234

235+
### Release
236+
The release process is automated: NuGet packages publishing process is triggered by tag pushing to any branch.
237+
To release new version one should
238+
1. [Add release notes to CHANGELOG](https://github.com/TheAngryByrd/MiniScaffold/blob/master/Content/Library/README.md#releasing)
239+
2. Run ```./build.sh Release [version]``` (on local machine)
240+
241+
234242
## License
235243
This project licensed under MIT License. License text can be found in the [license file](https://github.com/YaccConstructor/GraphBLAS-sharp/blob/master/LICENSE.md).
236244

benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/BFS.fs

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
open System.IO
44
open BenchmarkDotNet.Attributes
5+
open Microsoft.FSharp.Core
6+
open Brahma.FSharp
57
open GraphBLAS.FSharp
6-
open GraphBLAS.FSharp.Backend.Quotes
78
open GraphBLAS.FSharp.IO
8-
open Brahma.FSharp
9-
open Backend.Algorithms.BFS
10-
open Microsoft.FSharp.Core
11-
open GraphBLAS.FSharp.Backend.Objects.ArraysExtensions
129
open GraphBLAS.FSharp.Benchmarks
13-
open GraphBLAS.FSharp.Backend.Objects
10+
open GraphBLAS.FSharp.Objects
11+
open GraphBLAS.FSharp.Objects.ArraysExtensions
12+
open GraphBLAS.FSharp.Backend.Quotes
1413

1514
[<AbstractClass>]
1615
[<IterationCount(100)>]
@@ -20,11 +19,12 @@ type Benchmarks<'elem when 'elem : struct>(
2019
buildFunToBenchmark,
2120
converter: string -> 'elem,
2221
binaryConverter,
23-
vertex: int)
22+
vertex: int,
23+
buildMatrix)
2424
=
2525

2626
let mutable funToBenchmark = None
27-
let mutable matrix = Unchecked.defaultof<ClMatrix.CSR<'elem>>
27+
let mutable matrix = Unchecked.defaultof<ClMatrix<'elem>>
2828
let mutable matrixHost = Unchecked.defaultof<_>
2929

3030
member val ResultLevels = Unchecked.defaultof<ClArray<'elem option>> with get,set
@@ -69,7 +69,7 @@ type Benchmarks<'elem when 'elem : struct>(
6969
this.ResultLevels <- this.FunToBenchmark this.Processor matrix vertex
7070

7171
member this.ClearInputMatrix() =
72-
(matrix :> IDeviceMemObject).Dispose this.Processor
72+
matrix.Dispose this.Processor
7373

7474
member this.ClearResult() = this.ResultLevels.FreeAndWait this.Processor
7575

@@ -82,7 +82,7 @@ type Benchmarks<'elem when 'elem : struct>(
8282
matrixHost <- this.InputMatrixReader.ReadMatrix converter
8383

8484
member this.LoadMatrixToGPU() =
85-
matrix <- matrixHost.ToCSR.ToDevice this.OclContext
85+
matrix <- buildMatrix this.OclContext matrixHost
8686

8787
abstract member GlobalSetup : unit -> unit
8888

@@ -96,13 +96,15 @@ type WithoutTransferBenchmark<'elem when 'elem : struct>(
9696
buildFunToBenchmark,
9797
converter: string -> 'elem,
9898
boolConverter,
99-
vertex) =
99+
vertex,
100+
buildMatrix) =
100101

101102
inherit Benchmarks<'elem>(
102103
buildFunToBenchmark,
103104
converter,
104105
boolConverter,
105-
vertex)
106+
vertex,
107+
buildMatrix)
106108

107109
[<GlobalSetup>]
108110
override this.GlobalSetup() =
@@ -125,10 +127,11 @@ type WithoutTransferBenchmark<'elem when 'elem : struct>(
125127
type BFSWithoutTransferBenchmarkInt32() =
126128

127129
inherit WithoutTransferBenchmark<int>(
128-
(singleSource ArithmeticOperations.intSumOption ArithmeticOperations.intMulOption),
130+
(Algorithms.BFS.singleSource ArithmeticOperations.intSumOption ArithmeticOperations.intMulOption),
129131
int32,
130132
(fun _ -> Utils.nextInt (System.Random())),
131-
0)
133+
0,
134+
(fun context matrix -> ClMatrix.CSR <| matrix.ToCSR.ToDevice context))
132135

133136
static member InputMatrixProvider =
134137
Benchmarks<_>.InputMatrixProviderBuilder "BFSBenchmarks.txt"
@@ -137,13 +140,15 @@ type WithTransferBenchmark<'elem when 'elem : struct>(
137140
buildFunToBenchmark,
138141
converter: string -> 'elem,
139142
boolConverter,
140-
vertex) =
143+
vertex,
144+
buildMatrix) =
141145

142146
inherit Benchmarks<'elem>(
143147
buildFunToBenchmark,
144148
converter,
145149
boolConverter,
146-
vertex)
150+
vertex,
151+
buildMatrix)
147152

148153
[<GlobalSetup>]
149154
override this.GlobalSetup() =
@@ -168,10 +173,11 @@ type WithTransferBenchmark<'elem when 'elem : struct>(
168173
type BFSWithTransferBenchmarkInt32() =
169174

170175
inherit WithTransferBenchmark<int>(
171-
(singleSource ArithmeticOperations.intSumOption ArithmeticOperations.intMulOption),
176+
(Algorithms.BFS.singleSource ArithmeticOperations.intSumOption ArithmeticOperations.intMulOption),
172177
int32,
173178
(fun _ -> Utils.nextInt (System.Random())),
174-
0)
179+
0,
180+
(fun context matrix -> ClMatrix.CSR <| matrix.ToCSR.ToDevice context))
175181

176182
static member InputMatrixProvider =
177183
Benchmarks<_>.InputMatrixProviderBuilder "BFSBenchmarks.txt"

benchmarks/GraphBLAS-sharp.Benchmarks/Helpers.fs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ namespace GraphBLAS.FSharp.Benchmarks
55
open Brahma.FSharp
66
open Brahma.FSharp.OpenCL.Translator
77
open Brahma.FSharp.OpenCL.Translator.QuotationTransformers
8-
open GraphBLAS.FSharp.Backend.Objects
98
open OpenCL.Net
109
open System.IO
1110
open System.Text.RegularExpressions
1211
open GraphBLAS.FSharp.Tests
1312
open FsCheck
1413
open Expecto
15-
open GraphBLAS.FSharp.Test
1614

1715
module Utils =
1816
type BenchmarkContext =

0 commit comments

Comments
 (0)