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:
[email protected]


Reply via email to