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
@akaashrp

Copy link
Copy Markdown
Contributor Author

@tvm-bot rerun

@github-actions

Copy link
Copy Markdown
Contributor

Failed to re-run CI in https://github.com/apache/tvm/actions/runs/31856248731

Details
Traceback (most recent call last):
  File "/home/runner/work/tvm/tvm/ci/scripts/github/github_tvmbot.py", line 588, in comment_failure
    raise item
  File "/home/runner/work/tvm/tvm/ci/scripts/github/github_tvmbot.py", line 694, in run
    pr.rerun_jenkins_ci()
  File "/home/runner/work/tvm/tvm/ci/scripts/github/github_tvmbot.py", line 547, in rerun_jenkins_ci
    post(url, auth=("tvm-bot", TVM_BOT_JENKINS_TOKEN))
  File "/home/runner/work/tvm/tvm/ci/scripts/jenkins/git_utils.py", line 54, in post
    with request.urlopen(req, data) as response:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 215, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 521, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 630, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 559, in error
    return self._call_chain(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 639, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 504: Gateway Time-out

with response

<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
</body>
</html>

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