Preserve folded dynamic-shape metadata through constant folding - #95
Draft
stevenvar wants to merge 3 commits into
Draft
Preserve folded dynamic-shape metadata through constant folding#95stevenvar wants to merge 3 commits into
stevenvar wants to merge 3 commits into
Conversation
stevenvar
marked this pull request as draft
April 16, 2026 17:25
stevenvar
force-pushed
the
steven.dynamic_ancestor_metadata
branch
from
April 18, 2026 14:08
f2f528a to
e7d8f13
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.
This is an experimental follow-up to symbolic content propagation that teaches TensorFlow constant folding to preserve dynamic-shape provenance on folded constants by walking backward through their ancestor graph.
Today, when a value is constant-folded into a
Const, we can lose the information that it originally came from a dynamic shape computation. This branch adds a recursive ancestor walk in constant folding so that if a folded value ultimately descends from aShape/_xla_shape_derivedpath tied to an_Argwith dynamic dim expressions, we keep that inferred shape metadata on the replacementConst.In short:
This branch was split out as a separate experiment because it broadens provenance recovery beyond the direct-source behavior used in the main contents-propagation work.