[BugFix][TIR][Schedule] TileWithTensorIntrin skip ComputeInline if bu… #17440
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.
…ffer not padded by PadEinsum
TileWithTensorIntrin
insrc/tir/schedule/transform.cc
callsPadEinsum
and inlines the padded input (output) to its original producer (consumer). However it is possible that one of the inputs/outputs does not need to be padded, in which case that producer (consumer) is not padded byPadEinsum
. This means thatTileWithTensorIntrin
may inline blocks that are irrelevant to padding and must not be inlined.This has led to multiple bug reports and (temporary) fixes as in #17171, #16614, #16239 and #15505. Unfortunately #16239 and #17171 can only prevent TVM from crashing when the padded buffer is an input/output buffer, and still some incorrect inlining may be performed. The workaround in #15505 tried to handle this bug by extra checking in the
MultiLevelTilingTensorCore
rule, which is logically incorrect. This PR aims to provide a one-and-for-all fix for this.Credit to @XFPlus for the bug reproduce example in #16239.