Repository navigation
[DispatchCreation] Propagate tensor encodings outside dispatch regions - #24966
Merged
maxbartel merged 2 commits intoOct 6, 2026
Merged
Conversation
This was referenced Sep 28, 2026
maxbartel
marked this pull request as ready for review
September 28, 2026 17:04
maxbartel
requested review from
AGindinson,
egebeysel,
phemashekar and
ziereis
as code owners
September 28, 2026 17:04
maxbartel
force-pushed
the
users/maxbartel/layout/propagate-tensor-encodings
branch
from
September 29, 2026 08:33
1b8d6bb to
ac661a8
Compare
Base automatically changed from
users/maxbartel/layout/collapse-contraction-dimensions
to
main
October 5, 2026 12:38
maxbartel
force-pushed
the
users/maxbartel/layout/propagate-tensor-encodings
branch
from
October 5, 2026 12:39
ac661a8 to
9b258b1
Compare
jschuhmacher
self-requested a review
October 5, 2026 14:44
phemashekar
reviewed
Oct 6, 2026
phemashekar
left a comment
Contributor
There was a problem hiding this comment.
Thanks Max! Mostly looks good to me, just some nits :)
Encoding propagation is currently tied to dispatch hoisting, which prevents layout assignment from using the same rewrite rules on the surrounding tensor graph. Separate where propagation may happen from the rewrites themselves and add a function pass for propagation outside dispatches. Keep the existing hoisting behavior, and stop at existing dispatches and block boundaries. iree-dispatch-creation-propagate-encodings runs in the dispatch-time data-tiling pipeline and only swaps set_encoding ops with tensor.cast producers, so adding these rewrites to it would change that pipeline. Keep them separate until propagation through generic ops goes through the encoding propagation interfaces. Also stop bubbling set_encoding ops whose encoding is not an EncodingAttr, such as a padding encoding, instead of crashing. Hoisting already reached this within dispatches. No pipeline runs the new pass yet. A follow-up adds it to an experimental route that assigns and materializes data-tiling layouts before dispatch formation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
iree-dispatch-creation-propagate-data-tiling-encodings was hard to tell apart from iree-dispatch-creation-propagate-encodings. Both run outside dispatches; the difference is that the new pass moves encodings through linalg.generic ops, while the existing one only swaps set_encoding ops with tensor.cast producers. Rename it to iree-dispatch-creation-propagate-encodings-through-generic-ops and keep its definition next to the existing pass. Test that propagation does not cross the boundary of an existing dispatch region in either direction, and describe the expectations in terms of dispatch regions rather than early and late placement. Co-Authored-By: Claude Opus 5.5 <[email protected]>
maxbartel
force-pushed
the
users/maxbartel/layout/propagate-tensor-encodings
branch
from
October 6, 2026 14:03
9b258b1 to
229f0a2
Compare
maxbartel
deleted the
users/maxbartel/layout/propagate-tensor-encodings
branch
October 6, 2026 17:52
7 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Encoding propagation is currently tied to dispatch hoisting, which prevents layout assignment from using the same rewrite rules on the surrounding tensor graph.
Separate where propagation may happen from the rewrites themselves, and add the function pass
iree-dispatch-creation-propagate-data-tiling-encodingsfor propagation outside dispatches. Hoisting keeps its existing behavior. The new pass stops at existing dispatches and block boundaries, and constant CSE stays disabled because Flow regions do not materialize constants themselves.iree-dispatch-creation-propagate-encodingsruns in the dispatch-time data-tiling pipeline and only swapsset_encodingwithtensor.castproducers, so adding these rewrites to it would change that pipeline. They stay separate until bubbling through generic ops goes through the encoding propagation interfaces (TODO(RFC: Encoding Propagation Interfaces #20179)).set_encodingops whose encoding is not anEncodingAttr, such as#iree_encoding.padding, instead of crashing.iree-dispatch-creation-hoist-encoding-opscould already hit this within dispatches; both passes have a regression test.No pipeline runs the new pass yet. #24969 adds it to the experimental early data-tiling route.
This is one of five PRs adding an experimental CPU path that materializes data-tiling layouts before dispatch creation, so that
linalg.mmt4dand data-tiled convolutions fuse with their elementwise epilogues and result unpacks.Assisted by AI.