Skip to content
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

[TIR] Use same DataType of builtin::tvm_struct_set in C++ and Python #14489

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

Lunderberg
Copy link
Contributor

Prior to this commit, the python API tvm.tir.op.tvm_struct_set defined the return type of builtin::tvm_struct_set as "handle", while the C++ API tvm::tir::TVMStructSet defined the return type as DataType::Int(32). The data type used for this builtin has no effect, because no value is returned. However, this discrepancy can cause failure to roundtrip through TVMScript.

This commit updates the Python API to use "int32", for consistency with the C++ API and with CodeGenCPU.

This is part of changes described in #14486, to improve round-trip failures that occur in lowering.

Prior to this commit, the python API `tvm.tir.op.tvm_struct_set`
defined the return type of `builtin::tvm_struct_set` as `"handle"`,
while the C++ API `tvm::tir::TVMStructSet` defined the return type as
`DataType::Int(32)`.  The data type used for this builtin has no
effect, because no value is returned.  However, this discrepancy can
cause failure to roundtrip through TVMScript.

This commit updates the Python API to use `"int32"`, for consistency
with the C++ API and with `CodeGenCPU`.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Apr 4, 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

@Hzfengsy Hzfengsy merged commit 25ec646 into apache:main Apr 5, 2023
@Lunderberg Lunderberg deleted the tvm_struct_set_callnode_dtype branch April 5, 2023 11:50
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.

5 participants