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

Rewrite Rules Evaluation Project - Merging Relevant Synthesized Rewrite Rules #6174

Merged
merged 9 commits into from
Aug 4, 2021

Conversation

realevanlee
Copy link
Contributor

Conducted experiments to analyze the performance effects of adding 4000+ synthesized rewrite rules to Halide.
Narrowed down the rules to 11 rewrite rules whose associative & commutative variants are added in this PR.
With these rewrite rules, Halide achieves >10% peak memory reductions in 192 cases in apps including camera_pipe, harris, nl_means, and stencil_chain, which is similar to the results (with all 4000+ rules) from this paper - https://dl.acm.org/doi/pdf/10.1145/3428234

@@ -191,6 +210,7 @@ Expr Simplify::visit(const Select *op, ExprInfo *bounds) {
(no_overflow_int(op->type) &&
(rewrite(select(x, y * c0, c1), select(x, y, fold(c1 / c0)) * c0, c1 % c0 == 0) ||
rewrite(select(x, c0, y * c1), select(x, fold(c0 / c1), y) * c1, c0 % c1 == 0) ||
rewrite(select(x, y + c0, c1), select(x, y, fold(c1 - c0)) + c0) ||
Copy link
Member

Choose a reason for hiding this comment

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

This rule is causing the correctness_simplify failures. We should either remove it or possibly add a c1 != 0 predicate.

@rootjalex
Copy link
Member

rootjalex commented Aug 3, 2021

@steven-johnson are the buildbot failures due to an LLVM breakage, or are they due to this PR? I don't see the failure on other PRs so I am assuming the latter, but just wanting to check

@steven-johnson
Copy link
Contributor

@steven-johnson are the buildbot failures due to an LLVM breakage, or are they due to this PR? I don't see the failure on other PRs so I am assuming the latter, but just wanting to check

LLVM breakage. Should be safe to ignore.

@abadams abadams merged commit 2e229f5 into halide:master Aug 4, 2021
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