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/05/26 21:39:02 UTC

[GitHub] [tvm] comaniac commented on a change in pull request #8143: [AutoTVM][AutoScheduler] Add workaround to alter op layout bug in task extraction.

comaniac commented on a change in pull request #8143:
URL: https://github.com/apache/tvm/pull/8143#discussion_r640139721



##########
File path: python/tvm/autotvm/task/relay_integration.py
##########
@@ -53,18 +54,22 @@ def _lower(mod, target, params):
     # If failed to compile, then fallback to use VM compiler.
     # TODO: Currently VM compiler is likely to stack overflow for large models.
     try:
-        opt_mod, _ = relay.optimize(mod, target, params)
+        # TODO(jwfromm) Remove this once AlterOpLayout bug that mutates
+        # source module is fixed. Until then, create a clone.
+        mod_clone = deepcopy(mod)

Review comment:
       ditto.

##########
File path: python/tvm/auto_scheduler/relay_integration.py
##########
@@ -64,19 +65,27 @@ def call_all_topi_funcs(mod, params, target):
         disabled_pass={"AutoSchedulerLayoutRewrite"},
     ):
         try:
-            opt_mod, _ = relay.optimize(mod, target, params)
+            # TODO(jwfromm) Remove this once AlterOpLayout bug that mutates
+            # source module is fixed. Until then, create a clone.
+            mod_clone = deepcopy(mod)

Review comment:
       This line can be lifted out of the try-catch block so that L79 can be simplified.




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