You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/12/06 18:21:15 UTC

[GitHub] [tvm] mbrookhart opened a new pull request #9660: [Relay][Quantization] Fq2i hard fail option

mbrookhart opened a new pull request #9660:
URL: https://github.com/apache/tvm/pull/9660


   This adds error handling to the Fake Quantization to integer to catch issues during graph rewrite and abort the rewrite.
   
   Alternatively, it adds an option to fail if those rewrites fail or if we find missing ops, which should allow for easier debugging.
   
   cc @anwang2009 @michalpiszczek @AndrewZhaoLuo @masahi 


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] jwfromm merged pull request #9660: [Relay][Quantization] Fq2i hard fail option

Posted by GitBox <gi...@apache.org>.
jwfromm merged pull request #9660:
URL: https://github.com/apache/tvm/pull/9660


   


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] AndrewZhaoLuo commented on a change in pull request #9660: [Relay][Quantization] Fq2i hard fail option

Posted by GitBox <gi...@apache.org>.
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] jwfromm merged pull request #9660: [Relay][Quantization] Fq2i hard fail option

Posted by GitBox <gi...@apache.org>.
jwfromm merged pull request #9660:
URL: https://github.com/apache/tvm/pull/9660


   


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org