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

Deforestation pass #1134

Open
ordinarymath opened this issue Feb 5, 2025 · 1 comment
Open

Deforestation pass #1134

ordinarymath opened this issue Feb 5, 2025 · 1 comment
Labels
medium effort medium reward Easy to measure but may not be noticed by itself performance Runtime of a plausible real cakeml-generated binary

Comments

@ordinarymath
Copy link
Contributor

CakeML currently does not have a deforestation pass. We would probably improve on benchmarks once this is implemented.

@ordinarymath ordinarymath added medium effort medium reward Easy to measure but may not be noticed by itself performance Runtime of a plausible real cakeml-generated binary labels Feb 5, 2025
@ordinarymath
Copy link
Contributor Author

ordinarymath commented Feb 5, 2025

For implementation I'm considering

  1. Add primrec combinators as a primitive operation.
  2. Add a pass which detects primrec functions and rewrites them to use the combinators.
  3. Implement a simplication pass that merges combinators.
  4. Implement a pass that removes the combinators.
    This is essentially shortcut deforestation + warm fusion.
    https://dl.acm.org/doi/pdf/10.1145/224164.224223
    This would remove the difficulty with doing higher order inlining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium effort medium reward Easy to measure but may not be noticed by itself performance Runtime of a plausible real cakeml-generated binary
Projects
None yet
Development

No branches or pull requests

1 participant