You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "quic-sanirudh (via GitHub)" <gi...@apache.org> on 2023/02/11 05:49:23 UTC

[GitHub] [tvm] quic-sanirudh opened a new issue, #13957: [Bug] Crash when applying transform_layout with axis separator

quic-sanirudh opened a new issue, #13957:
URL: https://github.com/apache/tvm/issues/13957

   When we apply `transform_layout` on a write buffer generated by `cache_write` with axis separators, we see a crash where the type_index for the `BlockNode` stmt in its corresponding sref gets corrupted. The below code reproduces the error:
   
   ### Expected behavior
   
   The code should work fine without errors and apply the layout transform with axis separators
   
   ### Actual behavior
   
   Code crashes with different errors like `Unknown type index 2106063344` or `TypeError: Expects StmtSRef 'block_sref' points to 'Block', but gets: runtime.Object`
   
   ### Environment
   
   Tested on Upstream TVM main with Ubuntu 18.04
   
   ### Steps to reproduce
   
   ```python
   import tvm
   import tvm.contrib.hexagon
   import tvm.testing
   from tvm.script import tir as T
   
   
   @T.prim_func
   def add(
       p0: T.Buffer((T.int64(33), T.int64(128)), "float32"),
       p1: T.Buffer((T.int64(33), T.int64(128)), "float32"),
       T_add: T.Buffer((T.int64(33), T.int64(128)), "float32"),
   ):
       T.func_attr({"global_symbol": "main", "tir.noalias": True})
       # with T.block("root"):
       for ax0, ax1 in T.grid(T.int64(33), T.int64(128)):
           with T.block("T_add"):
               v_ax0, v_ax1 = T.axis.remap("SS", [ax0, ax1])
               T.reads(p0[v_ax0, v_ax1], p1[v_ax0, v_ax1])
               T.writes(T_add[v_ax0, v_ax1])
               T_add[v_ax0, v_ax1] = p0[v_ax0, v_ax1] + p1[v_ax0, v_ax1]
   
   
   def transform_fn(x, y):
       return [x // 32, y, tvm.te.AXIS_SEPARATOR, x % 32]
   
   
   def main():
       sch = tvm.tir.Schedule(add)
       block_rv = sch.get_block("T_add")
       sch.cache_write(block_rv, 0, "global")
       sch.transform_layout(block_rv, ("write", 0), transform_fn, pad_value=0.0)
   
   
   if __name__ == "__main__":
       main()
   ```
   
   ### Triage
   
   * [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: commits-unsubscribe@tvm.apache.org.apache.org

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


[GitHub] [tvm] quic-sanirudh closed issue #13957: [Bug] Crash when applying transform_layout with axis separator

Posted by "quic-sanirudh (via GitHub)" <gi...@apache.org>.
quic-sanirudh closed issue #13957: [Bug] Crash when applying transform_layout with axis separator
URL: https://github.com/apache/tvm/issues/13957


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


[GitHub] [tvm] quic-sanirudh commented on issue #13957: [Bug] Crash when applying transform_layout with axis separator

Posted by "quic-sanirudh (via GitHub)" <gi...@apache.org>.
quic-sanirudh commented on issue #13957:
URL: https://github.com/apache/tvm/issues/13957#issuecomment-1426629204

   A temporary fix to this error is in #13958 


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


[GitHub] [tvm] quic-sanirudh commented on issue #13957: [Bug] Crash when applying transform_layout with axis separator

Posted by "quic-sanirudh (via GitHub)" <gi...@apache.org>.
quic-sanirudh commented on issue #13957:
URL: https://github.com/apache/tvm/issues/13957#issuecomment-1427856512

   Closing in favor of an updated issue #13974 


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