Skip to content

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

3 participants