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 Discovery and Generation Framework #2198

Closed
wants to merge 291 commits into from
Closed

Conversation

Jaybit0
Copy link
Contributor

@Jaybit0 Jaybit0 commented Jan 30, 2025

This PR introduces a rewrite discovery and generation framework that supports offline systematic, random, and data-driven search strategies. Most of the changes do not affect the runtime of SystemDS. In DMLScript, I introduce an interceptor function that the framework requires for rule validation and data retrieval. With the flag -applyGeneratedRewrites, the generated rewrites in GeneratedRewriteClass are applied at runtime. To run the framework, I have provided the class RewriterFramework which can be executed on its own.

I introduce a file called expressions.db that stores all extracted expressions for the data-driven search which causes the license check to fail.

Sorry for the large PR

@mboehm7

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 65.73167% with 2028 lines in your changes missing coverage. Please review.

Project coverage is 71.07%. Comparing base (d0f0837) to head (21758a8).
Report is 127 commits behind head on main.

Files with missing lines Patch % Lines
...ache/sysds/hops/rewriter/RewriterRuntimeUtils.java 26.11% 313 Missing and 52 partials ⚠️
.../apache/sysds/hops/rewriter/RewriterFramework.java 0.00% 235 Missing ⚠️
...s/hops/rewriter/assertions/RewriterAssertions.java 56.66% 149 Missing and 33 partials ⚠️
.../apache/sysds/hops/rewriter/RewriterStatement.java 66.93% 138 Missing and 29 partials ⚠️
...e/sysds/hops/rewriter/codegen/RewriterCodeGen.java 80.78% 73 Missing and 20 partials ⚠️
...pache/sysds/hops/rewriter/RewriterInstruction.java 70.77% 65 Missing and 25 partials ⚠️
...ache/sysds/hops/rewriter/dml/DMLCodeGenerator.java 59.17% 78 Missing and 11 partials ⚠️
...ops/rewriter/estimators/RewriterCostEstimator.java 83.36% 65 Missing and 24 partials ⚠️
.../sysds/hops/rewriter/codegen/CodeGenCondition.java 75.69% 46 Missing and 41 partials ⚠️
...rewrite/RewriteAlgebraicSimplificationDynamic.java 81.68% 3 Missing and 82 partials ⚠️
... and 28 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2198      +/-   ##
============================================
- Coverage     71.12%   71.07%   -0.06%     
- Complexity    43023    46787    +3764     
============================================
  Files          1446     1487      +41     
  Lines        164151   180239   +16088     
  Branches      32001    35140    +3139     
============================================
+ Hits         116759   128102   +11343     
- Misses        38240    42227    +3987     
- Partials       9152     9910     +758     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mboehm7
Copy link
Contributor

mboehm7 commented Feb 3, 2025

Thanks for this great rewrite generation framework @Jaybit0. When rebasing to main in order to play around with this patch, I'm getting merge conflicts though which is no fun with 280+ commits. Could you help rebase this PR or create a new one with all commits squashed to one? In preparation of merging this PR, please also remove the wildcard imports. Thanks.

@Jaybit0
Copy link
Contributor Author

Jaybit0 commented Feb 3, 2025

Okay, I will try to rebase and reopen the PR again. Maybe something went wrong with my previous rebase

@mboehm7
Copy link
Contributor

mboehm7 commented Feb 3, 2025

Thank you very much.

@Jaybit0 Jaybit0 closed this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants