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 2020/07/16 00:26:25 UTC

[GitHub] [incubator-tvm] csullivan opened a new pull request #6069: [TIR] Avoid simplifying substituted tir.Any expressions for layout transformations

csullivan opened a new pull request #6069:
URL: https://github.com/apache/incubator-tvm/pull/6069


   Avoid simplifying substituted tir.Any expressions when applying shape transformation during layout conversion. Add tests to reproduce the error when attempting to run [ssd_mobilenet_v3_small_coco_2020_01_14](http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v3_small_coco_2020_01_14.tar.gz) via the TF frontend.
   
   


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

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



[GitHub] [incubator-tvm] csullivan commented on a change in pull request #6069: [TIR][BugFix] Avoid simplifying substituted tir.Any expressions for layout transformations

Posted by GitBox <gi...@apache.org>.
csullivan commented on a change in pull request #6069:
URL: https://github.com/apache/incubator-tvm/pull/6069#discussion_r456595165



##########
File path: src/tir/ir/data_layout.cc
##########
@@ -323,7 +323,12 @@ inline Array<PrimExpr> TransformShape(const Array<PrimExpr>& src_shape,
       if (symbolic_var_set.count(i)) {
         result.push_back(tir::Any());
       } else {
-        result.push_back(ana.Simplify(tir::Substitute(rule, bind_map)));
+        auto sub = tir::Substitute(rule, bind_map);
+        if (sub.as<tir::AnyNode>()) {
+          result.push_back(tir::Any());
+        } else {
+          result.push_back(ana.Simplify(sub));
+        }

Review comment:
       Good point, let me get my head around the semantics and first order simplifications. 




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

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



[GitHub] [incubator-tvm] csullivan commented on a change in pull request #6069: [TIR][BugFix] Avoid simplifying substituted tir.Any expressions for layout transformations

Posted by GitBox <gi...@apache.org>.
csullivan commented on a change in pull request #6069:
URL: https://github.com/apache/incubator-tvm/pull/6069#discussion_r466153094



##########
File path: src/tir/ir/data_layout.cc
##########
@@ -323,7 +323,12 @@ inline Array<PrimExpr> TransformShape(const Array<PrimExpr>& src_shape,
       if (symbolic_var_set.count(i)) {
         result.push_back(tir::Any());
       } else {
-        result.push_back(ana.Simplify(tir::Substitute(rule, bind_map)));
+        auto sub = tir::Substitute(rule, bind_map);
+        if (sub.as<tir::AnyNode>()) {
+          result.push_back(tir::Any());
+        } else {
+          result.push_back(ana.Simplify(sub));
+        }

Review comment:
       I ended up avoiding the layout transformation on the dynamic dimension by specifying it from the input which unblocked me, making this a bit lower priority. I could still try to push this through if you prefer but thinking I will close for now and reopen at a later time.




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

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



[GitHub] [incubator-tvm] csullivan closed pull request #6069: [TIR][BugFix] Avoid simplifying substituted tir.Any expressions for layout transformations

Posted by GitBox <gi...@apache.org>.
csullivan closed pull request #6069:
URL: https://github.com/apache/incubator-tvm/pull/6069


   


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

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



[GitHub] [incubator-tvm] csullivan commented on a change in pull request #6069: [TIR][BugFix] Avoid simplifying substituted tir.Any expressions for layout transformations

Posted by GitBox <gi...@apache.org>.
csullivan commented on a change in pull request #6069:
URL: https://github.com/apache/incubator-tvm/pull/6069#discussion_r466153094



##########
File path: src/tir/ir/data_layout.cc
##########
@@ -323,7 +323,12 @@ inline Array<PrimExpr> TransformShape(const Array<PrimExpr>& src_shape,
       if (symbolic_var_set.count(i)) {
         result.push_back(tir::Any());
       } else {
-        result.push_back(ana.Simplify(tir::Substitute(rule, bind_map)));
+        auto sub = tir::Substitute(rule, bind_map);
+        if (sub.as<tir::AnyNode>()) {
+          result.push_back(tir::Any());
+        } else {
+          result.push_back(ana.Simplify(sub));
+        }

Review comment:
       I ended up avoiding the layout transformation on the dynamic dimension by specifying the shape for the input which unblocked me, making this a bit lower priority. I could still try to push this through if you prefer but thinking I will close for now and reopen at a later time.




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

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



[GitHub] [incubator-tvm] tqchen commented on a change in pull request #6069: [TIR][BugFix] Avoid simplifying substituted tir.Any expressions for layout transformations

Posted by GitBox <gi...@apache.org>.
tqchen commented on a change in pull request #6069:
URL: https://github.com/apache/incubator-tvm/pull/6069#discussion_r466126262



##########
File path: src/tir/ir/data_layout.cc
##########
@@ -323,7 +323,12 @@ inline Array<PrimExpr> TransformShape(const Array<PrimExpr>& src_shape,
       if (symbolic_var_set.count(i)) {
         result.push_back(tir::Any());
       } else {
-        result.push_back(ana.Simplify(tir::Substitute(rule, bind_map)));
+        auto sub = tir::Substitute(rule, bind_map);
+        if (sub.as<tir::AnyNode>()) {
+          result.push_back(tir::Any());
+        } else {
+          result.push_back(ana.Simplify(sub));
+        }

Review comment:
       Please followup :)




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

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



[GitHub] [incubator-tvm] tqchen commented on a change in pull request #6069: [TIR][BugFix] Avoid simplifying substituted tir.Any expressions for layout transformations

Posted by GitBox <gi...@apache.org>.
tqchen commented on a change in pull request #6069:
URL: https://github.com/apache/incubator-tvm/pull/6069#discussion_r456491809



##########
File path: src/tir/ir/data_layout.cc
##########
@@ -323,7 +323,12 @@ inline Array<PrimExpr> TransformShape(const Array<PrimExpr>& src_shape,
       if (symbolic_var_set.count(i)) {
         result.push_back(tir::Any());
       } else {
-        result.push_back(ana.Simplify(tir::Substitute(rule, bind_map)));
+        auto sub = tir::Substitute(rule, bind_map);
+        if (sub.as<tir::AnyNode>()) {
+          result.push_back(tir::Any());
+        } else {
+          result.push_back(ana.Simplify(sub));
+        }

Review comment:
       Perhaps in this case we should go and fix Simplify for Any in the arith module and also add a testcase there




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

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