-
Notifications
You must be signed in to change notification settings - Fork 97
add benchmark_from_scratch flag #1881
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
base: develop
Are you sure you want to change the base?
Conversation
benchmark/solver/solver_common.hpp
Outdated
FLAGS_max_iters) | ||
->generate(state.system_matrix)); | ||
generate_timer->toc(); | ||
// if we benchmark from scrach, we use the new generated solver. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
// if we benchmark from scrach, we use the new generated solver. | |
// if we benchmark from scratch, we use the new generated solver. |
generate_timer->toc(); | ||
// if we benchmark from scrach, we use the new generated solver. | ||
if (FLAGS_benchmark_from_scratch) { | ||
solver = generated_solver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If benchmark from scratch is off, then the we use the generated solver from the warmup (line 477), right ? I think then we dont use FLAGS_max_iters
and use FLAGS_warmup_max_iters
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. we still use max_iters for apply but the solver is used once from warmup.
I just realize this will be broken when no warmup iteration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the issue when no warmup iteration is fixed now
Co-authored-by: Pratik Nayak <pratikvn@protonmail.com>
7ab9521
to
156a081
Compare
@@ -509,19 +515,27 @@ struct SolverBenchmark : Benchmark<solver_benchmark_state<Generator>> { | |||
exec->get_master()->add_logger(gen_logger); | |||
} | |||
|
|||
auto precond = precond_factory.at(precond_name)(exec); | |||
solver = generate_solver(exec, give(precond), solver_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
free
entry in the previous output is deleting the workspace from previous warmup apply not the generation. It introduces the changes for test output
This PR allows user to select whether to benchmark the solver from scratch or not.
The previous behavior is to benchmark the solver from scratch every time, which will benchmark the workspace initialization every time.
The proposed behavior is to benchamark the same solver object such that we only need to initialize the workspace in the first run (or warmup).
User can set it
--benchmark_from_scratch=true
again to benchmark the solver with initialization.