Avoid building an ISL AST for illegal schedules - #59
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.
Companion server changes: TiraLibCpp PR #11 .
Some legality checks returned
falsequickly, then spent most of their time ingen_isl_ast(). Building an AST for a rejected schedule is unnecessary, and for some invalid transformed domains it can take hours or use excessive memory.The Python compilation path now returns
(False, None)as soon as legality fails.Schedule.is_legal()keeps the last valid tree in that case. Legal schedules still return an AST and update the tree as before; tree refresh remains immediate.This also fixes duplicate computation targets during replay. A computation may appear in more than one ISL AST branch, and a serialized schedule may list the same target more than once. Tree reconstruction and schedule parsing now keep the first occurrence only.
When the first listed computation does not expose the requested loop level, the parser uses another listed computation that does.
Tests cover legal and illegal server results, preservation of the last valid tree, and repeated computations in an ISL AST.