Skip to content

Commit 7ed27d5

Browse files
authored
Matrix: SIMD used in matrix-matrix operations (#148)
1 parent f8bf0aa commit 7ed27d5

File tree

41 files changed

+1595
-1539
lines changed

Some content is hidden

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

41 files changed

+1595
-1539
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 13.11.12
4+
- Matrix:
5+
- SIMD used in matrix-matrix operations => performance improved for a lot of operations
6+
- Architectural changes: MatrixDataManager removed, MatrixFactory removed
7+
38
## 13.11.11
49
- Matrix:
510
- SIMD used in matrix-scalar operations => performance improved for a lot of operations

benchmark/matrix/float32/matrix_operations/float32_add_matrix_matrix.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Approx. 1.4 seconds (MacBook Pro 2019), Dart version: 2.16.0
1+
// Approx. 1.1 seconds (MacBook Pro 2019), Dart version: 2.16.0
22

33
import 'package:benchmark_harness/benchmark_harness.dart';
44
import 'package:ml_linalg/dtype.dart';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Approx. 1.1 seconds (MacBook Pro 2019), Dart version: 2.16.0
2+
3+
import 'package:benchmark_harness/benchmark_harness.dart';
4+
import 'package:ml_linalg/dtype.dart';
5+
import 'package:ml_linalg/matrix.dart';
6+
7+
const numOfRows = 20001;
8+
const numOfColumns = 2001;
9+
10+
class Float32MatrixDivMatrixMatrixBenchmark extends BenchmarkBase {
11+
Float32MatrixDivMatrixMatrixBenchmark()
12+
: super('Matrix float32, matrix by matrix division');
13+
14+
final matrix =
15+
Matrix.random(numOfRows, numOfColumns, dtype: DType.float32, seed: 5);
16+
17+
final other =
18+
Matrix.random(numOfRows, numOfColumns, dtype: DType.float32, seed: 6);
19+
20+
static void main() {
21+
Float32MatrixDivMatrixMatrixBenchmark().report();
22+
}
23+
24+
@override
25+
void run() {
26+
matrix / other;
27+
}
28+
}
29+
30+
void main() {
31+
Float32MatrixDivMatrixMatrixBenchmark.main();
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Approx. 1.1 seconds (MacBook Pro 2019), Dart version: 2.16.0
2+
3+
import 'package:benchmark_harness/benchmark_harness.dart';
4+
import 'package:ml_linalg/dtype.dart';
5+
import 'package:ml_linalg/matrix.dart';
6+
7+
const numOfRows = 20001;
8+
const numOfColumns = 2001;
9+
10+
class Float32MatrixAddMatrixMatrixBenchmark extends BenchmarkBase {
11+
Float32MatrixAddMatrixMatrixBenchmark()
12+
: super('Matrix float32, matrix and matrix summation');
13+
14+
final matrix =
15+
Matrix.random(numOfRows, numOfColumns, dtype: DType.float32, seed: 5);
16+
17+
final other =
18+
Matrix.random(numOfRows, numOfColumns, dtype: DType.float32, seed: 6);
19+
20+
static void main() {
21+
Float32MatrixAddMatrixMatrixBenchmark().report();
22+
}
23+
24+
@override
25+
void run() {
26+
matrix - other;
27+
}
28+
}
29+
30+
void main() {
31+
Float32MatrixAddMatrixMatrixBenchmark.main();
32+
}

benchmark/matrix/float32/matrix_operations/float32_subtraction_matrix_scalar.dart

-31
This file was deleted.

0 commit comments

Comments
 (0)