MasterJH5574 commented on code in PR #14219:
URL: https://github.com/apache/tvm/pull/14219#discussion_r1127288067


##########
python/tvm/meta_schedule/tune_context.py:
##########
@@ -44,7 +44,8 @@
 def _normalize_mod(mod: Union[PrimFunc, IRModule]) -> IRModule:
     """Normalize the input to an IRModule"""
     if isinstance(mod, PrimFunc):
-        mod = mod.with_attr("global_symbol", "main")
+        if not (mod.attrs and "global_symbol" in mod.attrs):
+            mod = mod.with_attr("global_symbol", "main")
         mod = mod.with_attr("tir.noalias", True)
         mod = IRModule({"main": mod})

Review Comment:
   I’m not very sure here. One of the principle is that when a function in an 
IRModule has global_symbol, the global_symbol value and its global var name are 
supposed to equal. Here we are creating an IRModule with the only function 
“main”, so I think it is reasonable to attach global_symbol “main” to the 
function.



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