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 2021/12/14 09:23:34 UTC

[GitHub] [tvm-rfcs] wrongtest edited a comment on pull request #39: [RFC][TIR] Layout transformations on buffer access

wrongtest edited a comment on pull request #39:
URL: https://github.com/apache/tvm-rfcs/pull/39#issuecomment-993336900


   @Lunderberg  Hi, I am much interested in `transform_layout`  but my team depends totally on TensorIR schedule instead of TE.  Could you kindly provide more design points on TensorIR side? It would be great if we can enjoy this preview feature in TensorIR. It is really useful for us.
   
   We have implemented some TensorIR primitives to serve similar purposes in form below to mutate the `Buffer` object's layout, strides and dtypes. 
   ```python
   s.replace_buffer_obj(block, write_buffer_idx, *a set of rewrite callbacks)
   ```
   Since generally all buffer accesses are multi-dimensional in TensorIR schedule phase, the implementation is a bit easier (just something like a pass to substitute the buffer object and do not require full pipeline modifications) than in TE, if no extra representative variables are introduced. Is the `transform_layout` would also be like above?
   ```python
   s.transform_layout(block, buffer_idx, remap_func)
   ```
   
   Another form we use is just a duality of loop transformation primitives, where representative variables for buffer or axis of buffer are tracked into TensorIR schedule states.
   ```python
   n, c, h, w = s.get_buffer_axes(block, buffer_idx)
   c_outer, c_inner = s.split_for_buffer(c)
   s.reorder_for_buffer(n, c_outer, h, w, c_inner)
   
   # for `transform_layout` look like this?
   buffer_rv = s.get_buffer(some identifier)
   new_buffer_rv = s.transform_layout(buffer_rv, remap_func)
   ```
   Is it possible to provide both integrated `transform_layout` primitive and step by step primitives for user's convenience?
   
   Very glad to know your opinions!  :)


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