AndrewZhaoLuo commented on a change in pull request #9660:
URL: https://github.com/apache/tvm/pull/9660#discussion_r763309427



##########
File path: src/relay/transforms/fake_quantization_to_integer.cc
##########
@@ -154,14 +154,30 @@ class SubgraphMutator : public ExprMutator {
     out_type_ = affine_types_[expr];
     static auto fqfq =
         
Op::GetAttrMap<FTVMFakeQuantizationToInteger>("FTVMFakeQuantizationToInteger");
-    for (auto node : subgraph_) {
-      if (!fqfq.count(Downcast<Op>(node.as<CallNode>()->op))) {
-        // Only modify the subgraph if we have translation
-        // rules for every op
+    if (hard_fail_) {
+      for (auto node : subgraph_) {
+        const Op op = Downcast<Op>(node.as<CallNode>()->op);
+        ICHECK(fqfq.count(op) > 0)
+            << "Found no rewrite rule for " << AsText(op, false) << std::endl;
+      }
+      return Mutate(expr);
+    } else {
+      for (auto node : subgraph_) {
+        const Op op = Downcast<Op>(node.as<CallNode>()->op);
+        if (!fqfq.count(Downcast<Op>(op))) {
+          // Only modify the subgraph if we have translation
+          // rules for every op
+          DLOG(INFO) << "Found no rewrite rule for " << AsText(op, false) << 
std::endl;

Review comment:
       Can you move the if else for `hard_fail_` in here and use `LOG(FATAL)`, 
`ICHECK` just hits LOG_FATAL




-- 
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]


Reply via email to