Add precision log in apply with profiler_hook#1921
Conversation
d2e64bd to
93a79cb
Compare
core/log/profiler_hook.cpp
Outdated
| ss << "apply(" << stringify_object(A); | ||
| if (log_apply_precision_) { | ||
| ss << "*" << check_vector_type(b) << "=" << check_vector_type(x); | ||
| } | ||
| ss << ")"; |
There was a problem hiding this comment.
nit: maybe just put the in- and output vector as arguments to the apply, i.e.:
| ss << "apply(" << stringify_object(A); | |
| if (log_apply_precision_) { | |
| ss << "*" << check_vector_type(b) << "=" << check_vector_type(x); | |
| } | |
| ss << ")"; | |
| ss << "apply(" << stringify_object(A) << ", " << check_vector_type(b) << ", " << check_vector_type(x) << ")"; |
same at the other instances
There was a problem hiding this comment.
I will still put the scalar type for log because the mismatched type will trigger temporary clone
8323584 to
f345bf3
Compare
MarcelKoch
left a comment
There was a problem hiding this comment.
I think the output still needs some discussion, especially how it interacts with stringify_objects.
There was a problem hiding this comment.
could you point where should be removed? github does not show the lines
There was a problem hiding this comment.
This file only has the license date changed. Nothing else.
core/log/profiler_hook.cpp
Outdated
| namespace { | ||
|
|
||
|
|
||
| std::string check_vector_type(const LinOp* linop) |
There was a problem hiding this comment.
Perhaps this should better be merged with stringify_objects. If a user explicitly sets a name for an object, it should override this behavior here.
There was a problem hiding this comment.
By the way, isn't stringify_objects already enough?
There was a problem hiding this comment.
Good point!
I try it and it works smoothly.
only some nit: it contains the full name like gko::matrix::...
for complex, it gives additional space like gko::matrix::Dense<std::complex<double> >
Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
611fd71 to
0683491
Compare
752d933 to
ae9db1b
Compare
This PR allows profiler hook to log the precision in apply which can help checking the mixed precision setup.
I am thinking whether to have Dense/Vector in that, which might be useful when identify it is local solver or distributed solver in distributed setup
The current format will be like Dense, Vector, or linop
spmv:
obj*input_type=output_typeadvanced:
alpha_type*obj*input_type+beta_type*output_type