Preserve dynamic expressions across MLIR XLA boundaries - #37
Draft
stevenvar wants to merge 16 commits into
Draft
Conversation
stevenvar
force-pushed
the
steven.shared-dynamic-expression-representation
branch
from
August 5, 2026 14:06
a59545d to
6825185
Compare
stevenvar
force-pushed
the
steven.mlir-dynamic-expression-boundaries
branch
4 times, most recently
from
August 5, 2026 15:23
6bf1bcf to
2fba66f
Compare
stevenvar
force-pushed
the
steven.mlir-dynamic-expression-boundaries
branch
9 times, most recently
from
August 6, 2026 09:55
aca1965 to
6dfb7d6
Compare
stevenvar
force-pushed
the
steven.shared-dynamic-expression-representation
branch
2 times, most recently
from
August 10, 2026 11:38
b75efc6 to
91433d1
Compare
Co-authored-by: fengxiao-cui <cuixiaofeng1@huawei.com>
stevenvar
force-pushed
the
steven.shared-dynamic-expression-representation
branch
from
August 13, 2026 15:34
91433d1 to
a5c0f05
Compare
stevenvar
force-pushed
the
steven.shared-dynamic-expression-representation
branch
2 times, most recently
from
August 13, 2026 16:09
c105d71 to
ec896b5
Compare
stevenvar
force-pushed
the
steven.shared-dynamic-expression-representation
branch
from
August 14, 2026 08:59
ec896b5 to
9fde631
Compare
stevenvar
force-pushed
the
steven.mlir-dynamic-expression-boundaries
branch
from
August 14, 2026 10:57
6dfb7d6 to
be7c1cf
Compare
stevenvar
changed the base branch from
steven.shared-dynamic-expression-representation
to
for-serving-2.20
August 14, 2026 10:58
stevenvar
force-pushed
the
for-serving-2.20
branch
3 times, most recently
from
August 17, 2026 09:25
0846466 to
635bc63
Compare
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.
Summary
This PR allows MLIR-only TensorFlow kernels to remain in XLA clusters when their inputs carry dynamic shape expressions.
Before entering the MLIR bridge, TensorFlow shape inference records the logical output expressions. The XLA inputs and argument descriptions are then replaced with expression-free views that keep the same physical dimensions. MLIR therefore lowers an ordinary statically shaped region. When its results return to XLA, the recorded output expressions are restored at the boundary.
Why
The previous behavior rejected every MLIR-only kernel with a dynamic input expression. Passing the expressions through MLIR itself would require broad changes to MLIR and to individual HLO inference rules.
Keeping expressions at the boundary avoids that duplication. It also leaves standard XLA dynamic dimensions disabled and does not introduce
SetDimensionSize.Design notes
Tests
ReluGradop with two[8<A>, 4]inputs.[8<A>, 4].SetDimensionSizeinstruction.