Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TVMScript][Bug] Add test case for missing symbolic bounds #16877

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

Lunderberg
Copy link
Contributor

@Lunderberg Lunderberg commented Apr 12, 2024

Because Relax struct inference is performed while the function is being built, all constraints on symbolic variables that are used for simplifications must be provided to the analyzer. This is not currently the case, nor is there a clear way to fix this issue.

This PR adds a failing unit test to document this limitation.

Because Relax struct inference is performed while the function is
being built, all constraints on symbolic variables that are used
for simplifications must be provided to the analyzer.  This is not
currently the case, nor is there a clear way to fix this issue.
@vinx13 vinx13 merged commit 4cb4605 into apache:main Apr 16, 2024
19 of 20 checks passed
@Lunderberg Lunderberg deleted the tvmscript_bug_symbolic_shape_bounds branch April 17, 2024 15:59
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Apr 28, 2024
As reported in apache#16877, shape inference performed during a Relax
transformation may produce different results than shape inference
performed during TVMScript parsing.  While Relax transformations
call `Analyzer::MarkGlobalNonNegValue` for each shape expression, this
is not provided during TVMScript parsing.  As a result, output shapes
that are conditional on the sign of a variable may produce different
results when simplifying.

This commit provides a partial resolution for this issue.  Where prior
to this commit, the TVMScript parser generated a `tir.Var` for each
symbolic variable, the TVMScript parser now provides a `tir.SizeVar`
for symbolic variables that are defined in contexts that require a
non-negative size.
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