Skip to content

[AIROCMLIR-446] Lower migraphx.relu into linalg.max ins (0, x)#2231

Open
Mr-Anyone wants to merge 4 commits intopr-template-migraphx-to-linalg-3from
pr-template-migraphx-to-linalg-4
Open

[AIROCMLIR-446] Lower migraphx.relu into linalg.max ins (0, x)#2231
Mr-Anyone wants to merge 4 commits intopr-template-migraphx-to-linalg-3from
pr-template-migraphx-to-linalg-4

Conversation

@Mr-Anyone
Copy link
Member

Motivation

Being able to lower migraphx.relu into linalg.

Technical Details

This change lowers migraphx.relu by expressing it as a linalg operation that computes the elementwise maximum between the input tensor and zero, using standard linalg primitiv

Test Plan

Added a new lit test to verify correct lowering of migraphx.relu into linalg.

Test Result

All added and existing lit tests pass.

Submission Checklist

@Mr-Anyone Mr-Anyone requested a review from causten as a code owner February 5, 2026 20:21
@Mr-Anyone Mr-Anyone force-pushed the pr-template-migraphx-to-linalg-4 branch from 6873508 to c03e94c Compare February 5, 2026 20:27
@Mr-Anyone Mr-Anyone force-pushed the pr-template-migraphx-to-linalg-3 branch from 69d9574 to a793a6a Compare February 6, 2026 18:40
@Mr-Anyone Mr-Anyone force-pushed the pr-template-migraphx-to-linalg-4 branch from c03e94c to c51ed1b Compare February 6, 2026 18:40
@@ -0,0 +1,14 @@
// RUN: rocmlir-opt -split-input-file --migraphx-to-linalg -verify-diagnostics %s | FileCheck %s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relu is also pointwise. Can you keep test for Relu in same file as elementwise ?

@Mr-Anyone Mr-Anyone force-pushed the pr-template-migraphx-to-linalg-3 branch 2 times, most recently from 727a8fa to 590daf6 Compare February 11, 2026 14:39
@Mr-Anyone Mr-Anyone force-pushed the pr-template-migraphx-to-linalg-4 branch 3 times, most recently from d9857f0 to 880e493 Compare February 11, 2026 15:14
@Mr-Anyone Mr-Anyone force-pushed the pr-template-migraphx-to-linalg-3 branch from 590daf6 to ba9cb63 Compare February 12, 2026 17:27
@Mr-Anyone Mr-Anyone force-pushed the pr-template-migraphx-to-linalg-4 branch from 880e493 to 51c5c87 Compare February 12, 2026 19:16
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