TH3CHARLie opened a new issue, #15877:
URL: https://github.com/apache/tvm/issues/15877
### Expected behavior
Getting reasonable error messages if the schedules like this are not
allowed, or pass compilation.
### Actual behavior
Getting TVMError like "TVMError: cannot make uint from negative value -8"
### Environment
ubuntu 20.04, tvm main branch
### Steps to reproduce
starting with this TIR module:
```python
@I.ir_module
class Module:
@T.prim_func
def main(var_A: T.handle, var_B: T.handle, var_E: T.handle):
T.func_attr({"tir.noalias": T.bool(True)})
n = T.int32()
A = T.match_buffer(var_A, (n,))
B = T.match_buffer(var_B, (n,))
E = T.match_buffer(var_E, (n,))
# with T.block("root"):
C = T.alloc_buffer((n,))
D = T.alloc_buffer((n,))
for i in range(n):
with T.block("C"):
v_i = T.axis.spatial(n, i)
T.reads(A[v_i], B[v_i])
T.writes(C[v_i])
C[v_i] = A[v_i] + B[v_i]
for i in range(n):
with T.block("D"):
v_i = T.axis.spatial(n, i)
T.reads(C[v_i])
T.writes(D[v_i])
D[v_i] = C[v_i] + C[v_i]
for i in range(n):
with T.block("E"):
v_i = T.axis.spatial(n, i)
T.reads(D[v_i], A[v_i])
T.writes(E[v_i])
E[v_i] = D[v_i] + A[v_i]
```
apply the following schedule:
```python
block_e = schedule.get_block("E")
i, = schedule.get_loops(block_e)
schedule.split(i, factors=[None, 8])
i_0, i_1 = schedule.get_loops(block_e)
schedule.split(i_0, factors=[None, 2])
schedule.vectorize(i_1)
i_0_0, i_0_1, i_1 = schedule.get_loops(block_e)
schedule.reorder(i_1, i_0_1, i_0_0)
block_d = schedule.get_block("D")
i_1, i_0_1, i_0_0 = schedule.get_loops(block_e)
schedule.compute_at(block_d, i_0_1)
```
and then build the scheduled module
```
tgt = tvm.target.Target(target="llvm", host="llvm")
mod = tvm.build(schedule.mod, tgt)
```
### Triage
Please refer to the list of label tags
[here](https://github.com/apache/tvm/wiki/Issue-Triage-Labels) to find the
relevant tags and add them below in a bullet format (example below).
* needs-triage
* tir:schedule
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]