Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/google/ruy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorT.J. Alumbaugh <talumbau@google.com>2020-10-27 20:55:48 +0300
committerCopybara-Service <copybara-worker@google.com>2020-10-27 20:56:08 +0300
commit7e1d379cd05679d86c0113ce271a6df8c51fed3a (patch)
tree569b725cc1ebbce52808daa7655aac9ede2d441c
parentdd1102a6ce6ce501f92f6abd72c89ac59a95afeb (diff)
Zero point checking disabled for uint8 x uint8 GEMMs
PiperOrigin-RevId: 339284224
-rw-r--r--ruy/validate.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/ruy/validate.h b/ruy/validate.h
index d9e49fd..b164530 100644
--- a/ruy/validate.h
+++ b/ruy/validate.h
@@ -52,8 +52,14 @@ void ValidateZeroPoints(LhsScalar lhs_zero_point, RhsScalar rhs_zero_point,
// See b/131609283. This only affects the kNeon path but we ban this for all
// paths in order for ruy to have the same supported parameter space
// on all paths.
- RUY_DCHECK(lhs_zero_point != std::numeric_limits<LhsScalar>::lowest() ||
- rhs_zero_point != std::numeric_limits<RhsScalar>::lowest());
+ // We disable this check for now for the case of LhsScalar==RhsScalar==uint8
+ // for backwards compatability with gemmlowp. The issue is still relevant
+ // because we convert from uint8 to int8 for the backend kernels.
+ if (!std::is_same<LhsScalar, uint8_t>::value ||
+ !std::is_same<RhsScalar, uint8_t>::value) {
+ RUY_DCHECK(lhs_zero_point != std::numeric_limits<LhsScalar>::lowest() ||
+ rhs_zero_point != std::numeric_limits<RhsScalar>::lowest());
+ }
}
} // namespace detail