lhutton1 commented on code in PR #12887:
URL: https://github.com/apache/tvm/pull/12887#discussion_r981316150
##########
python/tvm/relay/op/contrib/ethosn.py:
##########
@@ -299,16 +301,24 @@ def check_leaky_relu(extract):
return _ethosn.leaky_relu(extract)
- def check_mul(extract):
- """Check if Mul is supported."""
+ def check_mul_to_reinterpret_quantize(extract):
+ """Check if Mul is supported by converting to reinterpret quantize"""
if not ethosn_available():
return False
- # Do not support scalar constants for now
- check_scalar = lambda i: isinstance(i, tvm.relay.Constant) and
len(i.data.shape) == 0
- if check_scalar(extract.args[0]) or check_scalar(extract.args[1]):
Review Comment:
It's a good point - I hadn't considered this case before now. Currently (and
prior to this PR) a const+const will result in a segfault during codegen.
Ideally a const+const op (or similar) should have been folded, although we
currently don't require that to be run before the NPU codegen - so we should
probably look at adding some constant folding remove these kind of operations
from the graph
--
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]