[BWARE] Restructure CLALibBinaryCellOp and decompression fallbacks#2519
Open
Baunsgaard wants to merge 4 commits into
Open
[BWARE] Restructure CLALibBinaryCellOp and decompression fallbacks#2519Baunsgaard wants to merge 4 commits into
Baunsgaard wants to merge 4 commits into
Conversation
… ops
Reworks how the compressed library handles binary cell-wise operations,
broadening the set of inputs it can keep compressed and tightening the
"give up and decompress" path so it is consistent across operation
shapes.
- CLALibBinaryCellOp:
- large refactor (~340 lines): split per-operation routing into
smaller dispatch helpers, push compressed/uncompressed decisions
to the call site, and add fallbacks for shapes the compressed
path does not support (SDC + complex shapes, etc.)
- BinaryMatrixMatrixCPInstruction:
- on supported LibCommonsMath ops with compressed inputs, eagerly
decompress so the math library always sees a plain MatrixBlock
- CompressedMatrixBlock:
- centralize getUncompressed(opcode) callers; tighten how
binaryOperationsLeft/Right/InPlace route into the lib
- CompressedMatrixBlockFactory:
- small adjustments to align with the new lib entry points
transposeSelfMatrixMultOperations ignored the block returned by CLALibTSMM.leftMultByTransposeSelf and returned the passed-in out reference instead. The helper allocates (and for empty/null inputs returns a freshly created block) internally, so returning the stale out yielded a 0x0 result for the LEFT case. Return the helper's result directly.
The new sparse-sparse column-vector path in CLALibBinaryCellOp only visits the stored non-zeros of the compressed operand, which produced wrong results for several operation/format combinations exercised by CLALibBinaryCellOpTest: - Gate the sparse-sparse fast path on operator sparse-safety w.r.t. the compressed operand's zeros (isRowSafeLeft/isRowSafeRight on the vector). Non-sparse-safe ops (plus, minus, or, xor, min/max, ...) now fall back to the all-columns sparse path that evaluates every cell. - Index the temporary sparse block by row instead of a dense flat offset in the left path (was (row-rl)*nCol, causing wrong rows / out-of-bounds). - Sort the temporary sparse rows after decompression so values are appended to the output in ascending column order (decompressing multiple column groups can leave unsorted column indices, swapping output columns). Also rename the sparse task helpers from processDense* to processSparse*, replace the DECOMPRESSION_BLEN 16384/2 expression with 8192, and correct the asyncCompressLock comment to describe its actual global scope.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2519 +/- ##
============================================
+ Coverage 71.55% 71.58% +0.02%
- Complexity 49103 49150 +47
============================================
Files 1575 1575
Lines 189784 189896 +112
Branches 37232 37253 +21
============================================
+ Hits 135799 135934 +135
+ Misses 43493 43464 -29
- Partials 10492 10498 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworks how the compressed library handles binary cell-wise operations, broadening the set of inputs it can keep compressed and tightening the "give up and decompress" path so it is consistent across operation shapes.