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/09/23 14:10:23 UTC

[GitHub] [tvm-rfcs] Hzfengsy opened a new pull request #36: [RFC][TVMScript] New namespace for tvmscript

Hzfengsy opened a new pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36


   It's a rfc for changing TVMScript namespace to enable auto-completion support and pass pylint checks
   @tqchen @junrushao1994 @tkonolige 
   


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



[GitHub] [tvm-rfcs] altanh commented on pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
altanh commented on pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#issuecomment-928106537


   I support this change. One suggestion is that we keep a canonical namespace that will always be parsed correctly to the TIR namespace (e.g. `tir.block` will always work), and in particular use this identifier during printing. Mentioning this here since I noticed the PR apache/tvm#9115 is printing using the `T` alias, which seems problematic unless we print an import statement at the top.


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



[GitHub] [tvm-rfcs] MasterJH5574 commented on a change in pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
MasterJH5574 commented on a change in pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#discussion_r716139088



##########
File path: rfcs/0036-tvm-script-namespace.md
##########
@@ -0,0 +1,89 @@
+- Feature Name: TVM Script Namespace
+- Start Date: 2021-09-23
+- RFC PR: [apache/tvm-rfcs#0036](https://github.com/apache/tvm-rfcs/pull/36)
+- GitHub Issue: [apache/tvm#0000](https://github.com/apache/tvm/issues/0000)
+
+# Summary
+
+[summary]: #summary
+
+This is a RFC for the new namespace and user interface for TVM script.
+
+- Use tvm.script as the `root` namespace for all TVM script related stuff
+- Use `tvm.script.tir` for `TIR`, and idiomatically import it as `T`, like Keras is usually imported as K
+- To be consistent with the names of their resulting types, use
+  - `tvm.script.ir_module` for `IRModule`
+  - `T.prim_func` for `tir.PrimFunc`
+
+# Motivation
+
+[motivation]: #motivation
+
+TVMScript is a fancy tools to write TIR in Python syntax. However, it's not fully compatible with native Python tools (e.g., pylint) because it is not a runnable program in Python.
+
+We have following pain points:
+
+- No Python auto-completion support
+- Usually conflicts with pylint
+- APIs scatter in namespaces like tvm.script, tvm.tir, tvm.script.ty
+- Somewhat non-trivial to understand at first glance what the decorator generates
+
+With the new proposal, we are able to provide type stubs that provides users with TVM scripts that work well with linting and auto-completion.
+
+# Guide-level explanation
+
+[guide-level-explanation]: #guide-level-explanation
+
+Let's see an example for the same TIR program but in different syntax.
+
+## Existing Syntax
+
+```Python
+from tvm import tir
+# ^ here tir is not related to the script but we need to import it. Otherwise there are many lint errors.
+from tvm.script import ty
+# ^ ty is a sub-module for only type system, which makes no sense to import it global
+
+@tvm.script.tir
+class Module:
+  def func(a: ty.handle, b: ty.handle) -> None:
+    A = tir.match_buffer(a, [128, 128], dtype="float32")  # pylint error: tir does not have attr match_buffer
+    B = tir.match_buffer(b, [128], dtype="float32")
+    with tir.block([128, tir.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+## New Syntax
+
+```Python
+from tvm.script import tir as T
+# ^ there is a broadly accepted precedence in doing this in the python community:
+#   from keras import backend as K
+
+@tvm.script.ir_module                                   # it generates an IRModule
+class Module:
+  @T.prim_func                                          # it generates a PrimFunc explicitly
+  def func(a: T.handle, b: T.handle):                   # return type is not necessary for PrimFunc
+    A = T.match_buffer(a, [128, 128], dtype="float32")  # no pylint errors for match_buffer
+    B = T.match_buffer(b, [128], dtype="float32")
+    with T.block([128, T.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]

Review comment:
       Update: I had a quick check, and found that `+=` is well-supported πŸ‘. So you can just resolve the comments :-)




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



[GitHub] [tvm-rfcs] Hzfengsy commented on a change in pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
Hzfengsy commented on a change in pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#discussion_r715325034



##########
File path: rfcs/0036-tvm-script-namespace.md
##########
@@ -0,0 +1,89 @@
+- Feature Name: TVM Script Namespace
+- Start Date: 2021-09-23
+- RFC PR: [apache/tvm-rfcs#0036](https://github.com/apache/tvm-rfcs/pull/36)
+- GitHub Issue: [apache/tvm#0000](https://github.com/apache/tvm/issues/0000)
+
+# Summary
+
+[summary]: #summary
+
+This is a RFC for the new namespace and user interface for TVM script.
+
+- Use tvm.script as the `root` namespace for all TVM script related stuff
+- Use `tvm.script.tir` for `TIR`, and idiomatically import it as `T`, like Keras is usually imported as K
+- To be consistent with the names of their resulting types, use
+  - `tvm.script.ir_module` for `IRModule`
+  - `T.prim_func` for `tir.PrimFunc`
+
+# Motivation
+
+[motivation]: #motivation
+
+TVMScript is a fancy tools to write TIR in Python syntax. However, it's not fully compatible with native Python tools (e.g., pylint) because it is not a runnable program in Python.
+
+We have following pain points:
+
+- No Python auto-completion support
+- Usually conflicts with pylint
+- APIs scatter in namespaces like tvm.script, tvm.tir, tvm.script.ty
+- Somewhat non-trivial to understand at first glance what the decorator generates
+
+With the new proposal, we are able to provide type stubs that provides users with TVM scripts that work well with linting and auto-completion.
+
+# Guide-level explanation
+
+[guide-level-explanation]: #guide-level-explanation
+
+Let's see an example for the same TIR program but in different syntax.
+
+## Existing Syntax
+
+```Python
+from tvm import tir
+# ^ here tir is not related to the script but we need to import it. Otherwise there are many lint errors.
+from tvm.script import ty
+# ^ ty is a sub-module for only type system, which makes no sense to import it global
+
+@tvm.script.tir
+class Module:
+  def func(a: ty.handle, b: ty.handle) -> None:
+    A = tir.match_buffer(a, [128, 128], dtype="float32")  # pylint error: tir does not have attr match_buffer
+    B = tir.match_buffer(b, [128], dtype="float32")
+    with tir.block([128, tir.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+## New Syntax
+
+```Python
+from tvm.script import tir as T
+# ^ there is a broadly accepted precedence in doing this in the python community:
+#   from keras import backend as K
+
+@tvm.script.ir_module                                   # it generates an IRModule
+class Module:
+  @T.prim_func                                          # it generates a PrimFunc explicitly
+  def func(a: T.handle, b: T.handle):                   # return type is not necessary for PrimFunc
+    A = T.match_buffer(a, [128, 128], dtype="float32")  # no pylint errors for match_buffer
+    B = T.match_buffer(b, [128], dtype="float32")
+    with T.block([128, T.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+# Reference-level explanation
+
+[reference-level-explanation]: #reference-level-explanation
+
+Pylint and Python auto-completion will look the symbols (function definitions) in the module (e.g. `tvm.script.tir`). Just write (or generate) a concrete function in the module, then can enable auto-completion and pass Pylint checks.
+
+# Drawbacks
+
+[drawbacks]: #drawbacks
+
+Here are some existing works based on current TVM Script syntax. It need a huge refactor to migrate it to the new one.

Review comment:
       I don't think so. Actually I have refactored all testcase on my local machine. Will pr very soon. The only problem is how to review such huge refactoring.




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



[GitHub] [tvm-rfcs] tkonolige commented on a change in pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
tkonolige commented on a change in pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#discussion_r715865170



##########
File path: rfcs/0036-tvm-script-namespace.md
##########
@@ -0,0 +1,89 @@
+- Feature Name: TVM Script Namespace
+- Start Date: 2021-09-23
+- RFC PR: [apache/tvm-rfcs#0036](https://github.com/apache/tvm-rfcs/pull/36)
+- GitHub Issue: [apache/tvm#0000](https://github.com/apache/tvm/issues/0000)
+
+# Summary
+
+[summary]: #summary
+
+This is a RFC for the new namespace and user interface for TVM script.
+
+- Use tvm.script as the `root` namespace for all TVM script related stuff
+- Use `tvm.script.tir` for `TIR`, and idiomatically import it as `T`, like Keras is usually imported as K
+- To be consistent with the names of their resulting types, use
+  - `tvm.script.ir_module` for `IRModule`
+  - `T.prim_func` for `tir.PrimFunc`
+
+# Motivation
+
+[motivation]: #motivation
+
+TVMScript is a fancy tools to write TIR in Python syntax. However, it's not fully compatible with native Python tools (e.g., pylint) because it is not a runnable program in Python.
+
+We have following pain points:
+
+- No Python auto-completion support
+- Usually conflicts with pylint
+- APIs scatter in namespaces like tvm.script, tvm.tir, tvm.script.ty
+- Somewhat non-trivial to understand at first glance what the decorator generates
+
+With the new proposal, we are able to provide type stubs that provides users with TVM scripts that work well with linting and auto-completion.
+
+# Guide-level explanation
+
+[guide-level-explanation]: #guide-level-explanation
+
+Let's see an example for the same TIR program but in different syntax.
+
+## Existing Syntax
+
+```Python
+from tvm import tir
+# ^ here tir is not related to the script but we need to import it. Otherwise there are many lint errors.
+from tvm.script import ty
+# ^ ty is a sub-module for only type system, which makes no sense to import it global
+
+@tvm.script.tir
+class Module:
+  def func(a: ty.handle, b: ty.handle) -> None:
+    A = tir.match_buffer(a, [128, 128], dtype="float32")  # pylint error: tir does not have attr match_buffer
+    B = tir.match_buffer(b, [128], dtype="float32")
+    with tir.block([128, tir.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+## New Syntax
+
+```Python
+from tvm.script import tir as T
+# ^ there is a broadly accepted precedence in doing this in the python community:
+#   from keras import backend as K
+
+@tvm.script.ir_module                                   # it generates an IRModule
+class Module:
+  @T.prim_func                                          # it generates a PrimFunc explicitly

Review comment:
       Yeah, I agree we need it in the future. I don't really care if we add it now or later, we should just make the decision explicit if we do add it.




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



[GitHub] [tvm-rfcs] Hzfengsy commented on a change in pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
Hzfengsy commented on a change in pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#discussion_r715330062



##########
File path: rfcs/0036-tvm-script-namespace.md
##########
@@ -0,0 +1,89 @@
+- Feature Name: TVM Script Namespace
+- Start Date: 2021-09-23
+- RFC PR: [apache/tvm-rfcs#0036](https://github.com/apache/tvm-rfcs/pull/36)
+- GitHub Issue: [apache/tvm#0000](https://github.com/apache/tvm/issues/0000)
+
+# Summary
+
+[summary]: #summary
+
+This is a RFC for the new namespace and user interface for TVM script.
+
+- Use tvm.script as the `root` namespace for all TVM script related stuff
+- Use `tvm.script.tir` for `TIR`, and idiomatically import it as `T`, like Keras is usually imported as K
+- To be consistent with the names of their resulting types, use
+  - `tvm.script.ir_module` for `IRModule`
+  - `T.prim_func` for `tir.PrimFunc`
+
+# Motivation
+
+[motivation]: #motivation
+
+TVMScript is a fancy tools to write TIR in Python syntax. However, it's not fully compatible with native Python tools (e.g., pylint) because it is not a runnable program in Python.
+
+We have following pain points:
+
+- No Python auto-completion support
+- Usually conflicts with pylint
+- APIs scatter in namespaces like tvm.script, tvm.tir, tvm.script.ty
+- Somewhat non-trivial to understand at first glance what the decorator generates
+
+With the new proposal, we are able to provide type stubs that provides users with TVM scripts that work well with linting and auto-completion.
+
+# Guide-level explanation
+
+[guide-level-explanation]: #guide-level-explanation
+
+Let's see an example for the same TIR program but in different syntax.
+
+## Existing Syntax
+
+```Python
+from tvm import tir
+# ^ here tir is not related to the script but we need to import it. Otherwise there are many lint errors.
+from tvm.script import ty
+# ^ ty is a sub-module for only type system, which makes no sense to import it global
+
+@tvm.script.tir
+class Module:
+  def func(a: ty.handle, b: ty.handle) -> None:
+    A = tir.match_buffer(a, [128, 128], dtype="float32")  # pylint error: tir does not have attr match_buffer
+    B = tir.match_buffer(b, [128], dtype="float32")
+    with tir.block([128, tir.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+## New Syntax
+
+```Python
+from tvm.script import tir as T
+# ^ there is a broadly accepted precedence in doing this in the python community:
+#   from keras import backend as K
+
+@tvm.script.ir_module                                   # it generates an IRModule
+class Module:
+  @T.prim_func                                          # it generates a PrimFunc explicitly

Review comment:
       Good question. I think it is needed in the long term (since IRModule contains not only `PrimFunc` but also functions for relay). However, only PrimFuncs are supported by TVMScript by now. It's OK not to decorate functions in this PFC.
   
   Love to hear your opinions.




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



[GitHub] [tvm-rfcs] junrushao1994 commented on pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#issuecomment-930344604


   Thanks guys for the discussion! The RFC is merged :-)


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



[GitHub] [tvm-rfcs] junrushao1994 commented on pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#issuecomment-929545882


   Thanks guys for the discussion! If the comments and concerns are all addressed, let's move on and merge this PR after 24h


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



[GitHub] [tvm-rfcs] tkonolige commented on a change in pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
tkonolige commented on a change in pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#discussion_r715049036



##########
File path: rfcs/0036-tvm-script-namespace.md
##########
@@ -0,0 +1,89 @@
+- Feature Name: TVM Script Namespace
+- Start Date: 2021-09-23
+- RFC PR: [apache/tvm-rfcs#0036](https://github.com/apache/tvm-rfcs/pull/36)
+- GitHub Issue: [apache/tvm#0000](https://github.com/apache/tvm/issues/0000)
+
+# Summary
+
+[summary]: #summary
+
+This is a RFC for the new namespace and user interface for TVM script.
+
+- Use tvm.script as the `root` namespace for all TVM script related stuff
+- Use `tvm.script.tir` for `TIR`, and idiomatically import it as `T`, like Keras is usually imported as K
+- To be consistent with the names of their resulting types, use
+  - `tvm.script.ir_module` for `IRModule`
+  - `T.prim_func` for `tir.PrimFunc`
+
+# Motivation
+
+[motivation]: #motivation
+
+TVMScript is a fancy tools to write TIR in Python syntax. However, it's not fully compatible with native Python tools (e.g., pylint) because it is not a runnable program in Python.
+
+We have following pain points:
+
+- No Python auto-completion support
+- Usually conflicts with pylint
+- APIs scatter in namespaces like tvm.script, tvm.tir, tvm.script.ty
+- Somewhat non-trivial to understand at first glance what the decorator generates
+
+With the new proposal, we are able to provide type stubs that provides users with TVM scripts that work well with linting and auto-completion.
+
+# Guide-level explanation
+
+[guide-level-explanation]: #guide-level-explanation
+
+Let's see an example for the same TIR program but in different syntax.
+
+## Existing Syntax
+
+```Python
+from tvm import tir
+# ^ here tir is not related to the script but we need to import it. Otherwise there are many lint errors.
+from tvm.script import ty
+# ^ ty is a sub-module for only type system, which makes no sense to import it global
+
+@tvm.script.tir
+class Module:
+  def func(a: ty.handle, b: ty.handle) -> None:
+    A = tir.match_buffer(a, [128, 128], dtype="float32")  # pylint error: tir does not have attr match_buffer
+    B = tir.match_buffer(b, [128], dtype="float32")
+    with tir.block([128, tir.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+## New Syntax
+
+```Python
+from tvm.script import tir as T
+# ^ there is a broadly accepted precedence in doing this in the python community:
+#   from keras import backend as K
+
+@tvm.script.ir_module                                   # it generates an IRModule
+class Module:
+  @T.prim_func                                          # it generates a PrimFunc explicitly

Review comment:
       Current we do not require decorators for functions within a class decorated with `tvm.script.tir`. Are you suggesting we change this so all functions need a decorator?

##########
File path: rfcs/0036-tvm-script-namespace.md
##########
@@ -0,0 +1,89 @@
+- Feature Name: TVM Script Namespace
+- Start Date: 2021-09-23
+- RFC PR: [apache/tvm-rfcs#0036](https://github.com/apache/tvm-rfcs/pull/36)
+- GitHub Issue: [apache/tvm#0000](https://github.com/apache/tvm/issues/0000)
+
+# Summary
+
+[summary]: #summary
+
+This is a RFC for the new namespace and user interface for TVM script.
+
+- Use tvm.script as the `root` namespace for all TVM script related stuff
+- Use `tvm.script.tir` for `TIR`, and idiomatically import it as `T`, like Keras is usually imported as K
+- To be consistent with the names of their resulting types, use
+  - `tvm.script.ir_module` for `IRModule`
+  - `T.prim_func` for `tir.PrimFunc`
+
+# Motivation
+
+[motivation]: #motivation
+
+TVMScript is a fancy tools to write TIR in Python syntax. However, it's not fully compatible with native Python tools (e.g., pylint) because it is not a runnable program in Python.
+
+We have following pain points:
+
+- No Python auto-completion support
+- Usually conflicts with pylint
+- APIs scatter in namespaces like tvm.script, tvm.tir, tvm.script.ty
+- Somewhat non-trivial to understand at first glance what the decorator generates
+
+With the new proposal, we are able to provide type stubs that provides users with TVM scripts that work well with linting and auto-completion.
+
+# Guide-level explanation
+
+[guide-level-explanation]: #guide-level-explanation
+
+Let's see an example for the same TIR program but in different syntax.
+
+## Existing Syntax
+
+```Python
+from tvm import tir
+# ^ here tir is not related to the script but we need to import it. Otherwise there are many lint errors.
+from tvm.script import ty
+# ^ ty is a sub-module for only type system, which makes no sense to import it global
+
+@tvm.script.tir
+class Module:
+  def func(a: ty.handle, b: ty.handle) -> None:
+    A = tir.match_buffer(a, [128, 128], dtype="float32")  # pylint error: tir does not have attr match_buffer
+    B = tir.match_buffer(b, [128], dtype="float32")
+    with tir.block([128, tir.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+## New Syntax
+
+```Python
+from tvm.script import tir as T
+# ^ there is a broadly accepted precedence in doing this in the python community:
+#   from keras import backend as K
+
+@tvm.script.ir_module                                   # it generates an IRModule
+class Module:
+  @T.prim_func                                          # it generates a PrimFunc explicitly
+  def func(a: T.handle, b: T.handle):                   # return type is not necessary for PrimFunc
+    A = T.match_buffer(a, [128, 128], dtype="float32")  # no pylint errors for match_buffer
+    B = T.match_buffer(b, [128], dtype="float32")
+    with T.block([128, T.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+# Reference-level explanation
+
+[reference-level-explanation]: #reference-level-explanation
+
+Pylint and Python auto-completion will look the symbols (function definitions) in the module (e.g. `tvm.script.tir`). Just write (or generate) a concrete function in the module, then can enable auto-completion and pass Pylint checks.
+
+# Drawbacks
+
+[drawbacks]: #drawbacks
+
+Here are some existing works based on current TVM Script syntax. It need a huge refactor to migrate it to the new one.

Review comment:
       Is there a way we could deprecate but not remove the old syntax. It might make it easier to transition. (Though it might be impossible because `tir` is changing from a function to a module. Stackoverflow suggests some _very_ hacky solutions).




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



[GitHub] [tvm-rfcs] tqchen commented on a change in pull request #36: [RFC][TVMScript] New namespace for tvmscript

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



##########
File path: rfcs/0036-tvm-script-namespace.md
##########
@@ -0,0 +1,89 @@
+- Feature Name: TVM Script Namespace
+- Start Date: 2021-09-23
+- RFC PR: [apache/tvm-rfcs#0036](https://github.com/apache/tvm-rfcs/pull/36)
+- GitHub Issue: [apache/tvm#0000](https://github.com/apache/tvm/issues/0000)
+
+# Summary
+
+[summary]: #summary
+
+This is a RFC for the new namespace and user interface for TVM script.
+
+- Use tvm.script as the `root` namespace for all TVM script related stuff
+- Use `tvm.script.tir` for `TIR`, and idiomatically import it as `T`, like Keras is usually imported as K
+- To be consistent with the names of their resulting types, use
+  - `tvm.script.ir_module` for `IRModule`
+  - `T.prim_func` for `tir.PrimFunc`
+
+# Motivation
+
+[motivation]: #motivation
+
+TVMScript is a fancy tools to write TIR in Python syntax. However, it's not fully compatible with native Python tools (e.g., pylint) because it is not a runnable program in Python.
+
+We have following pain points:
+
+- No Python auto-completion support
+- Usually conflicts with pylint
+- APIs scatter in namespaces like tvm.script, tvm.tir, tvm.script.ty
+- Somewhat non-trivial to understand at first glance what the decorator generates
+
+With the new proposal, we are able to provide type stubs that provides users with TVM scripts that work well with linting and auto-completion.
+
+# Guide-level explanation
+
+[guide-level-explanation]: #guide-level-explanation
+
+Let's see an example for the same TIR program but in different syntax.
+
+## Existing Syntax
+
+```Python
+from tvm import tir
+# ^ here tir is not related to the script but we need to import it. Otherwise there are many lint errors.
+from tvm.script import ty
+# ^ ty is a sub-module for only type system, which makes no sense to import it global
+
+@tvm.script.tir
+class Module:
+  def func(a: ty.handle, b: ty.handle) -> None:
+    A = tir.match_buffer(a, [128, 128], dtype="float32")  # pylint error: tir does not have attr match_buffer
+    B = tir.match_buffer(b, [128], dtype="float32")
+    with tir.block([128, tir.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+## New Syntax
+
+```Python
+from tvm.script import tir as T
+# ^ there is a broadly accepted precedence in doing this in the python community:
+#   from keras import backend as K
+
+@tvm.script.ir_module                                   # it generates an IRModule

Review comment:
       should it be IRModule directly or ir_module?




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



[GitHub] [tvm-rfcs] Hzfengsy commented on pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
Hzfengsy commented on pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#issuecomment-928637897


   Thanks, @altanh. Your suggestion makes sense to me. To be specific, here are two cases: parse from a python script and string.
   1. When we parse from a python script, we detect the prefix `T` from the python env (through function `__globals__`, i.e. you can even use `XXX.block` if with `from tvm.script import tir as XXX`)
   2. When we parse from a text string (e.g. printed from tir), we can specify the accept prefixes by `from_source(source_code, tir_prefix=["T", "tir"])` (default accept both `tir` and `T`). Also, we can choose the prefix during printing by `func.script(tir_prefix=β€œtir”)` (default `tir`)
   
   I would update the PR with the new proposal soon. Please feel free to left your comments about the changes.


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



[GitHub] [tvm-rfcs] altanh commented on pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
altanh commented on pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#issuecomment-928106537


   I support this change. One suggestion is that we keep a canonical namespace that will always be parsed correctly to the TIR namespace (e.g. `tir.block` will always work), and in particular use this identifier during printing. Mentioning this here since I noticed the PR apache/tvm#9115 is printing using the `T` alias, which seems problematic unless we print an import statement at the top.


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



[GitHub] [tvm-rfcs] MasterJH5574 commented on a change in pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
MasterJH5574 commented on a change in pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#discussion_r716139088



##########
File path: rfcs/0036-tvm-script-namespace.md
##########
@@ -0,0 +1,89 @@
+- Feature Name: TVM Script Namespace
+- Start Date: 2021-09-23
+- RFC PR: [apache/tvm-rfcs#0036](https://github.com/apache/tvm-rfcs/pull/36)
+- GitHub Issue: [apache/tvm#0000](https://github.com/apache/tvm/issues/0000)
+
+# Summary
+
+[summary]: #summary
+
+This is a RFC for the new namespace and user interface for TVM script.
+
+- Use tvm.script as the `root` namespace for all TVM script related stuff
+- Use `tvm.script.tir` for `TIR`, and idiomatically import it as `T`, like Keras is usually imported as K
+- To be consistent with the names of their resulting types, use
+  - `tvm.script.ir_module` for `IRModule`
+  - `T.prim_func` for `tir.PrimFunc`
+
+# Motivation
+
+[motivation]: #motivation
+
+TVMScript is a fancy tools to write TIR in Python syntax. However, it's not fully compatible with native Python tools (e.g., pylint) because it is not a runnable program in Python.
+
+We have following pain points:
+
+- No Python auto-completion support
+- Usually conflicts with pylint
+- APIs scatter in namespaces like tvm.script, tvm.tir, tvm.script.ty
+- Somewhat non-trivial to understand at first glance what the decorator generates
+
+With the new proposal, we are able to provide type stubs that provides users with TVM scripts that work well with linting and auto-completion.
+
+# Guide-level explanation
+
+[guide-level-explanation]: #guide-level-explanation
+
+Let's see an example for the same TIR program but in different syntax.
+
+## Existing Syntax
+
+```Python
+from tvm import tir
+# ^ here tir is not related to the script but we need to import it. Otherwise there are many lint errors.
+from tvm.script import ty
+# ^ ty is a sub-module for only type system, which makes no sense to import it global
+
+@tvm.script.tir
+class Module:
+  def func(a: ty.handle, b: ty.handle) -> None:
+    A = tir.match_buffer(a, [128, 128], dtype="float32")  # pylint error: tir does not have attr match_buffer
+    B = tir.match_buffer(b, [128], dtype="float32")
+    with tir.block([128, tir.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+## New Syntax
+
+```Python
+from tvm.script import tir as T
+# ^ there is a broadly accepted precedence in doing this in the python community:
+#   from keras import backend as K
+
+@tvm.script.ir_module                                   # it generates an IRModule
+class Module:
+  @T.prim_func                                          # it generates a PrimFunc explicitly
+  def func(a: T.handle, b: T.handle):                   # return type is not necessary for PrimFunc
+    A = T.match_buffer(a, [128, 128], dtype="float32")  # no pylint errors for match_buffer
+    B = T.match_buffer(b, [128], dtype="float32")
+    with T.block([128, T.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]

Review comment:
       Update: I had a quick check, and found that `+=` is well-supported πŸ‘. So just resolve the comments :-)




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



[GitHub] [tvm-rfcs] Hzfengsy commented on a change in pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
Hzfengsy commented on a change in pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#discussion_r715327150



##########
File path: rfcs/0036-tvm-script-namespace.md
##########
@@ -0,0 +1,89 @@
+- Feature Name: TVM Script Namespace
+- Start Date: 2021-09-23
+- RFC PR: [apache/tvm-rfcs#0036](https://github.com/apache/tvm-rfcs/pull/36)
+- GitHub Issue: [apache/tvm#0000](https://github.com/apache/tvm/issues/0000)
+
+# Summary
+
+[summary]: #summary
+
+This is a RFC for the new namespace and user interface for TVM script.
+
+- Use tvm.script as the `root` namespace for all TVM script related stuff
+- Use `tvm.script.tir` for `TIR`, and idiomatically import it as `T`, like Keras is usually imported as K
+- To be consistent with the names of their resulting types, use
+  - `tvm.script.ir_module` for `IRModule`
+  - `T.prim_func` for `tir.PrimFunc`
+
+# Motivation
+
+[motivation]: #motivation
+
+TVMScript is a fancy tools to write TIR in Python syntax. However, it's not fully compatible with native Python tools (e.g., pylint) because it is not a runnable program in Python.
+
+We have following pain points:
+
+- No Python auto-completion support
+- Usually conflicts with pylint
+- APIs scatter in namespaces like tvm.script, tvm.tir, tvm.script.ty
+- Somewhat non-trivial to understand at first glance what the decorator generates
+
+With the new proposal, we are able to provide type stubs that provides users with TVM scripts that work well with linting and auto-completion.
+
+# Guide-level explanation
+
+[guide-level-explanation]: #guide-level-explanation
+
+Let's see an example for the same TIR program but in different syntax.
+
+## Existing Syntax
+
+```Python
+from tvm import tir
+# ^ here tir is not related to the script but we need to import it. Otherwise there are many lint errors.
+from tvm.script import ty
+# ^ ty is a sub-module for only type system, which makes no sense to import it global
+
+@tvm.script.tir
+class Module:
+  def func(a: ty.handle, b: ty.handle) -> None:
+    A = tir.match_buffer(a, [128, 128], dtype="float32")  # pylint error: tir does not have attr match_buffer
+    B = tir.match_buffer(b, [128], dtype="float32")
+    with tir.block([128, tir.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+## New Syntax
+
+```Python
+from tvm.script import tir as T
+# ^ there is a broadly accepted precedence in doing this in the python community:
+#   from keras import backend as K
+
+@tvm.script.ir_module                                   # it generates an IRModule

Review comment:
       Personally prefer `ir_module`. Because decorators are python functions, which usually use `snake_case` style




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



[GitHub] [tvm-rfcs] Hzfengsy commented on a change in pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
Hzfengsy commented on a change in pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#discussion_r715327150



##########
File path: rfcs/0036-tvm-script-namespace.md
##########
@@ -0,0 +1,89 @@
+- Feature Name: TVM Script Namespace
+- Start Date: 2021-09-23
+- RFC PR: [apache/tvm-rfcs#0036](https://github.com/apache/tvm-rfcs/pull/36)
+- GitHub Issue: [apache/tvm#0000](https://github.com/apache/tvm/issues/0000)
+
+# Summary
+
+[summary]: #summary
+
+This is a RFC for the new namespace and user interface for TVM script.
+
+- Use tvm.script as the `root` namespace for all TVM script related stuff
+- Use `tvm.script.tir` for `TIR`, and idiomatically import it as `T`, like Keras is usually imported as K
+- To be consistent with the names of their resulting types, use
+  - `tvm.script.ir_module` for `IRModule`
+  - `T.prim_func` for `tir.PrimFunc`
+
+# Motivation
+
+[motivation]: #motivation
+
+TVMScript is a fancy tools to write TIR in Python syntax. However, it's not fully compatible with native Python tools (e.g., pylint) because it is not a runnable program in Python.
+
+We have following pain points:
+
+- No Python auto-completion support
+- Usually conflicts with pylint
+- APIs scatter in namespaces like tvm.script, tvm.tir, tvm.script.ty
+- Somewhat non-trivial to understand at first glance what the decorator generates
+
+With the new proposal, we are able to provide type stubs that provides users with TVM scripts that work well with linting and auto-completion.
+
+# Guide-level explanation
+
+[guide-level-explanation]: #guide-level-explanation
+
+Let's see an example for the same TIR program but in different syntax.
+
+## Existing Syntax
+
+```Python
+from tvm import tir
+# ^ here tir is not related to the script but we need to import it. Otherwise there are many lint errors.
+from tvm.script import ty
+# ^ ty is a sub-module for only type system, which makes no sense to import it global
+
+@tvm.script.tir
+class Module:
+  def func(a: ty.handle, b: ty.handle) -> None:
+    A = tir.match_buffer(a, [128, 128], dtype="float32")  # pylint error: tir does not have attr match_buffer
+    B = tir.match_buffer(b, [128], dtype="float32")
+    with tir.block([128, tir.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+## New Syntax
+
+```Python
+from tvm.script import tir as T
+# ^ there is a broadly accepted precedence in doing this in the python community:
+#   from keras import backend as K
+
+@tvm.script.ir_module                                   # it generates an IRModule

Review comment:
       Personally prefer `ir_module`, because decorators are python functions, which usually use `snake_case` style. But other suggestions from the community are welcomed




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



[GitHub] [tvm-rfcs] Hzfengsy commented on pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
Hzfengsy commented on pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#issuecomment-928637897


   Thanks, @altanh. Your suggestion makes sense to me. To be specific, here are two cases: parse from a python script and string.
   1. When we parse from a python script, we detect the prefix `T` from the python env (through function `__globals__`, i.e. you can even use `XXX.block` if with `from tvm.script import tir as XXX`)
   2. When we parse from a text string (e.g. printed from tir), we can specify the accept prefixes by `from_source(source_code, tir_prefix=["T", "tir"])` (default accept both `tir` and `T`). Also, we can choose the prefix during printing by `func.script(tir_prefix=β€œtir”)` (default `tir`)
   
   I would update the PR with the new proposal soon. Please feel free to left your comments about the changes.


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



[GitHub] [tvm-rfcs] junrushao1994 commented on pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#issuecomment-929545882


   Thanks guys for the discussion! If the comments and concerns are all addressed, let's move on and merge this PR after 24h


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



[GitHub] [tvm-rfcs] junrushao1994 merged pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
junrushao1994 merged pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36


   


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



[GitHub] [tvm-rfcs] junrushao1994 commented on pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#issuecomment-930344604


   Thanks guys for the discussion! The RFC is merged :-)


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



[GitHub] [tvm-rfcs] junrushao1994 merged pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
junrushao1994 merged pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36


   


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



[GitHub] [tvm-rfcs] MasterJH5574 commented on a change in pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
MasterJH5574 commented on a change in pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#discussion_r716124793



##########
File path: rfcs/0036-tvm-script-namespace.md
##########
@@ -0,0 +1,89 @@
+- Feature Name: TVM Script Namespace
+- Start Date: 2021-09-23
+- RFC PR: [apache/tvm-rfcs#0036](https://github.com/apache/tvm-rfcs/pull/36)
+- GitHub Issue: [apache/tvm#0000](https://github.com/apache/tvm/issues/0000)
+
+# Summary
+
+[summary]: #summary
+
+This is a RFC for the new namespace and user interface for TVM script.
+
+- Use tvm.script as the `root` namespace for all TVM script related stuff
+- Use `tvm.script.tir` for `TIR`, and idiomatically import it as `T`, like Keras is usually imported as K
+- To be consistent with the names of their resulting types, use
+  - `tvm.script.ir_module` for `IRModule`
+  - `T.prim_func` for `tir.PrimFunc`
+
+# Motivation
+
+[motivation]: #motivation
+
+TVMScript is a fancy tools to write TIR in Python syntax. However, it's not fully compatible with native Python tools (e.g., pylint) because it is not a runnable program in Python.
+
+We have following pain points:
+
+- No Python auto-completion support
+- Usually conflicts with pylint
+- APIs scatter in namespaces like tvm.script, tvm.tir, tvm.script.ty
+- Somewhat non-trivial to understand at first glance what the decorator generates
+
+With the new proposal, we are able to provide type stubs that provides users with TVM scripts that work well with linting and auto-completion.
+
+# Guide-level explanation
+
+[guide-level-explanation]: #guide-level-explanation
+
+Let's see an example for the same TIR program but in different syntax.
+
+## Existing Syntax
+
+```Python
+from tvm import tir
+# ^ here tir is not related to the script but we need to import it. Otherwise there are many lint errors.
+from tvm.script import ty
+# ^ ty is a sub-module for only type system, which makes no sense to import it global
+
+@tvm.script.tir
+class Module:
+  def func(a: ty.handle, b: ty.handle) -> None:
+    A = tir.match_buffer(a, [128, 128], dtype="float32")  # pylint error: tir does not have attr match_buffer
+    B = tir.match_buffer(b, [128], dtype="float32")
+    with tir.block([128, tir.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]
+```
+
+## New Syntax
+
+```Python
+from tvm.script import tir as T
+# ^ there is a broadly accepted precedence in doing this in the python community:
+#   from keras import backend as K
+
+@tvm.script.ir_module                                   # it generates an IRModule
+class Module:
+  @T.prim_func                                          # it generates a PrimFunc explicitly
+  def func(a: T.handle, b: T.handle):                   # return type is not necessary for PrimFunc
+    A = T.match_buffer(a, [128, 128], dtype="float32")  # no pylint errors for match_buffer
+    B = T.match_buffer(b, [128], dtype="float32")
+    with T.block([128, T.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]

Review comment:
       I remember TVM script didn't support the `+=` operation. Did we support it in some PR before, or we actually should write the body like `B[i] = B[i] + A[i, k]`?

##########
File path: rfcs/0036-tvm-script-namespace.md
##########
@@ -0,0 +1,89 @@
+- Feature Name: TVM Script Namespace
+- Start Date: 2021-09-23
+- RFC PR: [apache/tvm-rfcs#0036](https://github.com/apache/tvm-rfcs/pull/36)
+- GitHub Issue: [apache/tvm#0000](https://github.com/apache/tvm/issues/0000)
+
+# Summary
+
+[summary]: #summary
+
+This is a RFC for the new namespace and user interface for TVM script.
+
+- Use tvm.script as the `root` namespace for all TVM script related stuff
+- Use `tvm.script.tir` for `TIR`, and idiomatically import it as `T`, like Keras is usually imported as K
+- To be consistent with the names of their resulting types, use
+  - `tvm.script.ir_module` for `IRModule`
+  - `T.prim_func` for `tir.PrimFunc`
+
+# Motivation
+
+[motivation]: #motivation
+
+TVMScript is a fancy tools to write TIR in Python syntax. However, it's not fully compatible with native Python tools (e.g., pylint) because it is not a runnable program in Python.
+
+We have following pain points:
+
+- No Python auto-completion support
+- Usually conflicts with pylint
+- APIs scatter in namespaces like tvm.script, tvm.tir, tvm.script.ty
+- Somewhat non-trivial to understand at first glance what the decorator generates
+
+With the new proposal, we are able to provide type stubs that provides users with TVM scripts that work well with linting and auto-completion.
+
+# Guide-level explanation
+
+[guide-level-explanation]: #guide-level-explanation
+
+Let's see an example for the same TIR program but in different syntax.
+
+## Existing Syntax
+
+```Python
+from tvm import tir
+# ^ here tir is not related to the script but we need to import it. Otherwise there are many lint errors.
+from tvm.script import ty
+# ^ ty is a sub-module for only type system, which makes no sense to import it global
+
+@tvm.script.tir
+class Module:
+  def func(a: ty.handle, b: ty.handle) -> None:
+    A = tir.match_buffer(a, [128, 128], dtype="float32")  # pylint error: tir does not have attr match_buffer
+    B = tir.match_buffer(b, [128], dtype="float32")
+    with tir.block([128, tir.reduce_axis(0, 128)], "C") as [i, k]:
+        B[i] += A[i, k]

Review comment:
       Ditto here.




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



[GitHub] [tvm-rfcs] tqchen commented on pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
tqchen commented on pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#issuecomment-929211907


   Great discussions. If we are encouraging a common idiom(e.g. use T for tir).
   
   We might actually want to encourage print in T as prefix to be consistent on what users might write(and further edit with auto-completion), assuming we always encourage user write `from tvm.script import tir as T`. As long as we agree to that convention. Having a prefix option indeed makes the choice flexible.


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



[GitHub] [tvm-rfcs] tqchen commented on pull request #36: [RFC][TVMScript] New namespace for tvmscript

Posted by GitBox <gi...@apache.org>.
tqchen commented on pull request #36:
URL: https://github.com/apache/tvm-rfcs/pull/36#issuecomment-929211907


   Great discussions. If we are encouraging a common idiom(e.g. use T for tir).
   
   We might actually want to encourage print in T as prefix to be consistent on what users might write(and further edit with auto-completion), assuming we always encourage user write `from tvm.script import tir as T`. As long as we agree to that convention. Having a prefix option indeed makes the choice flexible.


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