Skip to content

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

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

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

Conversation

@jessicapriebe

Copy link
Copy Markdown
Contributor

No description provided.

@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.92%. Comparing base (4ebbdae) to head (9b3140c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@              Coverage Diff              @@
##               main    #2619       +/-   ##
=============================================
+ Coverage     71.41%   74.92%    +3.50%     
=============================================
  Files          1642      436     -1206     
  Lines        197165    25237   -171928     
  Branches      38306        0    -38306     
=============================================
- Hits         140815    18909   -121906     
+ Misses        45279     6328    -38951     
+ Partials      11071        0    -11071     
Flag Coverage Δ
java ?
python 74.92% <ø> (?)

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 on lines +180 to +213
try(ReservationBudget budget = AllocatedOOCStream.detachBudget(callback)) {
if(budget == null)
throw new DMLRuntimeException("Missing admitted output budget");

IndexedMatrixValue imv = callback.get();
MatrixBlock blk = (MatrixBlock) imv.getValue();
long r = imv.getIndexes().getRowIndex();
long c = imv.getIndexes().getColumnIndex();
long rIdx;
long cIdx;

int n = _byRow ? blk.getNumRows() : blk.getNumColumns();
for(int i = 0; i < n; i++) {
MatrixBlock slice;
if(_byRow) {
slice = blk.slice(i, i);
rIdx = (r - 1) * _blen + i + 1;
cIdx = c;
}
else {
slice = blk.slice(0, blk.getNumRows() - 1, i, i);
cIdx = (c - 1) * _blen + i + 1;
rIdx = r;
}

long targetIdx = _byRow ? (rIdx - 1) * numColBlocks + c - 1 : (cIdx - 1) * numRowBlocks + r - 1;
IndexedMatrixValue sliceImv = new IndexedMatrixValue(new MatrixIndexes(rIdx, cIdx), slice);
budget.reserveBlocking(singleSliceBytes);
table.put((int) targetIdx, new ManagedPayload<>(sliceImv, singleSliceBytes, budget));
}
}
catch(IllegalStateException e) {
throw new DMLRuntimeException(e);
}

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.

I would suggest to try to move these lambda functions out to simplify the methods. Try to reduce them to 10-20 lines max per function.

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.

2 participants