Skip to content

Commit

Permalink
Merge Fix complex solver benchmark
Browse files Browse the repository at this point in the history
This PR fixes the residual logging in the complex solver benchmark. In addition, tests for the `complex<double>` benchmarks are enabled for all benchmarks.

Related PR: #1692
  • Loading branch information
MarcelKoch authored Nov 6, 2024
2 parents 7b04094 + 8209132 commit dc8cfeb
Show file tree
Hide file tree
Showing 30 changed files with 473 additions and 11 deletions.
2 changes: 1 addition & 1 deletion benchmark/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function(add_benchmark_test test_name)
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/${test_name}.py $<TARGET_FILE:${test_name}> --generate
COMMENT "Regenerating reference output for ${test_name}"
WORKING_DIRECTORY "$<TARGET_FILE_DIR:ginkgo>")
add_dependencies(${regenerate_target} ${test_name})
add_dependencies(${regenerate_target} ${test_name} ${test_name}_dcomplex)
add_dependencies(benchmark_test_regenerate ${regenerate_target})
endfunction()
add_custom_target(benchmark_test_regenerate)
Expand Down
8 changes: 8 additions & 0 deletions benchmark/test/blas.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@
expected_stdout="blas.profile.stdout",
expected_stderr="blas.profile.stderr",
)

# complex
test_framework.compare_output(
["-input", '[{"n": 100}]'],
expected_stdout="blas_dcomplex.simple.stdout",
expected_stderr="blas_dcomplex.simple.stderr",
use_complex=True
)
8 changes: 8 additions & 0 deletions benchmark/test/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,11 @@
expected_stdout="conversion.profile.stdout",
expected_stderr="conversion.profile.stderr",
)

# complex
test_framework.compare_output(
["-input", '[{"size": 100, "stencil": "7pt"}]', "-formats", "coo,csr"],
expected_stdout="conversion_dcomplex.simple.stdout",
expected_stderr="conversion_dcomplex.simple.stderr",
use_complex=True
)
9 changes: 9 additions & 0 deletions benchmark/test/multi_vector_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,12 @@
expected_stderr="multi_vector_distributed.profile.stderr",
num_procs=3,
)

# complex
test_framework.compare_output_distributed(
["-input", '[{"n": 100}]'],
expected_stdout="multi_vector_distributed_dcomplex.simple.stdout",
expected_stderr="multi_vector_distributed_dcomplex.simple.stderr",
num_procs=3,
use_complex=True
)
8 changes: 8 additions & 0 deletions benchmark/test/preconditioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,11 @@
expected_stderr="preconditioner.reordered.stderr",
stdin='[{"size": 100, "stencil": "7pt"}]',
)

# complex
test_framework.compare_output(
["-input", '[{"size": 100, "stencil": "7pt"}]'],
expected_stdout="preconditioner_dcomplex.simple.stdout",
expected_stderr="preconditioner_dcomplex.simple.stderr",
use_complex=True
)
8 changes: 8 additions & 0 deletions benchmark/test/reference/blas_dcomplex.simple.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Running on ReferenceExecutor
Running with 2 warm iterations and 10 running iterations
The random seed for right hand sides is 42
The operations are copy,axpy,scal
Running test case n = 100
Running blas: copy
Running blas: axpy
Running blas: scal
28 changes: 28 additions & 0 deletions benchmark/test/reference/blas_dcomplex.simple.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"n": 100,
"blas": {
"copy": {
"time": 1.0,
"flops": 1.0,
"bandwidth": 1.0,
"repetitions": 10,
"completed": true
},
"axpy": {
"time": 1.0,
"flops": 1.0,
"bandwidth": 1.0,
"repetitions": 10,
"completed": true
},
"scal": {
"time": 1.0,
"flops": 1.0,
"bandwidth": 1.0,
"repetitions": 10,
"completed": true
}
}
}
]
10 changes: 10 additions & 0 deletions benchmark/test/reference/conversion_dcomplex.simple.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Running on ReferenceExecutor
Running with 2 warm iterations and 10 running iterations
The random seed for right hand sides is 42
The formats are coo,csr
Running test case stencil(100, 7pt)
Matrix is of size (125, 125), 725
Running conversion: coo-read
Running conversion: coo-csr
Running conversion: csr-read
Running conversion: csr-coo
31 changes: 31 additions & 0 deletions benchmark/test/reference/conversion_dcomplex.simple.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[
{
"size": 100,
"stencil": "7pt",
"conversion": {
"coo-read": {
"time": 1.0,
"repetitions": 10,
"completed": true
},
"coo-csr": {
"time": 1.0,
"repetitions": 10,
"completed": true
},
"csr-read": {
"time": 1.0,
"repetitions": 10,
"completed": true
},
"csr-coo": {
"time": 1.0,
"repetitions": 10,
"completed": true
}
},
"rows": 125,
"cols": 125,
"nonzeros": 725
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Running on ReferenceExecutor
Running with 2 warm iterations and 1 running iterations
The random seed for right hand sides is 42
Running cg with 1000 iterations and residual goal of 1.000000e-06
The number of right hand sides is 1
Running test case stencil(100, 7pt, stencil)
Matrix is of size (125, 125)
Running solver: cg
59 changes: 59 additions & 0 deletions benchmark/test/reference/distributed_solver_dcomplex.simple.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[
{
"size": 100,
"stencil": "7pt",
"comm_pattern": "stencil",
"optimal": {
"spmv": "csr-csr"
},
"solver": {
"cg": {
"recurrent_residuals": [],
"true_residuals": [],
"implicit_residuals": [],
"iteration_timestamps": [],
"rhs_norm": 1.0,
"generate": {
"components": {
"generate(<typename>)": 1.0,
"free": 1.0,
"overhead": 1.0
},
"time": 1.0
},
"apply": {
"components": {
"apply(<typename>)": 1.0,
"iteration": 1.0,
"allocate": 1.0,
"dense::fill": 1.0,
"cg::initialize": 1.0,
"advanced_apply(<typename>)": 1.0,
"dense::row_gather": 1.0,
"csr::advanced_spmv": 1.0,
"dense::compute_squared_norm2": 1.0,
"dense::compute_sqrt": 1.0,
"copy(<typename>)": 1.0,
"dense::copy": 1.0,
"dense::compute_conj_dot_dispatch": 1.0,
"check(<typename>)": 1.0,
"residual_norm::residual_norm": 1.0,
"cg::step_1": 1.0,
"csr::spmv": 1.0,
"cg::step_2": 1.0,
"free": 1.0,
"overhead": 1.0
},
"iterations": 7,
"time": 1.0
},
"preconditioner": {},
"residual_norm": 1.0,
"repetitions": 1,
"completed": true
}
},
"rows": 125,
"cols": 125
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Running on ReferenceExecutor
Running with 2 warm iterations and 10 running iterations
The random seed for right hand sides is 42
The operations are copy,axpy,scal
Running test case n = 100
Running blas: copy
Running blas: axpy
Running blas: scal
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"n": 100,
"blas": {
"copy": {
"time": 1.0,
"flops": 1.0,
"bandwidth": 1.0,
"repetitions": 10,
"completed": true
},
"axpy": {
"time": 1.0,
"flops": 1.0,
"bandwidth": 1.0,
"repetitions": 10,
"completed": true
},
"scal": {
"time": 1.0,
"flops": 1.0,
"bandwidth": 1.0,
"repetitions": 10,
"completed": true
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Running on ReferenceExecutor
Running with 2 warm iterations and 10 running iterations
The random seed for right hand sides is 42
Running with preconditioners: none
Running test case stencil(100, 7pt)
Matrix is of size (125, 125), 725
Running preconditioner: none
32 changes: 32 additions & 0 deletions benchmark/test/reference/preconditioner_dcomplex.simple.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"size": 100,
"stencil": "7pt",
"preconditioner": {
"none": {
"generate": {
"components": {
"generate(<typename>)": 1.0,
"overhead": 1.0
},
"time": 1.0,
"repetitions": 10
},
"apply": {
"components": {
"apply(<typename>)": 1.0,
"copy(<typename>)": 1.0,
"dense::copy": 1.0,
"overhead": 1.0
},
"time": 1.0,
"repetitions": 10
},
"completed": true
}
},
"rows": 125,
"cols": 125,
"nonzeros": 725
}
]
8 changes: 8 additions & 0 deletions benchmark/test/reference/solver_dcomplex.simple.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Running on ReferenceExecutor
Running with 2 warm iterations and 1 running iterations
The random seed for right hand sides is 42
Running cg with 1000 iterations and residual goal of 1.000000e-06
The number of right hand sides is 1
Running test case stencil(100, 7pt)
Matrix is of size (125, 125)
Running solver: cg
56 changes: 56 additions & 0 deletions benchmark/test/reference/solver_dcomplex.simple.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[
{
"size": 100,
"stencil": "7pt",
"optimal": {
"spmv": "csr"
},
"solver": {
"cg": {
"recurrent_residuals": [],
"true_residuals": [],
"implicit_residuals": [],
"iteration_timestamps": [],
"rhs_norm": 1.0,
"generate": {
"components": {
"generate(<typename>)": 1.0,
"free": 1.0,
"overhead": 1.0
},
"time": 1.0
},
"apply": {
"components": {
"apply(<typename>)": 1.0,
"iteration": 1.0,
"allocate": 1.0,
"dense::fill": 1.0,
"cg::initialize": 1.0,
"advanced_apply(<typename>)": 1.0,
"csr::advanced_spmv": 1.0,
"dense::compute_norm2_dispatch": 1.0,
"copy(<typename>)": 1.0,
"dense::copy": 1.0,
"dense::compute_conj_dot_dispatch": 1.0,
"check(<typename>)": 1.0,
"residual_norm::residual_norm": 1.0,
"cg::step_1": 1.0,
"csr::spmv": 1.0,
"cg::step_2": 1.0,
"free": 1.0,
"overhead": 1.0
},
"iterations": 7,
"time": 1.0
},
"preconditioner": {},
"residual_norm": 1.0,
"repetitions": 1,
"completed": true
}
},
"rows": 125,
"cols": 125
}
]
7 changes: 7 additions & 0 deletions benchmark/test/reference/sparse_blas_dcomplex.simple.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Running on ReferenceExecutor
Running with 2 warm iterations and 10 running iterations
The random seed for right hand sides is 42
The operations are transpose
Running test case stencil(100, 7pt)
Matrix is of size (125, 125), 725
Running sparse_blas: transpose
25 changes: 25 additions & 0 deletions benchmark/test/reference/sparse_blas_dcomplex.simple.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[
{
"size": 100,
"stencil": "7pt",
"sparse_blas": {
"transpose": {
"time": 1.0,
"flops": 1.0,
"bandwidth": 1.0,
"repetitions": 10,
"components": {
"allocate": 1.0,
"components::fill_array": 1.0,
"csr::transpose": 1.0,
"free": 1.0,
"overhead": 1.0
},
"completed": true
}
},
"rows": 125,
"cols": 125,
"nonzeros": 725
}
]
8 changes: 8 additions & 0 deletions benchmark/test/reference/spmv_dcomplex.simple.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Running on ReferenceExecutor
Running with 2 warm iterations and 10 running iterations
The random seed for right hand sides is 42
The formats are coo
The number of right hand sides is 1
Running test case stencil(100, 7pt)
Matrix is of size (125, 125), 725
Running spmv: coo
Loading

0 comments on commit dc8cfeb

Please sign in to comment.