Skip to content

Add layout algebra inference diagnostics#648

Draft
jhinpan wants to merge 3 commits into
ROCm:mainfrom
jhinpan:fix-issue-583-layout-verifiers
Draft

Add layout algebra inference diagnostics#648
jhinpan wants to merge 3 commits into
ROCm:mainfrom
jhinpan:fix-issue-583-layout-verifiers

Conversation

@jhinpan
Copy link
Copy Markdown
Contributor

@jhinpan jhinpan commented Jun 3, 2026

Refs #583

Summary

  • Reject fly.make_layout when the shape and stride profiles are not congruent.
  • Preflight fly.composition with a layout RHS so invalid static composition reports an MLIR diagnostic instead of tripping the LayoutUtils assert.
  • Reject fly.logical_divide with a layout divisor when both sizes are static and the divisor size does not divide the layout size.
  • Add -verify-diagnostics coverage for these invalid layout algebra cases.

Scope

This is intentionally a small first pass. Dynamic divisibility is still deferred, and tile operands currently get profile checks rather than full admissibility checking.

Tests

  • cmake --build /sgl-workspace/FlyDSL-issue583/build-fly --target fly-opt -j$(nproc)
  • /sgl-workspace/FlyDSL-issue583/build-fly/bin/fly-opt tests/mlir/LayoutAlgebra/invalid.mlir -verify-diagnostics
  • Full tests/mlir/**/*.mlir RUN-line/FileCheck sweep with /sgl-workspace/FlyDSL-issue583/build-fly/bin/fly-opt

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.

1 participant