Fix schedule replay and legality checks - #10
Merged
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.
Summary
This PR brings the C++ schedule executor in line with the schedule semantics used by iraLib. It fixes group unrolling, final-schedule parallel legality, complete skew-matrix parsing, multi-computation parallelization, and explicit subset unrolling.
The Python-side changes are in TiraLib PR #58. The final parallelism check requires Tiramisu PR #422.
Changes
Keep computation groups fused after unrolling
Commit 75f959b restores the
.after()ordering of a computation group after applyingunroll()to its members.Each
computation::unroll()call splits that computation's loop independently. Applying it to every member of a fused group can therefore introduce loop fission and change the meaning of schedules with dependencies inside that loop. The handler now re-fuses the group at its new innermost level. Single-computation unrolls are unaffected.The Python equivalent is TiraLib
861caab.Check parallelization against the final schedule
Commit e0b6be2 runs
tiramisu::check_legality_of_parallelism()after all schedule actions have been applied.A parallel tag is attached to a loop level when the action is processed. Later loop transformations can change which loop occupies that level, making the original legality decision stale. Rechecking the recorded tags on the final schedule fixes the parallelize-then-interchange case from TiraLib issue #34.
This commit depends on Tiramisu
d7ad1e8b. The Python equivalent is TiraLib9ade86a.Support complete two-dimensional skew matrices
Commit 067dafe extends the
S(...)parser with a four-factor form:The existing two-factor form supplies only the first row and relies on Tiramisu to solve for the second. Since that form cannot represent every valid unimodular matrix, the new syntax passes the complete matrix to Tiramisu's four-factor skew overload. The old syntax, including automatic factor selection, remains unchanged.
The Python parser is updated in TiraLib
fc425d3, and Tiramisu emits the lossless form in Tiramisu5fc025f8.Apply parallelization to every selected computation
Commit a666990 tags every distinct computation listed in
P(...).The handler previously checked the complete list for legality but called
tag_parallel_level()only on its first member. That assumption is valid for a completely fused group, but it leaves independent loops serial. The parser now deduplicates the resolved computation pointers and tags each one. Repeated tags for a shared fused loop still produce one parallel loop.The Python equivalent is TiraLib
4f16a31.Support legality-checked subset unrolling
Commit 03d818c adds the internal
UCheck(...)action andexecution_no_checkoperation needed to replay an explicit subset unroll without widening its target.Tiramisu's specialized unrolling legality check expects the complete computation group for a fused loop, while execution must apply the transformation only to the computations listed in the schedule.
UCheck(...)validates the full group without mutating the legality schedule. After that succeeds, TiraLib starts a fresh server process and applies the originalU(...)action to the exact subset. The unchecked execution operation is internal and is selected only after a successful legality result.This commit also puts the source tree's headers before installed headers during the build, preventing an older installed protocol definition from shadowing the version being built. Full-loop
U(...)actions keep their existing path.The coordinating Python changes are in TiraLib
1c7ba19.Compatibility
U(...)behavior.Testing
UCheck(...), and checked subset execution.