Skip to content

Add support for migraphx.max#2429

Open
pfultz2 wants to merge 1 commit into
developfrom
migraphx-max
Open

Add support for migraphx.max#2429
pfultz2 wants to merge 1 commit into
developfrom
migraphx-max

Conversation

@pfultz2

@pfultz2 pfultz2 commented Jul 13, 2026

Copy link
Copy Markdown

Motivation

The migraphx.max is needed to support leaky relu efficiently.

Technical Details

Test Plan

Test Result

Submission Checklist

@pfultz2 pfultz2 requested a review from causten as a code owner July 13, 2026 21:02
@pfultz2 pfultz2 requested review from pabloantoniom and umangyadav and removed request for causten and umangyadav July 13, 2026 21:02
@umangyadav umangyadav requested a review from Copilot July 13, 2026 22:52
@umangyadav umangyadav added the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jul 13, 2026

@rocmlir-pr-reviewer rocmlir-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: APPROVE -- submitted as COMMENT (automated reviews are advisory)  ·  Findings: 0 (0 Critical, 0 Major, 0 Minor)


Scope

Adds a new migraphx.max elementwise binary op to support efficient leaky relu. The change registers the op in MIGraphX.td (with Commutative), wires up lowerings to linalg.max and tosa.maximum, and adds Lit conversion tests.

Findings

No blocking issues found.

Notes

  • The op definition, both conversion registrations, and the tests all follow the established elementwise-binary-op patterns in each file exactly. Commutative is appropriate for max.
  • Dtype coverage on the TOSA path is good (f32/f16/i32 tests). The Linalg test covers only f32, but that is consistent with the convention used by the other elementwise ops in mixr-to-linalg-ops.mlir, so no gap is introduced.
  • Consider (optional, out of scope) adding a negative/verifier Lit test in a follow-up if migraphx.max should reject mismatched element types, though AllElementTypesMatch on the base class already provides this and mirrors sibling ops that also lack such a test.

CI status

No non-self CI checks are in the fail/cancel buckets. The passing premerge checks (C/C++, Python format/lint) are green; the remaining Jenkins/Build/MIGraphX checks are still pending. The auto-review pipeline's own review check being in-progress is expected and not a CI failure.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new MIGraphX dialect elementwise binary op (migraphx.max) and wires it into existing MIGraphX lowering pipelines so it can be converted to both TOSA and Linalg IR.

Changes:

  • Introduces MIGraphX_MaxOp (migraphx.max) in the MIGraphX dialect TableGen.
  • Adds MIGraphX→TOSA lowering via tosa.maximum.
  • Adds MIGraphX→Linalg lowering via linalg.max and extends conversion tests accordingly.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
mlir/include/mlir/Dialect/MIGraphX/IR/MIGraphX.td Adds MIGraphX_MaxOp as an elementwise binary op (commutative).
mlir/lib/Conversion/MIGraphXToTosa/MIGraphXToTosa.cpp Registers migraphx.max lowering to tosa.maximum.
mlir/lib/Conversion/MIGraphXToLinalg/MIGraphXToLinalg.cpp Registers migraphx.max lowering to linalg.max.
mlir/test/Conversion/MIGraphXToTosa/mixr-to-tosa-ops.mlir Adds FileCheck coverage for max lowering (f32/f16/i32).
mlir/test/Conversion/MIGraphXToLinalg/mixr-to-linalg-ops.mlir Adds FileCheck coverage for max lowering to linalg.max.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rocmlir-pr-reviewer rocmlir-pr-reviewer Bot removed the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jul 13, 2026
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2429      +/-   ##
===========================================
+ Coverage    82.57%   82.92%   +0.35%     
===========================================
  Files          120      120              
  Lines        42852    42830      -22     
  Branches      7110     7106       -4     
===========================================
+ Hits         35381    35514     +133     
+ Misses        4815     4693     -122     
+ Partials      2656     2623      -33     
Flag Coverage Δ
gfx120x 82.81% <100.00%> (+0.29%) ⬆️
gfx950 82.67% <100.00%> (+0.33%) ⬆️
mfma 82.70% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...b/Conversion/MIGraphXToLinalg/MIGraphXToLinalg.cpp 88.81% <100.00%> (+0.01%) ⬆️
...r/lib/Conversion/MIGraphXToTosa/MIGraphXToTosa.cpp 92.93% <100.00%> (+0.01%) ⬆️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pabloantoniom pabloantoniom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the plan for backporting to rocmlirTriton?

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.

4 participants