-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bugfix][TIR] Handle bool tensor in FlattenBuffer (#11532)
This PR fixes an existing bug in TIR lowering where the TIR below triggers an error: ```python @T.prim_func def func(a: T.Buffer[10, "bool"], b: T.Buffer[10, "bool"]) -> None: T.func_attr({"global_symbol": "main", "tir.noalias": True}) for i in T.serial(10): with T.block("b"): vi = T.axis.spatial(10, i) b[vi] = a[vi] tvm.build(func, target="llvm") ``` The error message is: ``` File "/root/Projects/tvm-dev/src/tir/transforms/flatten_buffer.cc", line 173 TVMError: --------------------------------------------------------------- An error occurred during the execution of TVM. For more information, please see: https://tvm.apache.org/docs/errors.html --------------------------------------------------------------- Check failed: store->buffer->dtype == DataType::Int(8) (bool vs. int8) : Expected int8 backing array for boolean tensor ``` This PR fixes this behavior.
- Loading branch information
Showing
2 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters