Fix invalid concat in find_conv_concat_split_fuse for Topaz flow models - #5156
Open
urpetkov-amd wants to merge 1 commit into
Open
Fix invalid concat in find_conv_concat_split_fuse for Topaz flow models#5156urpetkov-amd wants to merge 1 commit into
urpetkov-amd wants to merge 1 commit into
Conversation
urpetkov-amd
requested review from
TedThemistokleous,
pfultz2 and
shivadbhavsar
and removed request for
causten
August 20, 2026 14:44
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5156 +/- ##
========================================
Coverage 93.13% 93.13%
========================================
Files 625 625
Lines 33252 33254 +2
========================================
+ Hits 30967 30969 +2
Misses 2285 2285
🚀 New features to boost your workflow:
|
Check flagged results 🔆 * No develop baseline was found for this PR's branch point; compared against the latest available develop run instead. |
|
TedThemistokleous
requested changes
Aug 20, 2026
TedThemistokleous
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. Add a unit test that triggers the invalid concat so we can capture the failure that this change fixes.
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.
Motivation
Topaz flow U-Net ONNX models (e.g.
thf-v4-fnet-fp16-256x352,thd-v3-fnet-fp16-256x352) fail GPU compile in MIGraphX during thesimplify_algebrapass. The failure blocks compilation viamigraphx-driverand any execution provider that uses the MIGraphX GPU pipeline (including the AMDGPU EP). The only workaround today is disabling the entire pass withMIGRAPHX_DISABLE_PASSES=simplify_algebra.This PR fixes the compile crash so these models compile without disabling
simplify_algebra.Technical Details
Root cause: In
find_conv_concat_split_fuse(src/simplify_algebra.cpp), horizontal conv fusion through a channel concat can build a suffixconcat(axis=1)over the remaining concat inputs without verifying that spatial dimensions match. On Topaz-style U-Net graphs—decoder feature + encoder skip concat, conv on the concat, parallel stride-2 conv on the skip branch—this can produce an invalid concat afterrewrite_convolutionhas rewritten transposed convs, triggering:Changes:
is_valid_concat()to file scope (same logic already used byfind_concat_op) so both transforms share one helper.find_conv_concat_split_fuse, compute suffixremaininginputs before inserting any fusion IR.remaining.size() > 1andis_valid_concat(remaining, 1)is false.Valid fusion paths (e.g. existing
conv_horizontal_fuseintest/simplify_algebra_test.cpp) are unchanged. Invalid paths skip fusion instead of aborting compile.Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot ApplicableFollow the LLVM AI Tool Use Policy for contributions using AI.