Skip to content

[SYSTEMDS-3961] Add Sparsity-based Recompiler to Recompilation Routine - #2596

Open
ywcb00 wants to merge 6 commits into
apache:mainfrom
ywcb00:feat/recompile/sparsityrewrite
Open

[SYSTEMDS-3961] Add Sparsity-based Recompiler to Recompilation Routine#2596
ywcb00 wants to merge 6 commits into
apache:mainfrom
ywcb00:feat/recompile/sparsityrewrite

Conversation

@ywcb00

@ywcb00 ywcb00 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

This PR introduces the sparsity-based recompiler which replicated the sparsity-based rewrites at the moment. It is planned to extend this recompiler to retrieve additional data properties and to restructure of the entire computation graph.
The new sparsity-based recompiler is integrated in the recompilation procedure with a configuration to enable/disable it (disabled by default).
All the best,
David

ywcb00 added 4 commits August 25, 2026 10:11
…r sparsity-based recompilation

	NOTE: not implemented yet

feat(main/conf/DMLConfig.java): add xml configuration option for enabling sparsity recompilation

refactor(main/conf/DMLConfig.java): rename xml configuration options for sparsity rewrites

feat(main/hops/recompile/Recompiler.java): add recompile block for sparsity-based recompilation

feat(main/hops/rewrite/RewriteMatrixMultChainOptimizationSparse.java): add comment and log output to indicate the case which requires pre-fetching from the sparsity recompiler
…ity-based rewriter

	copy the dynamic programming approach from the sparsity rewriter

feat(main/hops/rewrite/RewriteMatrixMultChainOptimizationSparse.java): set dynamic recompilation flag if dimensions of hop are known but the sparsity is not
	NOTE: in these cases, the sparsity can be obtained during sparsity-based recompilation by pre-fetching data from disk or eagerly computing partial results
…variable for the execution context which will be needed once we perform partial computations

chore(main/hops/recompile/Recompiler.java): pass the execution context to the sparsity-based recompiler
…rmation with the dimensions of hops inside a matrix multiplication chain

	create logger with the class name
	indicate that function is copied from a different class in the funcation header

chore(main/hops/rewrite/RewriteMatrixMultChainOptimizationSparse.java): remove unused import
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 2.79330% with 174 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.32%. Comparing base (7f2ce64) to head (5e69f91).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...he/sysds/hops/recompile/SparsityDAGRecompiler.java 0.00% 169 Missing ⚠️
...rite/RewriteMatrixMultChainOptimizationSparse.java 25.00% 2 Missing and 1 partial ⚠️
...va/org/apache/sysds/hops/recompile/Recompiler.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2596      +/-   ##
============================================
- Coverage     71.38%   71.32%   -0.06%     
+ Complexity    50548    50538      -10     
============================================
  Files          1632     1633       +1     
  Lines        196229   196412     +183     
  Branches      38199    38240      +41     
============================================
+ Hits         140079   140099      +20     
- Misses        45128    45292     +164     
+ Partials      11022    11021       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Baunsgaard Baunsgaard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

only nits

Comment thread src/main/java/org/apache/sysds/conf/DMLConfig.java
Comment thread src/main/java/org/apache/sysds/hops/recompile/Recompiler.java
Comment thread src/main/java/org/apache/sysds/hops/recompile/Recompiler.java
@Baunsgaard

Copy link
Copy Markdown
Contributor

Maybe change the description of the PR, and name, to highlight it is for Rewriting MMChains to start with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants