-
Notifications
You must be signed in to change notification settings - Fork 93
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
solver (mostly krylov solver) and the residual norm with half #1711
Conversation
@@ -555,7 +555,8 @@ void initialize(std::shared_ptr<const DefaultExecutor> exec, | |||
orthonormalize_subspace_vectors(exec, subspace_vectors); | |||
} | |||
|
|||
GKO_INSTANTIATE_FOR_EACH_VALUE_TYPE(GKO_DECLARE_IDR_INITIALIZE_KERNEL); | |||
GKO_INSTANTIATE_FOR_EACH_VALUE_TYPE_WITH_HALF( |
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.
A general question: Why do we need another macro _WITH_HALF
? Is it not possible to just have half
within the first macro ?
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.
It is possible but it will result it in #1257 because we need to finish everything all at once.
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.
#1257 is to make everything work with half first and then disable some we can not support now.
The recent prs try to make the half support block by block. hopefully, they are easier for review.
To do it block by block, I need to create many list with half additionally unfortunately to reduce the touching other stuff.
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.
LGTM. Can you clarify the testing issues with IDR?
f53438a
to
5b22346
Compare
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.
I think it makes sense to remove half
support for solvers which do not converge with half ? (IDR, GCR ?) Otherwise, looks good to me.
@@ -200,7 +200,9 @@ get_value(const pnode& config) | |||
* This is specialization for floating point type | |||
*/ | |||
template <typename ValueType> | |||
inline std::enable_if_t<std::is_floating_point<ValueType>::value, ValueType> | |||
inline std::enable_if_t<std::is_floating_point<ValueType>::value || |
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.
I think this structure will be useful everywhere. Maybe it would be nice to have our own is_floating_point
which includes half
? So all you will need to do is gko::is_floating_point<ValueType>::value
?
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.
I only use it here because others usually need to be writen separately
core/solver/idr.cpp
Outdated
// if norm(t) is zero | ||
// omega = 0 | ||
// end if |
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.
I think this should be moved above and merged with the other definition of omega
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.
have moved
@@ -330,7 +332,7 @@ TYPED_TEST(Gcr, SolvesStencilSystemUsingAdvancedApplyMixed) | |||
solver->apply(alpha.get(), b.get(), beta.get(), x.get()); | |||
|
|||
GKO_ASSERT_MTX_NEAR(x, l({1.5, 5.0, 2.0}), | |||
(r_mixed<value_type, TypeParam>()) * 1e1); | |||
(r_mixed<value_type, TypeParam>()) * 1e2); |
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.
It is enough to scale the old tolerance with alpha
. We should actually do this for all solver advanced apply tests.
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.
I also check the other tol changes in this file. they are not needed at least in cuda10.2 image. need to check the other ci job
b4470ad
to
ebb6468
Compare
a09d80a
to
8f64d67
Compare
ff85d00
to
2aa59e2
Compare
3a98c11
to
ac216bc
Compare
Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
Error: PR already merged! |
This PR enable the solvers and the residual norm with half. It also includes the corresponding config