Skip to content

[Fix][Relax][Torch] Preserve derived exported input dimensions - #20128

Open
akaashrp wants to merge 1 commit into
apache:mainfrom
akaashrp:upstream/torch-derived-input-shapes
Open

[Fix][Relax][Torch] Preserve derived exported input dimensions#20128
akaashrp wants to merge 1 commit into
apache:mainfrom
akaashrp:upstream/torch-derived-input-shapes

Conversation

@akaashrp

Copy link
Copy Markdown
Contributor

PyTorch exported programs may describe input dimensions using expressions derived from other symbolic dimensions, such as 2 * n. The importer previously recognized these expressions but replaced them with independent TIR variables when constructing the Relax function signature. This discarded the relationship between the dimensions.

This PR:

  • Preserves derived TIR expressions when constructing input tensor shapes
  • Records range constraints only for direct symbolic variables
  • Accepts input shape and dtype metadata from either tensor_meta or placeholder value metadata
  • Reports an explicit error when input shape or dtype metadata is unavailable

@akaashrp
akaashrp requested a review from tlopex August 13, 2026 19:01
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.

2 participants