-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed instruction::replace() logic - Fix CI. #3574
Merged
Merged
Conversation
This file contains 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
… fully work in more complex cases (e.g. it will fail in the newly added test case check_replace_dag). This fix implements topological sorting to replace instruction in topological order which should work for all cases.
…ly based on Khan's algorithm. This version avoids sorting the entire graph, and will terminate when no more changes are requried like old versions
added, which preserves the topological ordering of dependencies.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3574 +/- ##
========================================
Coverage 92.17% 92.17%
========================================
Files 513 513
Lines 21536 21547 +11
========================================
+ Hits 19851 19862 +11
Misses 1685 1685 ☔ View full report in Codecov by Sentry. |
pfultz2
reviewed
Oct 30, 2024
pfultz2
approved these changes
Nov 5, 2024
Check results before merge 🔆 |
🔴bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output |
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.
Fixing issues in PR #3553 that is causing failures in some of the tests.
Description of 3553:
The previous fix with BFS doesn't fully work in more complex cases (e.g. it will fail in the newly added test case
check_replace_dag
). This fix implements topological sorting to replace instructions in topological order which should work for all cases.More details:
In a dummy scenario of
add2(reduce(x), add1(abs(reduce(x)), sin(reduce(x))))
, we will have a dependency tree looking likeIf we call reduce.replace(), BFS will visit the instructions in the following order:
This will causes an error of shape mismatch at
add2
because it is called before its inputadd1
.Topological sorting the instruction tree will yield:
Which is the correct order to process the instructions.
This should be able to extend to more complex cases.