Skip to content

[SYSTEMDS-3961] Add Sparsity-based Recompiler Class 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 Class 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 replicates 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).
NOTE: Currently, the sparsity-based recompiler performs identical rewrites as RewriteMatrixMultChainOptimizationSparse.java. It will be extended in the future.

All the best,
David

@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.30%. Comparing base (0a245ab) to head (aec19ba).
⚠️ Report is 2 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.39%   71.30%   -0.10%     
+ Complexity    50539    50519      -20     
============================================
  Files          1632     1633       +1     
  Lines        196237   196412     +175     
  Branches      38201    38240      +39     
============================================
- Hits         140113   140061      -52     
- Misses        45099    45317     +218     
- Partials      11025    11034       +9     

☔ 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?

@ywcb00 ywcb00 changed the title [SYSTEMDS-3961] Add Sparsity-based Recompiler to Recompilation Routine [SYSTEMDS-3961] Add Sparsity-based Recompiler Class to Recompilation Routine Aug 27, 2026
ywcb00 added 6 commits August 27, 2026 09:30
…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
@ywcb00
ywcb00 force-pushed the feat/recompile/sparsityrewrite branch from 5e69f91 to aec19ba Compare August 27, 2026 07:30
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