You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/04/05 00:37:30 UTC

[GitHub] [tvm] zxybazh commented on issue #10900: [Bug] `Compute_inline` Accepts Invalid Block Causing Error

zxybazh commented on issue #10900:
URL: https://github.com/apache/tvm/issues/10900#issuecomment-1088153208

   Here is the generated tir:
   ```
   
   # from tvm.script import tir as T
   @tvm.script.ir_module
   class Module:
       @T.prim_func
       def main(placeholder: T.Buffer[(1, 512, 7, 7), "float32"], tensor: T.Buffer[(1, 512, 1, 1), "float32"]) -> None:
           # function attr dict
           T.func_attr({"global_symbol": "main", "tir.noalias": True})
           # buffer definition
           tensor_1_rf = T.buffer_decl([1, 512, 1, 1, 49], dtype="float32")
           # body
           with T.block("root"):
               T.reads()
               T.writes()
               T.block_attr({"meta_schedule.parallel":64, "meta_schedule.unroll_explicit":0, "meta_schedule.vectorize":64})
               tensor_1 = T.alloc_buffer([1, 512, 1, 1], dtype="float32")
               for i0, i1 in T.grid(1, 512):
                   for ax0, ax1, ax2, ax3, ax4 in T.grid(49, 1, 1, 1, 1):
                       with T.block("tensor"):
                           vi4_i5_fused_0_i4_i5_fused_1_fused_0, ax0_1 = T.axis.remap("RS", [ax0, ax1])
                           ax1_1 = T.axis.spatial(512, i1 + ax2)
                           ax2_1, ax3_1 = T.axis.remap("SS", [ax3, ax4])
                           T.reads(tensor_1_rf[ax0_1, ax1_1, ax2_1, ax3_1, vi4_i5_fused_0_i4_i5_fused_1_fused_0], placeholder[ax0_1, ax1_1, ax2_1 * 7 + vi4_i5_fused_0_i4_i5_fused_1_fused_0 // 7, ax3_1 * 7 + vi4_i5_fused_0_i4_i5_fused_1_fused_0 % 7])
                           T.writes(tensor_1[ax0_1, ax1_1, ax2_1, ax3_1])
                           with T.init():
                               tensor_1[ax0_1, ax1_1, ax2_1, ax3_1] = T.float32(0)
                           tensor_1[ax0_1, ax1_1, ax2_1, ax3_1] = tensor_1[ax0_1, ax1_1, ax2_1, ax3_1] + (tensor_1_rf[ax0_1, ax1_1, ax2_1, ax3_1, vi4_i5_fused_0_i4_i5_fused_1_fused_0] + placeholder[ax0_1, ax1_1, ax2_1 * 7 + vi4_i5_fused_0_i4_i5_fused_1_fused_0 // 7, ax3_1 * 7 + vi4_i5_fused_0_i4_i5_fused_1_fused_0 % 7])
                   for i2, i3 in T.grid(1, 1):
                       with T.block("tensor_1"):
                           ax0, ax1, ax2, ax3 = T.axis.remap("SSSS", [i0, i1, i2, i3])
                           T.reads(tensor_1[ax0, ax1, ax2, ax3])
                           T.writes(tensor[ax0, ax1, ax2, ax3])
                           tensor[ax0, ax1, ax2, ax3] = tensor_1[ax0, ax1, ax2, ax3] * T.float32(0.020408163265306121)
   ```


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org