You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "MasterJH5574 (via GitHub)" <gi...@apache.org> on 2023/04/16 16:08:44 UTC
[GitHub] [tvm] MasterJH5574 commented on a diff in pull request #14634: [Unity] `enable_warning` option for LegalizeOps and MSApplyDatabase
MasterJH5574 commented on code in PR #14634:
URL: https://github.com/apache/tvm/pull/14634#discussion_r1167969849
##########
python/tvm/relax/pipeline.py:
##########
@@ -26,49 +26,67 @@
from . import transform
-@tvm.transform.module_pass(opt_level=0)
-def zero_pipeline(mod: tvm.ir.IRModule, ctx: tvm.transform.PassContext) -> tvm.ir.IRModule:
- """Pipeline that applies pre-tuned logs.
+def zero_pipeline(*, enable_warning: bool = False):
+ """Wrapper function that returns the zero pipeline.
Parameters
----------
- mod : tvm.ir.IRModule
- Input IRModule.
+ enable_warning : bool
+ A boolean value indicating if to print warnings
+ * in LegalizeOps pass, for CallNode whose op's legalization function is
+ not registered,
+ * in MetaScheduleApplyDatabase pass, for TIR functions now showing up in
+ the database. By default we don't print warning.
+ """
- ctx : tvm.transform.PassContext
- The pass context
+ @tvm.transform.module_pass(opt_level=0)
+ def f_zero_pipeline(mod: tvm.ir.IRModule, ctx: tvm.transform.PassContext) -> tvm.ir.IRModule:
+ """Pipeline that applies pre-tuned logs.
- Returns
- -------
- mod: tvm.ir.IRModule
- The result transformed module.
- """
- seq = tvm.transform.Sequential(
- [
- transform.LegalizeOps(),
- transform.AnnotateTIROpPattern(),
- transform.FoldConstant(),
- transform.FuseOps(),
- transform.FuseTIR(),
- ]
- )
- mod = seq(mod)
- if ms.Database.current():
- mod = transform.MetaScheduleApplyDatabase()(mod)
- return mod
+ Parameters
+ ----------
+ mod : tvm.ir.IRModule
+ Input IRModule.
+
+ ctx : tvm.transform.PassContext
+ The pass context
+
+ Returns
+ -------
+ mod: tvm.ir.IRModule
+ The result transformed module.
+ """
+ print(enable_warning)
Review Comment:
Good catch. Removed.
--
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