[TensorIR][Schedule] New schedule primitive unsafe_hide_buffer_access#15144
[TensorIR][Schedule] New schedule primitive unsafe_hide_buffer_access#15144yzh119 merged 5 commits intoapache:mainfrom
unsafe_hide_buffer_access#15144Conversation
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
There was a problem hiding this comment.
Thanks for the PR, a nice addition :). As mentioned in my comment below, could we rename the primitive to unsafe_hide_buffer_access and perhaps add some comments in the docstring to indicate the chances of incorrect output resulting from using this primitive.
|
Hi @quic-sanirudh, thank you for your suggestions, I have marked the schedule as unsafe and added some docstrings explaining it. |
hide_buffer_accessunsafe_hide_buffer_access
Thanks for taking my suggestion. Looks good to me now |
Motivation
Currently, our
tensorizeschedule primitives rely on buffer read/write regions in the given block to perform pattern matching. However, for workloads such as block sparse operators, the read/write regions include some indices arraies that may failtensorizeprimitive.In SparseTIR we introduce a new schedule primitive called
hide_buffer_accesswhich allows us to hide certain buffer regions in a block so that the read/write buffer regions would be recognized by thetensorizeprimitive to further utilize tensor acceleration units.This PR upstreams this schedule primitive to TensorIR mainline.
The schedule primitive interface
Example
After we perform hiding buffer access to
IA[vi]via:the desired transformed IR would be:
The existing passes/schedules would not be influenced by this PR.
cc @junrushao @MasterJH5574 @masahi