[AIROCMIR-446] Lower migraphx.clip into linalg.min (linalg.max(x, minValues),maxValues)#2232
Open
Mr-Anyone wants to merge 2 commits intopr-template-migraphx-to-linalg-4from
Open
[AIROCMIR-446] Lower migraphx.clip into linalg.min (linalg.max(x, minValues),maxValues)#2232Mr-Anyone wants to merge 2 commits intopr-template-migraphx-to-linalg-4from
migraphx.clip into linalg.min (linalg.max(x, minValues),maxValues)#2232Mr-Anyone wants to merge 2 commits intopr-template-migraphx-to-linalg-4from
Conversation
Member
Author
|
Loop fusions seems to work out of the box for this one. |
migraphx.clip into min(max(x, minValues),maxValues)migraphx.clip into linalg.min (linalg.max(x, minValues),maxValues)
c03e94c to
c51ed1b
Compare
0d45610 to
032ff31
Compare
umangyadav
reviewed
Feb 9, 2026
| // CHECK-DAG: %[[one:.*]] = linalg.min ins(%[[zero]], %[[expanded]] : {{.*}}) outs(%cst_2 : {{.*}}) | ||
| // CHECK-DAG: %[[collapsed:.*]] = tensor.collapse_shape %[[one]] | ||
| // CHECK-DAG: return %[[collapsed]] | ||
| func.func @func_clip(%x: !migraphx.shaped<1x1xf32, 1x1>, %min: !migraphx.shaped<1x1xf32, 1x1>, %max: !migraphx.shaped<1x1xf32, 1x1>) -> !migraphx.shaped<1x1xf32, 1x1> { |
Member
There was a problem hiding this comment.
Clip is also elemenetiwse op. Can you put that into same file as elementwise ?
c51ed1b to
1b70fe8
Compare
032ff31 to
d7c9be3
Compare
d9857f0 to
880e493
Compare
d7c9be3 to
5ba6cdb
Compare
880e493 to
51c5c87
Compare
5ba6cdb to
8659c1e
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
Lower
migraphx.clipinto two linalg operations.Technical Details
Introduces a new ClipConverter that lowers migraphx.clip using a composition of linalg.max and linalg.min.
Implements the semantic equivalence:
Test Plan
Added a lit test.
Test Result
Passed lit test.
Submission Checklist