[SYSTEMML-2060] Fix compressed unary aggregates w/ UC groups This patch fixes result correctness issues of compressed unary aggregates over compressed matrices with UC (uncompressed) groups. Instead of calling unary aggregates directly on the block of uncompressed data, we now properly call the UC group operation which also shifts the results into the correct column indexes on column aggregates such as colSums, colMax, etc.
Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/7987caa6 Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/7987caa6 Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/7987caa6 Branch: refs/heads/master Commit: 7987caa6b6fe47c9a184449ec8600a82a9bd9bf4 Parents: 0a262dc Author: Matthias Boehm <[email protected]> Authored: Sun Jan 7 15:03:22 2018 -0800 Committer: Matthias Boehm <[email protected]> Committed: Sun Jan 7 15:04:41 2018 -0800 ---------------------------------------------------------------------- .../org/apache/sysml/runtime/compress/CompressedMatrixBlock.java | 2 +- .../functions/compress/LargeParUnaryAggregateTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/7987caa6/src/main/java/org/apache/sysml/runtime/compress/CompressedMatrixBlock.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/compress/CompressedMatrixBlock.java b/src/main/java/org/apache/sysml/runtime/compress/CompressedMatrixBlock.java index e5edada..11d2602 100644 --- a/src/main/java/org/apache/sysml/runtime/compress/CompressedMatrixBlock.java +++ b/src/main/java/org/apache/sysml/runtime/compress/CompressedMatrixBlock.java @@ -1202,7 +1202,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable try { //compute uncompressed column group in parallel (otherwise bottleneck) if( uc != null ) - ret = (MatrixBlock)uc.getData().aggregateUnaryOperations(op, ret, blockingFactorRow, blockingFactorCol, indexesIn, false); + uc.unaryAggregateOperations(op, ret); //compute all compressed column groups ExecutorService pool = Executors.newFixedThreadPool( op.getNumThreads() ); ArrayList<UnaryAggregateTask> tasks = new ArrayList<>(); http://git-wip-us.apache.org/repos/asf/systemml/blob/7987caa6/src/test/java/org/apache/sysml/test/integration/functions/compress/LargeParUnaryAggregateTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/compress/LargeParUnaryAggregateTest.java b/src/test/java/org/apache/sysml/test/integration/functions/compress/LargeParUnaryAggregateTest.java index c89356c..69f2c57 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/compress/LargeParUnaryAggregateTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/compress/LargeParUnaryAggregateTest.java @@ -1080,7 +1080,7 @@ public class LargeParUnaryAggregateTest extends AutomatedTestBase if( compress ) cmb.compress(); - //matrix-vector uncompressed + //matrix-vector uncompressed MatrixBlock ret1 = (MatrixBlock)mb.aggregateUnaryOperations(auop, new MatrixBlock(), 1000, 1000, null, true); //matrix-vector compressed @@ -1092,7 +1092,7 @@ public class LargeParUnaryAggregateTest extends AutomatedTestBase int dim1 = (aggtype == AggType.ROWSUMS || aggtype == AggType.ROWSUMSSQ || aggtype == AggType.ROWMINS || aggtype == AggType.ROWMINS)?rows:1; int dim2 = (aggtype == AggType.COLSUMS || aggtype == AggType.COLSUMSSQ - || aggtype == AggType.COLMAXS || aggtype == AggType.COLMINS)?cols:1; + || aggtype == AggType.COLMAXS || aggtype == AggType.COLMINS)?cols+1:1; TestUtils.compareMatrices(d1, d2, dim1, dim2, 0.000000001); } catch(Exception ex) {
