Skip to content

[Grappler] Preserve symbolic IDs outside dynamic inference - #59

Open
stevenvar wants to merge 1 commit into
for-serving-2.20from
steven.fix-static-grappler-symbolic-shapes
Open

[Grappler] Preserve symbolic IDs outside dynamic inference#59
stevenvar wants to merge 1 commit into
for-serving-2.20from
steven.fix-static-grappler-symbolic-shapes

Conversation

@stevenvar

Copy link
Copy Markdown
Owner

Summary

Keep Grappler's legacy negative symbolic dimension IDs when dynamic value inference is disabled. Dynamic inference continues to use size -1 with expression metadata.

This prevents shape-based arithmetic rewrites from grouping unrelated unknown dimensions. In particular, AddOpsRewrite no longer creates an invalid AddN for broadcast inputs when a model is run with different batch sizes.

Tests

  • GraphPropertiesTest.SymbolicShapes
  • GraphPropertiesTest.SizeContentsPropagateToFillOutput
  • ArithmeticOptimizerTest.AddOpsRewriteAddOpsOfSymbolicallyEqualShape
  • ArithmeticOptimizerTest.AddOpsRewriteMinimizeBCastWithSymbolicShapes
  • ResNet50 static-XLA trace with batch sizes 1,2

Fixes #58

Keep legacy negative symbolic dimension IDs for normal GraphProperties consumers while retaining expression-backed shapes for dynamic value inference.
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.

[XLA][Grappler] AddOpsRewrite creates invalid AddN for varying ResNet50 batch sizes

1 participant