scheduling: reject reorder() of compressed dimension before its storage parent#578
Open
itsme-ranger wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #403.
Reorder::apply()accepted any loop reordering without checking whether therequested order is valid for the tensor's storage format. For a tensor in CSF
or CSR format, the position array of level L is indexed by the level-(L-1)
iterator variable, so the level-L loop must be nested inside the level-(L-1)
loop. Requesting
reorder(j, i, k)on a fully-compressed tensorA(i,j,k)previously emitted code that read
iAbefore it was declared:This PR adds a validation step in
Reorder::apply()that walks all tensoraccesses and, for each pair of consecutive compressed modes
(prev, cur),checks that
prev's index variable appears beforecur's index variable inthe requested pattern. If not, it returns an empty
IndexStmtand sets thereason string.
A regression test is added: SpTV
y(j) = A(i,j,k) * x(k)withA = {Compressed, Compressed, Compressed}—reorder({j, i, k})must failwith a non-empty reason.