Conversation
There was a problem hiding this comment.
Pull request overview
Updates MIGraphX’s rocMLIR integration to use the new rock.-prefixed function attributes expected by rocMLIR, and aligns tests/docs with the updated MLIR printing.
Changes:
- Switch MLIR
func.funcattributes fromarch/kernel/num_*torock.arch/rock.kernel/rock.num_*(androck.enable_splitk_for_tuning). - Update GPU MLIR dump tests to expect the new attribute names.
- Refresh rocMLIR triage documentation snippets to show the new attribute names.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/targets/gpu/mlir.cpp |
Emits rock.* attributes on generated func.func ops (including SplitK unit attr). |
test/gpu/mlir.cpp |
Updates expected MLIR attribute dictionaries to match rock.* naming. |
docs/dev/triage-rocmlir.rst |
Updates example MLIR module snippets to use rock.* attribute names. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| module { | ||
| func.func @mlir_convolution(%arg0: !migraphx.shaped<2x8x3x3xf32, 72x9x3x1>, %arg1: !migraphx.shaped<1x8x4x4xf32, 128x16x4x1>) -> !migraphx.shaped<1x2x2x2xf32, 8x4x2x1> attributes {arch = "gfx90a:sramecc+:xnack-", enable_splitk_for_tuning = true, kernel = "mixr", num_cu = 110 : i64} { | ||
| func.func @mlir_convolution(%arg0: !migraphx.shaped<2x8x3x3xf32, 72x9x3x1>, %arg1: !migraphx.shaped<1x8x4x4xf32, 128x16x4x1>) -> !migraphx.shaped<1x2x2x2xf32, 8x4x2x1> attributes {rock.arch = "gfx90a:sramecc+:xnack-", rock.enable_splitk_for_tuning = true, rock.kernel = "mixr", rock.num_cu = 110 : i64, rock.num_chiplets = 1 : i64} { |
There was a problem hiding this comment.
The example shows rock.enable_splitk_for_tuning = true, but MIGraphX emits this as a unit attribute (see mlirUnitAttrGet(...) usage in src/targets/gpu/mlir.cpp), which prints as just rock.enable_splitk_for_tuning (no = true) in MLIR assembly. Update the snippet to match the actual printed MLIR so users can copy/paste it reliably during triage.
| func.func @mlir_convolution(%arg0: !migraphx.shaped<2x8x3x3xf32, 72x9x3x1>, %arg1: !migraphx.shaped<1x8x4x4xf32, 128x16x4x1>) -> !migraphx.shaped<1x2x2x2xf32, 8x4x2x1> attributes {rock.arch = "gfx90a:sramecc+:xnack-", rock.enable_splitk_for_tuning = true, rock.kernel = "mixr", rock.num_cu = 110 : i64, rock.num_chiplets = 1 : i64} { | |
| func.func @mlir_convolution(%arg0: !migraphx.shaped<2x8x3x3xf32, 72x9x3x1>, %arg1: !migraphx.shaped<1x8x4x4xf32, 128x16x4x1>) -> !migraphx.shaped<1x2x2x2xf32, 8x4x2x1> attributes {rock.arch = "gfx90a:sramecc+:xnack-", rock.enable_splitk_for_tuning, rock.kernel = "mixr", rock.num_cu = 110 : i64, rock.num_chiplets = 1 : i64} { |
|
|
||
| module { | ||
| func.func @mlir_dot_add(%arg0: !migraphx.shaped<1x5x4xf32, 20x4x1>, %arg1: !migraphx.shaped<1x4x3xf32, 12x3x1>, %arg2: !migraphx.shaped<1x5x3xf32, 15x3x1>) -> !migraphx.shaped<1x5x3xf32, 15x3x1> attributes {arch = "gfx90a:sramecc+:xnack-", enable_splitk_for_tuning = true, kernel = "mixr", num_cu = 110 : i64} { | ||
| func.func @mlir_dot_add(%arg0: !migraphx.shaped<1x5x4xf32, 20x4x1>, %arg1: !migraphx.shaped<1x4x3xf32, 12x3x1>, %arg2: !migraphx.shaped<1x5x3xf32, 15x3x1>) -> !migraphx.shaped<1x5x3xf32, 15x3x1> attributes {rock.arch = "gfx90a:sramecc+:xnack-", rock.enable_splitk_for_tuning = true, rock.kernel = "mixr", rock.num_cu = 110 : i64, rock.num_chiplets = 1 : i64} { |
There was a problem hiding this comment.
Same as above: rock.enable_splitk_for_tuning should be shown as a unit attribute (no = true) to match MIGraphX’s emitted/printed MLIR and avoid confusing copy/paste during triage.
| func.func @mlir_dot_add(%arg0: !migraphx.shaped<1x5x4xf32, 20x4x1>, %arg1: !migraphx.shaped<1x4x3xf32, 12x3x1>, %arg2: !migraphx.shaped<1x5x3xf32, 15x3x1>) -> !migraphx.shaped<1x5x3xf32, 15x3x1> attributes {rock.arch = "gfx90a:sramecc+:xnack-", rock.enable_splitk_for_tuning = true, rock.kernel = "mixr", rock.num_cu = 110 : i64, rock.num_chiplets = 1 : i64} { | |
| func.func @mlir_dot_add(%arg0: !migraphx.shaped<1x5x4xf32, 20x4x1>, %arg1: !migraphx.shaped<1x4x3xf32, 12x3x1>, %arg2: !migraphx.shaped<1x5x3xf32, 15x3x1>) -> !migraphx.shaped<1x5x3xf32, 15x3x1> attributes {rock.arch = "gfx90a:sramecc+:xnack-", rock.enable_splitk_for_tuning, rock.kernel = "mixr", rock.num_cu = 110 : i64, rock.num_chiplets = 1 : i64} { |
|
you would need to bump rocMLIR SHA too |
bdevorem
left a comment
There was a problem hiding this comment.
assuming the rocmlir hash gets updated after that PR is merged, lgtm
Motivation
rocMLIR is going to use
rock.prefix for attributes (ROCm/rocMLIR#2334), just updating them on MIGraphX side as well.We probably want to sync this PR merge with rocMLIR PR. And bump rocMLIR commit hash.
Technical Details
get_attrs()with prefix as wellChangelog Category
Add a
CHANGELOG.mdentry for any option other thanNot Applicable