You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tvm.apache.org by Siyuan Feng <no...@github.com.INVALID> on 2021/09/23 14:10:24 UTC

[apache/tvm-rfcs] [RFC][TVMScript] New namespace for tvmscript (#36)

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

You can view, comment on, or merge this pull request online at:

  https://github.com/apache/tvm-rfcs/pull/36

-- Commit Summary --

  * <a href="https://github.com/apache/tvm-rfcs/pull/36/commits/3bf11870d22aefc149da1fe3d618f36f0351f9ef">init script rfc</a>

-- File Changes --

    A rfcs/0036-tvm-script-namespace.md (89)

-- Patch Links --

https://github.com/apache/tvm-rfcs/pull/36.patch
https://github.com/apache/tvm-rfcs/pull/36.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/36

Re: [apache/tvm-rfcs] [RFC][TVMScript] New namespace for tvmscript (#36)

Posted by Altan Haan <no...@github.com.INVALID>.
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.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/36#issuecomment-928106537

Re: [apache/tvm-rfcs] [RFC][TVMScript] New namespace for tvmscript (#36)

Posted by Junru Shao <no...@github.com.INVALID>.
Thanks guys for the discussion! The RFC is merged :-)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/36#issuecomment-930344604

Re: [apache/tvm-rfcs] [RFC][TVMScript] New namespace for tvmscript (#36)

Posted by Junru Shao <no...@github.com.INVALID>.
Thanks guys for the discussion! If the comments and concerns are all addressed, let's move on and merge this PR after 24h

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/36#issuecomment-929545882

Re: [apache/tvm-rfcs] [RFC][TVMScript] New namespace for tvmscript (#36)

Posted by Tianqi Chen <no...@github.com.INVALID>.
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.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/36#issuecomment-929211907

Re: [apache/tvm-rfcs] [RFC][TVMScript] New namespace for tvmscript (#36)

Posted by Siyuan Feng <no...@github.com.INVALID>.
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.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/36#issuecomment-928637897

Re: [apache/tvm-rfcs] [RFC][TVMScript] New namespace for tvmscript (#36)

Posted by Junru Shao <no...@github.com.INVALID>.
Merged #36 into main.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/36#event-5382108357