[AIROCMLIR-612] Lower migraphx.convert into linalg.generic#2302
Merged
[AIROCMLIR-612] Lower migraphx.convert into linalg.generic#2302
migraphx.convert into linalg.generic#2302Conversation
1dc37d9 to
1f101bd
Compare
d8d1cf9 to
93023d1
Compare
1f101bd to
1dc37d9
Compare
migraphx.convert into linalg.genericmigraphx.convert into linalg.generic
umangyadav
approved these changes
Mar 25, 2026
1dc37d9 to
83fb455
Compare
93023d1 to
58c43e8
Compare
1 task
83fb455 to
ce3e8e0
Compare
58c43e8 to
0182077
Compare
a4d0c34 to
871820b
Compare
a4312db to
9a6410b
Compare
9a6410b to
8640ff4
Compare
Contributor
|
sorry I'm late to the review, We have always rewritten migraphx.convert to tosa.cast, so migraphx expects tosa's way of casting. We are having some issues on rocmlirTriton (https://github.com/ROCm/rocmlirTriton/pull/125) related to this. We use tosa spec for converting (tosa.cast), so the logic they follow is not as simple as |
Contributor
|
we probably want to sync with migraphx team if we really want to follow tosa's spec for casting. My intuition is that it's better to follow what ONNX/pytorch do instead (which might be the same as tosa or not). |
umangyadav
pushed a commit
that referenced
this pull request
Apr 9, 2026
Lower migraphx.convert into linalg.generic
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
There is a nice helper in
arith/Utils/Utils.hthat converts from type A to type B. In the case of integer, we always assume it is signed. See AIROCMLIR-595Technical Details
Added a linalg.generic loop elementwise converter that converts type type A to type B. The emitted IR looks like the following:
Starting from
to
Test Plan
Lit test
Test Result
Passed lit test
Submission Checklist