Skip to content

Commit 13e0b52

Browse files
committed
Channels
1 parent 2f5ba61 commit 13e0b52

Some content is hidden

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

87 files changed

+1035
-656
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ open GraphBLAS.FSharp.IO
99
open GraphBLAS.FSharp.Benchmarks
1010
open GraphBLAS.FSharp.Objects
1111
open GraphBLAS.FSharp.Objects.ArraysExtensions
12-
open GraphBLAS.FSharp.Objects.MailboxProcessorExtensions
1312
open GraphBLAS.FSharp.Backend.Quotes
1413

1514
[<AbstractClass>]
@@ -41,7 +40,7 @@ type Benchmarks<'elem when 'elem : struct>(
4140

4241
member this.Processor =
4342
let p = (fst this.OclContextInfo).Queue
44-
p.Error.Add(fun e -> failwithf "%A" e)
43+
//p.Error.Add(fun e -> failwithf "%A" e)
4544
p
4645

4746
static member AvailableContexts = Utils.availableContexts
@@ -114,12 +113,12 @@ type WithoutTransferBenchmark<'elem when 'elem : struct>(
114113
override this.GlobalSetup() =
115114
this.ReadMatrix()
116115
this.LoadMatrixToGPU()
117-
finish this.Processor
116+
this.Processor.Synchronize()
118117

119118
[<IterationCleanup>]
120119
override this.IterationCleanup() =
121120
this.ClearResult()
122-
finish this.Processor
121+
this.Processor.Synchronize()
123122

124123
[<GlobalCleanup>]
125124
override this.GlobalCleanup() =
@@ -128,7 +127,7 @@ type WithoutTransferBenchmark<'elem when 'elem : struct>(
128127
[<Benchmark>]
129128
override this.Benchmark() =
130129
this.BFS()
131-
this.Processor.PostAndReply Msg.MsgNotifyMe
130+
this.Processor.Synchronize()
132131

133132
type BFSWithoutTransferBenchmarkBool() =
134133

@@ -183,7 +182,7 @@ type WithTransferBenchmark<'elem when 'elem : struct>(
183182
[<GlobalSetup>]
184183
override this.GlobalSetup() =
185184
this.ReadMatrix()
186-
finish this.Processor
185+
this.Processor.Synchronize()
187186

188187
[<GlobalCleanup>]
189188
override this.GlobalCleanup() =
@@ -193,7 +192,7 @@ type WithTransferBenchmark<'elem when 'elem : struct>(
193192
override this.IterationCleanup() =
194193
this.ClearInputMatrix()
195194
this.ClearResult()
196-
finish this.Processor
195+
this.Processor.Synchronize()
197196

198197
[<Benchmark>]
199198
override this.Benchmark() =
@@ -202,7 +201,7 @@ type WithTransferBenchmark<'elem when 'elem : struct>(
202201
match this.ResultLevels with
203202
| ClVector.Dense result ->
204203
result.ToHost this.Processor |> ignore
205-
this.Processor.PostAndReply Msg.MsgNotifyMe
204+
this.Processor.Synchronize()
206205
| _ -> failwith "Impossible"
207206

208207
type BFSWithTransferBenchmarkBool() =

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ open GraphBLAS.FSharp.IO
77
open Brahma.FSharp
88
open Microsoft.FSharp.Core
99
open GraphBLAS.FSharp.Objects.ArraysExtensions
10-
open GraphBLAS.FSharp.Objects.MailboxProcessorExtensions
1110
open GraphBLAS.FSharp.Benchmarks
1211
open GraphBLAS.FSharp.Objects
1312

@@ -40,7 +39,7 @@ type Benchmarks(
4039

4140
member this.Processor =
4241
let p = (fst this.OclContextInfo).Queue
43-
p.Error.Add(fun e -> failwithf "%A" e)
42+
//p.Error.Add(fun e -> failwithf "%A" e)
4443
p
4544

4645
static member AvailableContexts = Utils.availableContexts
@@ -113,15 +112,15 @@ type PageRankWithoutTransferBenchmarkFloat32() =
113112
override this.GlobalSetup() =
114113
this.ReadMatrix()
115114
this.LoadMatrixToGPU()
116-
finish this.Processor
115+
this.Processor.Synchronize()
117116
this.PrepareMatrix()
118117
this.ClearInputMatrix()
119-
finish this.Processor
118+
this.Processor.Synchronize()
120119

121120
[<IterationCleanup>]
122121
override this.IterationCleanup() =
123122
this.ClearResult()
124-
finish this.Processor
123+
this.Processor.Synchronize()
125124

126125
[<GlobalCleanup>]
127126
override this.GlobalCleanup() =
@@ -130,4 +129,4 @@ type PageRankWithoutTransferBenchmarkFloat32() =
130129
[<Benchmark>]
131130
override this.Benchmark() =
132131
this.PageRank()
133-
finish this.Processor
132+
this.Processor.Synchronize()
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
wing.mtx
22
coAuthorsCiteseer.mtx
3-
hollywood-2009.mtx
4-
roadNet-CA.mtx
3+
!hollywood-2009.mtx
4+
roadNet-CA.mtx
5+
belgium_osm.mtx
6+
road_central.mtx
7+
coPapersDBLP.mtx

benchmarks/GraphBLAS-sharp.Benchmarks/Helpers.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ open Expecto
1515
module Utils =
1616
type BenchmarkContext =
1717
{ ClContext: Brahma.FSharp.ClContext
18-
Queue: MailboxProcessor<Msg> }
18+
Queue: DeviceCommandQueue<Msg> }
1919

2020
let getMatricesFilenames configFilename =
2121
let getFullPathToConfig filename =

benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/Map2/Map2.fs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ open GraphBLAS.FSharp.IO
88
open GraphBLAS.FSharp.Objects
99
open GraphBLAS.FSharp.Objects.MatrixExtensions
1010
open GraphBLAS.FSharp.Objects.ClContextExtensions
11-
open GraphBLAS.FSharp.Objects.MailboxProcessorExtensions
1211
open GraphBLAS.FSharp.Backend.Quotes
1312
open GraphBLAS.FSharp.Benchmarks
1413

@@ -41,7 +40,7 @@ type Benchmarks<'matrixT, 'elem when 'matrixT :> IDeviceMemObject and 'elem : st
4140

4241
member this.Processor =
4342
let p = (fst this.OclContextInfo).Queue
44-
p.Error.Add(fun e -> failwithf "%A" e)
43+
//p.Error.Add(fun e -> failwithf "%A" e)
4544
p
4645

4746
static member AvailableContexts = Utils.availableContexts
@@ -119,12 +118,12 @@ module WithoutTransfer =
119118
override this.GlobalSetup() =
120119
this.ReadMatrices ()
121120
this.LoadMatricesToGPU ()
122-
finish this.Processor
121+
this.Processor.Synchronize()
123122

124123
[<Benchmark>]
125124
override this.Benchmark () =
126125
this.EWiseAddition()
127-
finish this.Processor
126+
this.Processor.Synchronize()
128127

129128
[<IterationCleanup>]
130129
override this.IterationCleanup () =
@@ -252,7 +251,7 @@ module WithTransfer =
252251
[<GlobalSetup>]
253252
override this.GlobalSetup() =
254253
this.ReadMatrices()
255-
finish this.Processor
254+
this.Processor.Synchronize()
256255

257256
[<GlobalCleanup>]
258257
override this.GlobalCleanup() = ()
@@ -261,16 +260,15 @@ module WithTransfer =
261260
override this.IterationCleanup() =
262261
this.ClearInputMatrices()
263262
this.ClearResult()
264-
finish this.Processor
263+
this.Processor.Synchronize()
265264

266265
[<Benchmark>]
267266
override this.Benchmark() =
268267
this.LoadMatricesToGPU()
269268
this.EWiseAddition()
270-
this.Processor.PostAndReply Msg.MsgNotifyMe
269+
this.Processor.Synchronize()
271270
resultToHost this.ResultMatrix this.Processor |> ignore
272-
this.Processor.PostAndReply Msg.MsgNotifyMe
273-
271+
this.Processor.Synchronize()
274272
module COO =
275273
type Float32() =
276274

benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Expand.fs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ open GraphBLAS.FSharp.IO
88
open GraphBLAS.FSharp.Backend.Quotes
99
open GraphBLAS.FSharp.Objects
1010
open GraphBLAS.FSharp.Objects.ClContextExtensions
11-
open GraphBLAS.FSharp.Objects.MailboxProcessorExtensions
1211
open GraphBLAS.FSharp.Benchmarks
1312

1413
[<AbstractClass>]
@@ -40,7 +39,7 @@ type Benchmarks<'elem when 'elem : struct>(
4039

4140
member this.Processor =
4241
let p = (fst this.OclContextInfo).Queue
43-
p.Error.Add(fun e -> failwithf "%A" e)
42+
//p.Error.Add(fun e -> failwithf "%A" e)
4443
p
4544

4645
static member AvailableContexts = Utils.availableContexts
@@ -116,17 +115,17 @@ module WithoutTransfer =
116115
override this.GlobalSetup() =
117116
this.ReadMatrices()
118117
this.LoadMatricesToGPU()
119-
finish this.Processor
118+
this.Processor.Synchronize()
120119

121120
[<Benchmark>]
122121
override this.Benchmark() =
123122
this.Mxm()
124-
finish this.Processor
123+
this.Processor.Synchronize()
125124

126125
[<IterationCleanup>]
127126
override this.IterationCleanup () =
128127
this.ClearResult()
129-
finish this.Processor
128+
this.Processor.Synchronize()
130129

131130
[<GlobalCleanup>]
132131
override this.GlobalCleanup () =

benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Masked.fs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ open Brahma.FSharp
88
open GraphBLAS.FSharp
99
open GraphBLAS.FSharp.Objects
1010
open GraphBLAS.FSharp.Objects.ClContextExtensions
11-
open GraphBLAS.FSharp.Objects.MailboxProcessorExtensions
1211
open GraphBLAS.FSharp.Benchmarks
1312

1413
[<AbstractClass>]
@@ -46,7 +45,7 @@ type Masked<'elem when 'elem : struct>(
4645

4746
member this.Processor =
4847
let p = (fst this.OclContextInfo).Queue
49-
p.Error.Add(fun e -> failwithf "%A" e)
48+
//p.Error.Add(fun e -> failwithf "%A" e)
5049
p
5150

5251
static member AvaliableContexts = Utils.availableContexts
@@ -153,17 +152,17 @@ type MxmBenchmarksMultiplicationOnly<'elem when 'elem : struct>(
153152
this.ReadMatrices ()
154153
this.LoadMatricesToGPU ()
155154
this.ConvertSecondMatrixToCSC()
156-
finish this.Processor
155+
this.Processor.Synchronize()
157156

158157
[<Benchmark>]
159158
override this.Benchmark () =
160159
this.Mxm()
161-
finish this.Processor
160+
this.Processor.Synchronize()
162161

163162
[<IterationCleanup>]
164163
override this.IterationCleanup () =
165164
this.ClearResult()
166-
finish this.Processor
165+
this.Processor.Synchronize()
167166

168167
[<GlobalCleanup>]
169168
override this.GlobalCleanup () =
@@ -185,20 +184,20 @@ type MxmBenchmarksWithTransposing<'elem when 'elem : struct>(
185184
override this.GlobalSetup() =
186185
this.ReadMatrices()
187186
this.LoadMatricesToGPU ()
188-
finish this.Processor
187+
this.Processor.Synchronize()
189188

190189
[<Benchmark>]
191190
override this.Benchmark() =
192191
this.ConvertSecondMatrixToCSC()
193192
this.Mxm()
194-
finish this.Processor
193+
this.Processor.Synchronize()
195194

196195

197196
[<IterationCleanup>]
198197
override this.IterationCleanup() =
199198
this.ClearResult()
200199
this.ConvertSecondMatrixToCSR()
201-
finish this.Processor
200+
this.Processor.Synchronize()
202201

203202
[<GlobalCleanup>]
204203
override this.GlobalCleanup() =

benchmarks/GraphBLAS-sharp.Benchmarks/Program.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ open BenchmarkDotNet.Running
44
[<EntryPoint>]
55
let main argv =
66
let benchmarks =
7-
BenchmarkSwitcher [| typeof<Algorithms.BFS.BFSWithoutTransferBenchmarkBool> |]
7+
BenchmarkSwitcher [| typeof<Algorithms.BFS.BFSPushPullWithoutTransferBenchmarkBool> |]
88

99
benchmarks.Run argv |> ignore
1010
0

benchmarks/GraphBLAS-sharp.Benchmarks/Vector/Map2.fs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ open GraphBLAS.FSharp.Tests
1010
open GraphBLAS.FSharp.Objects
1111
open GraphBLAS.FSharp.Objects.ClVectorExtensions
1212
open GraphBLAS.FSharp.Objects.ClContextExtensions
13-
open GraphBLAS.FSharp.Objects.MailboxProcessorExtensions
1413

1514
[<AbstractClass>]
1615
[<IterationCount(100)>]
@@ -41,7 +40,7 @@ type Benchmarks<'elem when 'elem : struct>(
4140

4241
member this.Processor =
4342
let p = (fst this.OclContextInfo).Queue
44-
p.Error.Add(fun e -> failwithf $"%A{e}")
43+
//p.Error.Add(fun e -> failwithf $"%A{e}")
4544
p
4645

4746
static member AvailableContexts = Utils.availableContexts
@@ -105,18 +104,18 @@ module WithoutTransfer =
105104
override this.IterationSetup() =
106105
this.CreateVectors()
107106
this.LoadVectorsToGPU()
108-
this.Processor.PostAndReply Msg.MsgNotifyMe
107+
this.Processor.Synchronize()
109108

110109
[<Benchmark>]
111110
override this.Benchmark() =
112111
this.Map2()
113-
this.Processor.PostAndReply Msg.MsgNotifyMe
112+
this.Processor.Synchronize()
114113

115114
[<IterationCleanup>]
116115
override this.IterationCleanup() =
117116
this.ClearResult()
118117
this.ClearInputVectors()
119-
finish this.Processor
118+
this.Processor.Synchronize()
120119

121120
[<GlobalCleanup>]
122121
override this.GlobalCleanup() = ()
@@ -161,7 +160,7 @@ module WithTransfer =
161160
[<IterationSetup>]
162161
override this.IterationSetup() =
163162
this.CreateVectors()
164-
finish this.Processor
163+
this.Processor.Synchronize()
165164

166165
[<Benchmark>]
167166
override this.Benchmark () =
@@ -170,15 +169,15 @@ module WithTransfer =
170169
match this.ResultVector with
171170
| Some v ->
172171
v.ToHost this.Processor |> ignore
173-
this.Processor.PostAndReply Msg.MsgNotifyMe
172+
this.Processor.Synchronize()
174173
| None -> ()
175174

176175

177176
[<IterationCleanup>]
178177
override this.IterationCleanup () =
179178
this.ClearInputVectors()
180179
this.ClearResult()
181-
finish this.Processor
180+
this.Processor.Synchronize()
182181

183182
[<GlobalCleanup>]
184183
override this.GlobalCleanup() = ()

paket.dependencies

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ nuget YoloDev.Expecto.TestSdk 0.13.3
99
nuget Microsoft.NET.Test.Sdk 16.8.0
1010
nuget altcover ~> 7
1111

12-
nuget System.Collections.Immutable 7.0
12+
nuget System.Collections.Immutable 8.0
1313
nuget ExtraConstraints.Fody 1.14.0
1414
nuget Microsoft.Build.Framework 16.10
1515
nuget System.CodeDom >= 7.0
1616
nuget FSharp.Quotations.Evaluator 2.1.0
1717
nuget FSharpx.Collections >= 3.1
1818
nuget FSharpx.Text.StructuredFormat >= 3.1
19-
nuget Brahma.FSharp 2.0.5
19+
nuget Brahma.FSharp 3.0.0-alpha1.3
2020
nuget BenchmarkDotNet
2121
nuget MathNet.Numerics.FSharp 4.0.0
2222
nuget MathNet.Numerics.MKL.Win-x64 2.5.0

0 commit comments

Comments
 (0)