AndrewZhaoLuo commented on code in PR #10922:
URL: https://github.com/apache/tvm/pull/10922#discussion_r845307339
##########
src/tir/op/op.cc:
##########
@@ -653,7 +653,27 @@ PrimExpr abs(PrimExpr x, Span span) {
if (px) {
return IntImm(x.dtype(), std::abs(px->value), px->span);
}
- return tir::Select(x >= make_zero(x.dtype()), x, -x, span);
+
Review Comment:
Hmm honestly I'm not sure if I like this change since it actually is a
change in the semantics of abs.
E.g. abs(-128) = 128 which should overflow to -128 with only 8 bits.
IMO two solutions:
1. For integers, make it return uint version so it never overflows.
2. Just handle the edge case manually in fq2i
If I understand this is only important to handle the -128 --> 127 case in
quantized models so I say just put it in 2.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]