Ewenwan opened a new issue, #14364:
URL: https://github.com/apache/tvm/issues/14364

   
   ```py
   @T.prim_func
   def before_inline(a: T.handle, c: T.handle, m:T.int32, n:T.int32) -> None:
       A = T.match_buffer(a, (m, n))
       B = T.alloc_buffer((m, n))
       C = T.match_buffer(c, (m, n))
       for i, j in T.grid(m, n):
           with T.block("B"):
               vi, vj = T.axis.remap("SS", [i, j])
               B[vi, vj] = A[vi, vj] * 2.0
       for i, j in T.grid(m, n):
           with T.block("C"):
               vi, vj = T.axis.remap("SS", [i, j])
               C[vi, vj] = B[vi, vj] + 1.0
   sch = tvm.tir.Schedule(before_inline)
   sch.compute_inline(sch.get_block("B"))
   print(sch.mod["main"].script())
   ```
   # Error message: 
   ```
   ScheduleError: An error occurred in the schedule primitive 'compute-inline'.
   The IR with diagnostic is:
   # from tvm.script import tir as T
   @tvm.script.ir_module
   class Module:
       @T.prim_func
       def main(a: T.handle, c: T.handle, m: T.int32, n: T.int32) -> None:
           A = T.match_buffer(a, [m, n], dtype="float32")
           C = T.match_buffer(c, [m, n], dtype="float32")
           # body
           # with T.block("root")
           B = T.alloc_buffer([m, n], dtype="float32")
           for i, j in T.grid(m, n):
               # tir.Block#0
               with T.block("B"):
               ^^^^^^^^^^^^^^^^^^
                   vi, vj = T.axis.remap("SS", [i, j])
                   T.reads(A[vi, vj])
                   T.writes(B[vi, vj])
                   B[vi, vj] = A[vi, vj] * T.float32(2)
           for i, j in T.grid(m, n):
               with T.block("C"):
                   vi, vj = T.axis.remap("SS", [i, j])
                   T.reads(B[vi, vj])
                   T.writes(C[vi, vj])
                   C[vi, vj] = B[vi, vj] + T.float32(1)
       
   Error message: The body of the inlined block should be in form of
       'A[i, j, k, ...] = f(i, j, k, ...)',
   where the indices on the left are distinct atomic variables,
   and there should be no variables other than the index variables
   ```
   


-- 
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]

Reply via email to