Fix Assertion Crash and Optimize Compile Time#298
Merged
Conversation
d9457bc to
f757176
Compare
…kOptimizationPass
f757176 to
7017d86
Compare
tancheng
reviewed
Mar 21, 2026
Contributor
tancheng
left a comment
There was a problem hiding this comment.
This PR is on top of your current register-constraint PR..
Collaborator
Author
Sry my bad, the branch is clean now. |
Contributor
looks not yet committed. |
Collaborator
Author
I mistakenly pushed the current pr to the wrong branch yesterday, and I have reverted the changes. This branch is based on |
Collaborator
Author
|
|
tancheng
reviewed
Mar 22, 2026
lib/TaskflowDialect/Transforms/Optimizations/ResourceAwareTaskOptimizationPass.cpp
Outdated
Show resolved
Hide resolved
lib/TaskflowDialect/Transforms/Optimizations/ResourceAwareTaskOptimizationPass.cpp
Show resolved
Hide resolved
lib/TaskflowDialect/Transforms/Optimizations/ResourceAwareTaskOptimizationPass.cpp
Outdated
Show resolved
Hide resolved
tancheng
approved these changes
Mar 23, 2026
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 addresses PR #296, and fixes two problems:
cloneWithNewDimensions()when replaying tile/link overrides on smaller CGRA gridsProblem 1: Assertion Crash
Root Cause
ResourceAwareTaskOptimizationPasstests task placement on smaller CGRA grids by callingcloneWithNewDimensions(). This method replays alltile_overridesandlink_overridesfrom the original 4×4 grid. However, if an override references coordinates (e.g., (3,3)) that don't exist in the smaller cloned grid, the assertinggetTile()call crashes.Solution
Replaced 4 asserting
getTile()calls with safecoord_to_tile_.find()lookups. These changes allow graceful degradation: overrides that don't apply to the new grid's coordinate space are simply skipped.Problem 2: Excessive Compile Time
Root Cause
The balance phase in
ResourceAwareTaskOptimizationPassran the full mapper on every speculative CGRA count probe.Solution
Restructured the balance phase to use analytical estimates during iterations.