Skip to content

[XLA] Preserve feed tensor shapes on graph arguments - #60

Open
stevenvar wants to merge 1 commit into
for-serving-2.20from
steven.preserve-feed-output-shapes
Open

[XLA] Preserve feed tensor shapes on graph arguments#60
stevenvar wants to merge 1 commit into
for-serving-2.20from
steven.preserve-feed-output-shapes

Conversation

@stevenvar

@stevenvar stevenvar commented Sep 8, 2026

Copy link
Copy Markdown
Owner

When a feed tensor is replaced by an _Arg node, losing its shape can leave GraphProperties with incorrect rank information and change XLA clustering. A feed shaped [-1, 224, 224, 3] should keep that shape on the replacement argument.

This change copies the shape of the selected output to its replacement _Arg, using a placeholder's shape attribute when _output_shapes is unavailable. If no shape is available, GraphProperties keeps the rank unknown instead of inventing a rank-one shape.

Tests

SubgraphTest.FedPlaceholderPreservesShape_FunctionConvention checks that replacing a placeholder with an _Arg preserves all four dimensions of [-1, 224, 224, 3].

Copy the selected feed tensor shape to replacement _Arg nodes and avoid inventing rank-one shapes when argument metadata is unavailable.
@stevenvar
stevenvar force-pushed the steven.preserve-feed-output-shapes branch from 175903e to df4dab8 Compare September 8, 2026 15:45
@stevenvar stevenvar changed the title [XLA] Execute bounded dynamic CPU kernels over logical shapes [XLA] Preserve feed tensor shapes on graph arguments Sep 8, 2026
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