Skip to content

[AIROCMLIR-564] Lower migraphx.reshape using helper function#2271

Merged
Mr-Anyone merged 1 commit intodevelopfrom
pr-migraphx-to-linalg-reshape
Mar 7, 2026
Merged

[AIROCMLIR-564] Lower migraphx.reshape using helper function#2271
Mr-Anyone merged 1 commit intodevelopfrom
pr-migraphx-to-linalg-reshape

Conversation

@Mr-Anyone
Copy link
Copy Markdown
Contributor

Motivation

Being able to lower migraphx.reshape

Technical Details

migraphx.reshape is lowered as the following:

%intermediate = tensor.collapse_shape ... // collapse shape into one dimensional
%result = tensor.expand_shape... // expand shape into the target shape

This is kind of a freebie from the previous PR as that PR implemented reshapeValue function

Note that the tosa pipeline lowers tosa.reshape as a expand_shape and collapse_shape as well. This is done in the tosa-to-tensor pass::

https://github.com/llvm/llvm-project/blob/42d07c38e22768360a66548407a28332340efb20/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp#L259-L261

Test Plan

lit test

Test Result

Passed lit test

Submission Checklist

@Mr-Anyone Mr-Anyone force-pushed the pr-migraphx-to-linalg-broadcasting branch from 027e966 to fd730d0 Compare March 6, 2026 15:49
Base automatically changed from pr-migraphx-to-linalg-broadcasting to develop March 6, 2026 21:10
@Mr-Anyone Mr-Anyone force-pushed the pr-migraphx-to-linalg-reshape branch from d3bd904 to 3f78e53 Compare March 6, 2026 21:12
@Mr-Anyone Mr-Anyone merged commit 529789d into develop Mar 7, 2026
7 of 14 checks passed
@Mr-Anyone Mr-Anyone deleted the pr-migraphx-to-linalg-reshape branch March 7, 2026 19:46
@Mr-Anyone Mr-Anyone restored the pr-migraphx-to-linalg-reshape branch March 8, 2026 00:42
cursor Bot pushed a commit that referenced this pull request Mar 13, 2026
Automated weekly review of merged PRs #2234 #2240 #2248 #2249 #2251
#2254 #2257 #2258 #2259 #2270 #2271.

Identifies 6 areas with weak test coverage and meaningful business risk:
1. ConcurrentQueue (no unit tests, multi-threaded, silent deadlock risk)
2. parse_tuning_db_line / read_tuning_db key schema change (no Python tests)
3. BooleanElementwiseConverter missing f16/unsigned dtype coverage
4. Attention MaxNumFOp vs MaximumFOp NaN correctness (no dedicated test)
5. firstCausalMaskIter off-by-one risk (no non-trivial shape test)
6. Sliding window attention edge cases (windowSize=0/>=seqLen/unaligned)

The GitHub discussion API returned FORBIDDEN (read-only CI token);
analysis committed here as a permanent record.

Co-authored-by: Djordje Antic <djordje.antic@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants