Loop subgraph support - #5103
Draft
weizhu12-amd wants to merge 2 commits into
Draft
Conversation
YOLOv3 may contain duplicate loop subgraphs, causing a duplicate-key insertion into the subgraph map and resulting in a crash. Preserve the original parent subgraph during parsing and restore it after parsing is complete.
weizhu12-amd
force-pushed
the
loop_support
branch
from
July 30, 2026 08:11
7efdf2a to
5164526
Compare
Regressions detected 🔴 |
|
weizhu12-amd
force-pushed
the
loop_support
branch
from
August 3, 2026 00:50
5164526 to
2c9bc02
Compare
weizhu12-amd
force-pushed
the
loop_support
branch
from
August 3, 2026 08:12
2c9bc02 to
65d15fa
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5103 +/- ##
===========================================
+ Coverage 92.90% 93.26% +0.36%
===========================================
Files 603 623 +20
Lines 32526 32969 +443
===========================================
+ Hits 30217 30746 +529
+ Misses 2309 2223 -86
🚀 New features to boost your workflow:
|
weizhu12-amd
force-pushed
the
loop_support
branch
from
August 3, 2026 08:59
65d15fa to
7a7bf6f
Compare
Loop operation is converted to identity IR. Copy and allocation instructions need to be inserted between consecutive identity instructions. However, the current implementation skips this. This change ensures that the required copy and allocation instructions are generated correctly for identity IR.
weizhu12-amd
force-pushed
the
loop_support
branch
from
August 5, 2026 03:05
7a7bf6f to
4cca908
Compare
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
MIGraphX cannot run the YOLOv3 model because the model contains loop subgraphs. This PR resolves the parsing and compiling issues associated with this subgraph.
Technical Details
1, Handle duplicate loop subgraphs during parsing
YOLOv3 may contain duplicate loop subgraphs, causing a duplicate-key insertion into the subgraph map and resulting in a crash. Preserve the original parent subgraph during parsing and restore it after parsing is complete.
2, Insert copy and allocation instructions for identity IR
Loop operations are lowered to identity IR. Copy and allocation instructions need to be inserted between consecutive identity instructions. However, the current implementation skips this.
This change ensures that the required copy and allocation instructions are generated correctly for identity IR.
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot ApplicableFollow the LLVM AI Tool Use Policy for contributions using AI.