Reject invalid pointwise modules - #5144
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an explicit validation step for rocMLIR-generated split pointwise modules on the GPU path, rejecting modules that contain unsupported non-pointwise (notably shape/aliasing) instructions and surfacing a clear error that points at the first offending instruction.
Changes:
- Introduces
migraphx::gpu::validate_pointwise_module(const module&)to detect non-pointwise instructions (other than literals/params/returns) and throw with an actionable error message. - Hooks validation into the MLIR pointwise compilation flow before aliasing shape ops are removed, so invalid split modules fail early with a clear diagnostic.
- Adds GPU tests that verify acceptance of pointwise + literal/param/return modules and rejection of representative shape operations.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/gpu/mlir_pointwise.cpp | Adds GPU-side unit tests covering valid pointwise modules and rejection of shape ops. |
| src/targets/gpu/jit/mlir.cpp | Implements validate_pointwise_module and calls it prior to pointwise module creation/alias cleanup. |
| src/targets/gpu/include/migraphx/gpu/mlir.hpp | Exposes validate_pointwise_module as a GPU public API declaration. |
| CHANGELOG.md | Documents the improved validation/error reporting for invalid split pointwise modules. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Check flagged results 🔆 * No develop baseline was found for this PR's branch point; compared against the latest available develop run instead. |
|
|
@pfultz2 are you able to merge this into develop when all the CI checks finish? It looks like I don't have write access to MIGraphX. |
Motivation
Some rocMLIR tuning configurations require splitting fused convolution/GEMM and pointwise modules. The resulting pointwise partition may contain unsupported shape operations, causing compilation failures.
Technical Details
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot ApplicableFollow the LLVM AI Tool Use Policy for contributions using AI.