Skip to content

Conversation

@junrushao
Copy link
Member

@junrushao junrushao commented Mar 7, 2023

Previously the printer does not respect the difference between tir.Var and tir.SizeVar, which means SizeVar info will be lost during roundtripping, which is not ideal when dealing with dynamic shape workloads, where SizeVar provides additional bound information to the arithmetic analyzer.

This PR extends Var printing to support SizeVar:

>>> a = tir.SizeVar("a", "int32")
>>> print(a.script(verbose_expr=True))
a = T.int32(is_size_var=True)
a

@tvm-bot
Copy link
Collaborator

tvm-bot commented Mar 7, 2023

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 by @-ing them in a comment.

Generated by tvm-bot

@junrushao junrushao force-pushed the feature/2023-03-07/size-var-print branch from 6644d52 to 3c16278 Compare March 7, 2023 22:03
@junrushao junrushao marked this pull request as ready for review March 7, 2023 22:25
@junrushao junrushao force-pushed the feature/2023-03-07/size-var-print branch 2 times, most recently from e75749d to 057ba20 Compare March 8, 2023 02:40
Copy link
Member

@Hzfengsy Hzfengsy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except a naming change

Previously the printer does not respect the difference between tir.Var
and tir.SizeVar, which means SizeVar info will be lost during
roundtripping, which is not ideal when dealing with dynamic shape
workloads, where SizeVar provides additional bound information to the
arithmetic analyzer.

This PR extends Var printing to support SizeVar:

```python
>>> a = tir.SizeVar("a", "int32")
>>> print(a.script(verbose_expr=True))
a = T.int32(is_size_var=True)
a
```
@junrushao junrushao force-pushed the feature/2023-03-07/size-var-print branch from 057ba20 to c99a06e Compare March 8, 2023 05:35
@cyx-6 cyx-6 merged commit 902c2e2 into apache:main Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants