[TIR][Schedule] Relax reorder primitive's affine binding check #10887
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there, this pr aims to make some workload schedulable with
reorder
primitive. We can find a nice description for similar workloads in ethosu's cascade scheduler work: https://github.com/apache/tvm-rfcs/blob/main/rfcs/0037-arm-ethosu-cascading-scheduler.md.https://github.com/apache/tvm-rfcs/raw/main/resources/cascading-diagram.png
Generally, if we have consecutive ops like conv and pooling, tiling the last one, and
compute_at
others under the outer loops, we then create cascade tiles simultaneously. The block binding for sub-blocks (except last) are not affine, since they have overlapped tile regions, due to non-trivial strides and window size.Under current check, we can not
reorder
each sub-block's inner loops to perform subsequent optimizations, since a global affine binding is required. But note that if we fix outer loops, the block binding wrt inner loops generally keep affineness. The pr try to allowreorder
in this situation.The example script below builds two consecutive pooling op from
te
and schedule them with tir: