-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[TIRScript] fix parse StringImm value in for loop annotations #9755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIRScript] fix parse StringImm value in for loop annotations #9755
Conversation
|
Annotations actually expect |
|
@vinx13 Hi, the issue is about string dict value as a clarification. The key type seems no problem. The parser already convert str to StringImm in annotations but provide the old dict (maybe a typo). For the pass, currently it assumes all dict values should be of |
|
StringImm here might be something I forgot to change in #9742. Annotations value is ObjectRef and we would like to use String directly. |
855d2d1 to
f1b378f
Compare
I update it by the suggestion. But another problem is detected. Primfunc with flattened loop attrs seems not supported by script parser. It would lead to "use before def" errors. def main(A: T.Buffer[(16,), "float32"]) -> None:
# body
T.attr(i, "pragma_1", "str_value")
...
for i in T.serial(16): |
|
@Hzfengsy is that exactly the same issue we talked about a while ago? BTW please rebase to our latest HEAD |
3e25769 to
8309a4f
Compare
|
Thanks @wrongtest @vinx13 @junrushao1994 |
…#9755) * fix parse strimm value in for annotations * flatten buffer allow runtime.String attr value * remove unused import * rebase and ensure flattened attr order
…#9755) * fix parse strimm value in for annotations * flatten buffer allow runtime.String attr value * remove unused import * rebase and ensure flattened attr order
…#9755) * fix parse strimm value in for annotations * flatten buffer allow runtime.String attr value * remove unused import * rebase and ensure flattened attr order
Fix a minor issue that
for i in T.serial(0, 4, annotations={"pragma_key":"value"})result to aruntime.Stringtyped dict value. The flatten pass do not allow attribute value ofruntime.String.