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 2022/12/15 12:12:21 UTC
[GitHub] [tvm] wrongtest-intellif opened a new pull request, #13622: [TVMScript] Fix print round-tripable multi thread env binding
wrongtest-intellif opened a new pull request, #13622:
URL: https://github.com/apache/tvm/pull/13622
Fix the following script with multiple kernel launch (each take standalone thread binding) which is not round-trip-able.
```python
import tvm
from tvm.script import tir as T
@T.prim_func
def main(A: T.Buffer[128, "float32"], C: T.Buffer[128, "float32"]):
B = T.alloc_buffer([128], "float32")
for i in range(128):
with T.block("B1"):
vi = T.axis.remap("S", [i])
B[vi] = A[vi] + 1.0
for i in range(128):
with T.block("B2"):
vi = T.axis.remap("S", [i])
C[vi] = B[vi] + 2.0
s = tvm.tir.schedule.Schedule(main)
b1 = s.get_block("B1")
b2 = s.get_block("B2")
i = s.get_loops(b1)[0]
s.bind(i, "threadIdx.x")
i = s.get_loops(b2)[0]
s.bind(i, "threadIdx.x")
f = tvm.lower(s.mod["main"])
print(f.script())
tvm.ir.assert_structural_equal(f, tvm.script.from_source(f.script()))
```
Since the env thread is always printed on the function head, `TryDeallocVar` which decrease the name uniqueness counting may not be invoked for thread binding code path.
--
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] tvm-bot commented on pull request #13622: [TVMScript] Fix print round-tripable multi thread env binding
Posted by GitBox <gi...@apache.org>.
tvm-bot commented on PR #13622:
URL: https://github.com/apache/tvm/pull/13622#issuecomment-1352972425
<!---bot-comment-->
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @-ing them in a comment.
<!--bot-comment-ccs-start-->
* No users to tag found in teams: `tvmscript` <sub>See [#10317](https://github.com/apache/tvm/issues/10317) for details</sub><!--bot-comment-ccs-end-->
<sub>Generated by [tvm-bot](https://github.com/apache/tvm/blob/main/ci/README.md#github-actions)</sub>
--
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] vinx13 merged pull request #13622: [TVMScript] Fix print round-tripable multi thread env binding
Posted by GitBox <gi...@apache.org>.
vinx13 merged PR #13622:
URL: https://github.com/apache/tvm/pull/13622
--
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