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

[Relax] Ignore dynamic parameters in RewriteDataflowReshape #17086

Merged

Conversation

Lunderberg
Copy link
Contributor

The Relax transform RewriteDataflowReshape identifies TIR functions that are equivalent to relax.op.reshape, and replaces them with calls to relax.op.reshape. This is used as a precursor for simplifications that rely on the high-level knowledge that an operator is a reshape, but also require the low-level knowledge of the adjacent TIR PrimFuncs.

Prior to this commit, the RewriteDataflowReshape pass would only recognize static shapes, or dynamic shapes that could be inferred from the shapes of tensor arguments. This commit updates RewriteDataflowReshape to recognize cases where an extra symbolic variable has been provided.

The Relax transform `RewriteDataflowReshape` identifies TIR functions
that are equivalent to `relax.op.reshape`, and replaces them with
calls to `relax.op.reshape`.  This is used as a precursor for
simplifications that rely on the high-level knowledge that an operator
is a reshape, but also require the low-level knowledge of the adjacent
TIR PrimFuncs.

Prior to this commit, the `RewriteDataflowReshape` pass would only
recognize static shapes, or dynamic shapes that could be inferred from
the shapes of tensor arguments.  This commit updates
`RewriteDataflowReshape` to recognize cases where an extra symbolic
variable has been provided.
@masahi
Copy link
Member

masahi commented Jun 12, 2024

cc @MasterJH5574

@MasterJH5574 MasterJH5574 merged commit 0fb5365 into apache:main Jun 13, 2024
19 checks passed
@Lunderberg Lunderberg deleted the relax_rewrite_dataflow_reshape_extra_vars branch June 13, 2024 11:48
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.

None yet

3 participants