Skip to content

[SYSTEMDS-3891] Add OOC Reshape Primitive - #2619

Open
jessicapriebe wants to merge 9 commits into
apache:mainfrom
jessicapriebe:ooc/primitives/reshape
Open

jessicapriebe wants to merge 9 commits into
apache:mainfrom
jessicapriebe:ooc/primitives/reshape

Conversation

@jessicapriebe

@jessicapriebe jessicapriebe commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

This adds an OOC reshape primitive that reshapes matrices out-of-core by splitting input blocks into slices and storing them in the cache-owned state table. Output blocks are rebuilt individually or as block rows/columns, depending on the reshape dimensions, and are enqueued as soon as they are completed.

@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.36842% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.13%. Comparing base (4ebbdae) to head (d8da0e9).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
...ds/runtime/ooc/primitives/ReshapeOOCPrimitive.java 87.17% 37 Missing and 23 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2619      +/-   ##
============================================
+ Coverage     71.41%   72.13%   +0.71%     
- Complexity    50721    51130     +409     
============================================
  Files          1642     2097     +455     
  Lines        197165   226729   +29564     
  Branches      38306    38627     +321     
============================================
+ Hits         140815   163556   +22741     
- Misses        45279    51992    +6713     
- Partials      11071    11181     +110     
Flag Coverage Δ
java 71.49% <87.36%> (+0.07%) ⬆️
python 76.68% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Just because i was curious on the OOC operator i took a look. However, it was not super decipherable from the PR for me, so I thought I would leave some hints to clean it up and make it readable.

All just suggestions.

Comment thread src/main/java/org/apache/sysds/runtime/ooc/cache/packed/OOCPackedCache.java Outdated
Comment thread src/main/java/org/apache/sysds/runtime/ooc/primitives/ReshapeOOCPrimitive.java Outdated
Comment thread src/main/java/org/apache/sysds/runtime/ooc/primitives/ReshapeOOCPrimitive.java Outdated
@janniklinde

Copy link
Copy Markdown
Contributor

Thanks for the patch @jessicapriebe! I reviewed the PR and found some issues related to asynchronous execution and error propagation. I opened a PR to (hopefully) address those issues. Since your PR is fairly complex, I leave those proposed changes for you to review :)

Generally, there is some duplicate code for row/col specific handling. Not sure if this can somehow be simplified but just as a side note. Also, indexing is still hard to understand but I'm honestly not sure how to fix this. Maybe by wrapping those computations into more descriptive functions with a block comment?

@jessicapriebe

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback @janniklinde! I included your proposed changes with some minor adjustments. I also cleaned up the indexing and added comments for the more complex parts, while keeping the row/column-specific handling mostly separate for readability.

@janniklinde janniklinde 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.

Thanks for the update @jessicapriebe. I left three more comments where I still have correctness concerns (which I missed before)

Comment thread src/main/java/org/apache/sysds/runtime/ooc/primitives/ReshapeOOCPrimitive.java Outdated

This branch has not been deployed

No deployments
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.

3 participants