Skip to content

Conversation

@Lunderberg
Copy link
Contributor

This PR introduces a new transform, which attempts to reduce branching by adding overcompute, where the overcompute has provably no effect on any observable value outside the PrimFunc.

@tvm-bot
Copy link
Collaborator

tvm-bot commented Nov 4, 2022

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@Lunderberg Lunderberg force-pushed the dataflow_reduce_branching branch from af7d704 to 2322fea Compare November 16, 2022 15:10
This PR introduces a new transform, which attempts to reduce branching
by adding overcompute, where the overcompute has provably no effect on
any observable value outside the PrimFunc.
@Lunderberg Lunderberg force-pushed the dataflow_reduce_branching branch from 2322fea to 6049696 Compare November 28, 2022 14:28
@Lunderberg Lunderberg marked this pull request as ready for review November 28, 2022 14:28
These extensions aren't necessary for default operation, and would
frequently be done in earlier simplification steps.
@Lunderberg
Copy link
Contributor Author

@csullivan This PR is ready for review and passing all unit tests, if you have a chance to review.

Copy link
Contributor

@csullivan csullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one small removal and this looks good to go.

@csullivan
Copy link
Contributor

@tvm-bot rerun

@Lunderberg Lunderberg merged commit a923ed3 into apache:main Dec 2, 2022
@Lunderberg Lunderberg deleted the dataflow_reduce_branching branch December 2, 2022 15:01
@LeiWang1999
Copy link
Contributor

hi @Lunderberg , did we implement Stmt Simplify(Stmt stmt, arith::Analyzer* analyzer);?

@Lunderberg
Copy link
Contributor Author

Lunderberg commented Feb 13, 2024

@LeiWang1999 We did, yes. It's located here. Edit: Disregard that. You are right in your comment on #16560, there wasn't actually an implementation added for the prototype of Stmt Simplify.

That said, in most cases it's better to apply tir::transform::Simplify instead. That way, the full context is available for a single simplification call. Simplifying a statement in isolation may miss context-dependent simplifications. (e.g. Within an if i==0 block, if i + 1 < 16 could be simplified to to True.)

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.

4 participants