You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
inner_tiled op needs explicit semantics and a strict verifier #22336
The inner_tiled op rides successive lowerings. Some of these are semantically straightforward, e.g. bufferization. But some other lowerings cause nontrivial changes to its semantics and the shapes of its operands:
ExpandUndistributedInnerTilesPass expands the 2D tiles into higher-dimensional tiles with expand_shape and transpose ("swizzle").
DistributeInnerTiledToLanesPass changes from workgroup to thread semantics, slicing the tiles.
This means we have 3 different "semantics" for this op:
Not yet expanded or distributed.
Expanded but not yet distributed.
Distributed to threads.
This is currently implied by the shapes of operands.
The verifier, accordingly, is very lax: it only requires the tiles element counts to match.
As a result, the verifier has false negatives and confusing diagnostics.
The false negatives are concerning because the ill-formed IR that is allowed past the verifier is known to cause assertion failures (in assert-enabled build) and out-of-bounds accesses (when asserts are disabled) in the compiler, see #22284 (comment) . That is why this Issue is tagged 'Bug' not just 'Enhancement'.
Instead, inner_tiled should have an additional attribute parameter selecting its semantics among the above 3. The verifier should then strictly enforce the specified semantics.
I am not sure using an attribute to distinguish between the three different use cases, if they are really three different semantics, makes sense. If we need to distinguish between the different "phases" the same operation is used, we need to just add different operations. But also, not everything can be caught in the verifier. Some will have to be caught in pipeline/e2e tests.
@MaheshRavishankar , the PR under review (link above this comment) ends up adding not one enum attr, but two separate orthogonal bool attrs. It merely straightens up a preexisting loose ops. I think it's a step in the right direction even if one would prefer separate ops as the destination. Continue discussion there!
Activity
MaheshRavishankar commentedon Oct 19, 2025
I am not sure using an attribute to distinguish between the three different use cases, if they are really three different semantics, makes sense. If we need to distinguish between the different "phases" the same operation is used, we need to just add different operations. But also, not everything can be caught in the verifier. Some will have to be caught in pipeline/e2e tests.
bjacob commentedon Oct 21, 2025
@MaheshRavishankar , the PR under review (link above this comment) ends up adding not one enum attr, but two separate orthogonal bool attrs. It merely straightens up a preexisting loose ops. I think it's a step in the right direction even if one would prefer separate ops as the destination. Continue discussion there!
Give `inner_tiled` a strict verifier and explicit semantics with bool…
Give `inner_tiled` a strict verifier and explicit semantics with bool…
Give `inner_tiled` a strict verifier and explicit semantics with bool…
Give `inner_tiled` a strict verifier and explicit semantics with bool…