http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/java/org/apache/sysml/test/integration/functions/codegen/RowAggTmplTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/codegen/RowAggTmplTest.java b/src/test/java/org/apache/sysml/test/integration/functions/codegen/RowAggTmplTest.java index 65d0de3..064c987 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/codegen/RowAggTmplTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/codegen/RowAggTmplTest.java @@ -39,6 +39,7 @@ public class RowAggTmplTest extends AutomatedTestBase private static final String TEST_NAME2 = "rowAggPattern2"; private static final String TEST_NAME3 = "rowAggPattern3"; private static final String TEST_NAME4 = "rowAggPattern4"; + private static final String TEST_NAME5 = "rowAggPattern5"; private static final String TEST_DIR = "functions/codegen/"; private static final String TEST_CLASS_DIR = TEST_DIR + RowAggTmplTest.class.getSimpleName() + "/"; @@ -54,6 +55,7 @@ public class RowAggTmplTest extends AutomatedTestBase addTestConfiguration( TEST_NAME2, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME2, new String[] { "1" }) ); addTestConfiguration( TEST_NAME3, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME3, new String[] { "2" }) ); addTestConfiguration( TEST_NAME4, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME4, new String[] { "3" }) ); + addTestConfiguration( TEST_NAME5, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME5, new String[] { "4" }) ); } @Test @@ -76,6 +78,11 @@ public class RowAggTmplTest extends AutomatedTestBase testCodegenIntegration( TEST_NAME4, true, ExecType.CP ); } + @Test + public void testCodegenRowAggRewrite5() { + testCodegenIntegration( TEST_NAME5, true, ExecType.CP ); + } + @Test public void testCodegenRowAgg1() { testCodegenIntegration( TEST_NAME1, false, ExecType.CP ); @@ -96,6 +103,10 @@ public class RowAggTmplTest extends AutomatedTestBase testCodegenIntegration( TEST_NAME4, false, ExecType.CP ); } + @Test + public void testCodegenRowAgg5() { + testCodegenIntegration( TEST_NAME5, false, ExecType.CP ); + } private void testCodegenIntegration( String testname, boolean rewrites, ExecType instType ) { @@ -117,7 +128,7 @@ public class RowAggTmplTest extends AutomatedTestBase String HOME = SCRIPT_DIR + TEST_DIR; fullDMLScriptName = HOME + testname + ".dml"; - programArgs = new String[]{"-explain", "runtime", "-stats", "-args", output("S") }; + programArgs = new String[]{"-explain", "-stats", "-args", output("S") }; fullRScriptName = HOME + testname + ".R"; rCmd = getRCmd(inputDir(), expectedDir()); @@ -131,7 +142,8 @@ public class RowAggTmplTest extends AutomatedTestBase HashMap<CellIndex, Double> dmlfile = readDMLMatrixFromHDFS("S"); HashMap<CellIndex, Double> rfile = readRMatrixFromFS("S"); TestUtils.compareMatrices(dmlfile, rfile, eps, "Stat-DML", "Stat-R"); - Assert.assertTrue(heavyHittersContainsSubString("spoof") || heavyHittersContainsSubString("sp_spoof")); + Assert.assertTrue(heavyHittersContainsSubString("spoofRA") + || heavyHittersContainsSubString("sp_spoofRA")); } finally { OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = oldFlag;
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/java/org/apache/sysml/test/integration/functions/codegen/SumProductChainTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/codegen/SumProductChainTest.java b/src/test/java/org/apache/sysml/test/integration/functions/codegen/SumProductChainTest.java index f2e33e4..5355074 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/codegen/SumProductChainTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/codegen/SumProductChainTest.java @@ -141,8 +141,8 @@ public class SumProductChainTest extends AutomatedTestBase HashMap<CellIndex, Double> rfile = readRMatrixFromFS("R"); TestUtils.compareMatrices(dmlfile, rfile, eps, "Stat-DML", "Stat-R"); if( vectors || !sparse ) - Assert.assertTrue(heavyHittersContainsSubString("spoof") - || heavyHittersContainsSubString("sp_spoof")); + Assert.assertTrue(heavyHittersContainsSubString("spoofCell") + || heavyHittersContainsSubString("sp_spoofCell")); } finally { rtplatform = oldPlatform; http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/rowAggPattern5.R ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/rowAggPattern5.R b/src/test/scripts/functions/codegen/rowAggPattern5.R new file mode 100644 index 0000000..1bc72b9 --- /dev/null +++ b/src/test/scripts/functions/codegen/rowAggPattern5.R @@ -0,0 +1,31 @@ +#------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#------------------------------------------------------------- + +args<-commandArgs(TRUE) +options(digits=22) +library("Matrix") + +X = matrix(seq(1,15), 5, 3, byrow=TRUE); +v = seq(1,3); +P = seq(1,5); +S = t(X) %*% ((P * (1-P)) * (X %*% v)); + +writeMM(as(S, "CsparseMatrix"), paste(args[2], "S", sep="")); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/rowAggPattern5.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/rowAggPattern5.dml b/src/test/scripts/functions/codegen/rowAggPattern5.dml new file mode 100644 index 0000000..9a5526e --- /dev/null +++ b/src/test/scripts/functions/codegen/rowAggPattern5.dml @@ -0,0 +1,28 @@ +#------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#------------------------------------------------------------- + +X = matrix(seq(1,15), rows=5, cols=3); +v = seq(1,3); +P = seq(1,5); +S = t(X) %*% ((P * (1-P)) * (X %*% v)); + +write(S,$1) + http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/wdivmm.R ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/wdivmm.R b/src/test/scripts/functions/codegen/wdivmm.R index 37e2d44..f783914 100644 --- a/src/test/scripts/functions/codegen/wdivmm.R +++ b/src/test/scripts/functions/codegen/wdivmm.R @@ -23,9 +23,9 @@ args<-commandArgs(TRUE) options(digits=22) library("Matrix") -X= matrix( 3, 20000,2000) -U= matrix( 4, 20000,10) -V= matrix( 5, 2000,10) +X = matrix( 3, 4000, 2000) +U = matrix( 4, 4000, 10) +V = matrix( 5, 2000, 10) eps = 0.1 S= t(t(U) %*% (X/(U%*%t(V)+eps))); writeMM(as(S, "CsparseMatrix"), paste(args[2], "S", sep="")); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/wdivmm.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/wdivmm.dml b/src/test/scripts/functions/codegen/wdivmm.dml index dc030f4..0a3d324 100644 --- a/src/test/scripts/functions/codegen/wdivmm.dml +++ b/src/test/scripts/functions/codegen/wdivmm.dml @@ -19,9 +19,9 @@ # #------------------------------------------------------------- -X= matrix( 3, rows=20000, cols=2000) -U= matrix( 4, rows=20000, cols=10) -V= matrix( 5, rows=2000, cols=10) +X = matrix( 3, rows=4000, cols=2000) +U = matrix( 4, rows=4000, cols=10) +V = matrix( 5, rows=2000, cols=10) if(1==1){} eps = 0.1 S= t(t(U) %*% (X/(U%*%t(V)+eps))) http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/wdivmmRight.R ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/wdivmmRight.R b/src/test/scripts/functions/codegen/wdivmmRight.R index cc3159a..fd3f233 100644 --- a/src/test/scripts/functions/codegen/wdivmmRight.R +++ b/src/test/scripts/functions/codegen/wdivmmRight.R @@ -23,9 +23,9 @@ args<-commandArgs(TRUE) options(digits=22) library("Matrix") -X= matrix( 3, 2000,2000) -U= matrix( 4, 2000,10) -V= matrix( 5, 2000,10) +X = matrix( 3, 4000, 2000) +U = matrix( 4, 4000, 10) +V = matrix( 5, 2000, 10) eps = 0.1 S= (X/(U%*%t(V)))%*%V writeMM(as(S, "CsparseMatrix"), paste(args[2], "S", sep="")); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/wdivmmRight.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/wdivmmRight.dml b/src/test/scripts/functions/codegen/wdivmmRight.dml index 488d744..97a5baf 100644 --- a/src/test/scripts/functions/codegen/wdivmmRight.dml +++ b/src/test/scripts/functions/codegen/wdivmmRight.dml @@ -19,9 +19,9 @@ # #------------------------------------------------------------- -X= matrix( 3, rows=2000, cols=2000) -U= matrix( 4, rows=2000, cols=10) -V= matrix( 5, rows=2000, cols=10) +X = matrix( 3, rows=4000, cols=2000) +U = matrix( 4, rows=4000, cols=10) +V = matrix( 5, rows=2000, cols=10) if(1==1){} http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/wdivmmRightNotranspose.R ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/wdivmmRightNotranspose.R b/src/test/scripts/functions/codegen/wdivmmRightNotranspose.R index e541154..ae2670c 100644 --- a/src/test/scripts/functions/codegen/wdivmmRightNotranspose.R +++ b/src/test/scripts/functions/codegen/wdivmmRightNotranspose.R @@ -23,9 +23,9 @@ args<-commandArgs(TRUE) options(digits=22) library("Matrix") -X= matrix( c(1,0,1,2,2,0,0,3,3,0,0,4), nrow=4, ncol=3, byrow = TRUE) -U= matrix( c(1,2,3,4,5,6,7,8), nrow=4, ncol=2, byrow = TRUE) -V= matrix( c(9,12,10,13,11,14), nrow=2, ncol=3, byrow = TRUE) +X = matrix( 3, 4000, 2000) +U = matrix( 4, 4000, 10) +V = matrix( 5, 10, 2000) eps = 0.1 S= (X/((U%*%V)+eps))%*%t(V) writeMM(as(S, "CsparseMatrix"), paste(args[2], "S", sep="")); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/wdivmmRightNotranspose.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/wdivmmRightNotranspose.dml b/src/test/scripts/functions/codegen/wdivmmRightNotranspose.dml index 1938832..730e526 100644 --- a/src/test/scripts/functions/codegen/wdivmmRightNotranspose.dml +++ b/src/test/scripts/functions/codegen/wdivmmRightNotranspose.dml @@ -19,9 +19,9 @@ # #------------------------------------------------------------- -X= matrix( "1 0 1 2 2 0 0 3 3 0 0 4", rows=4, cols=3) -U= matrix( "1 2 3 4 5 6 7 8", rows=4, cols=2) -V= matrix( "9 12 10 13 11 14", rows=2, cols=3) +X = matrix( 3, rows=4000, cols=2000) +U = matrix( 4, rows=4000, cols=10) +V = matrix( 5, rows=10, cols=2000) if(1==1){} http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/wdivmmTransposeOut.R ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/wdivmmTransposeOut.R b/src/test/scripts/functions/codegen/wdivmmTransposeOut.R index ba1da27..e5ddc7e 100644 --- a/src/test/scripts/functions/codegen/wdivmmTransposeOut.R +++ b/src/test/scripts/functions/codegen/wdivmmTransposeOut.R @@ -23,9 +23,9 @@ args<-commandArgs(TRUE) options(digits=22) library("Matrix") -X= matrix( c(1,0,1,2,2,0,0,3,3,0,0,4), nrow=4, ncol=3, byrow = TRUE) -U= matrix( c(1,2,3,4,5,6,7,8), nrow=4, ncol=2, byrow = TRUE) -V= matrix( c(9,12,10,13,11,14), nrow=2, ncol=3, byrow = TRUE) +X = matrix( 3, 4000, 2000) +U = matrix( 4, 4000, 10) +V = matrix( 5, 10, 2000) eps = 0.1 S= (t(U) %*% (X/((U%*%V)+eps))); writeMM(as(S, "CsparseMatrix"), paste(args[2], "S", sep="")); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/wdivmmTransposeOut.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/wdivmmTransposeOut.dml b/src/test/scripts/functions/codegen/wdivmmTransposeOut.dml index 519d4bb..2e1f40f 100644 --- a/src/test/scripts/functions/codegen/wdivmmTransposeOut.dml +++ b/src/test/scripts/functions/codegen/wdivmmTransposeOut.dml @@ -19,9 +19,9 @@ # #------------------------------------------------------------- -X= matrix( "1 0 1 2 2 0 0 3 3 0 0 4", rows=4, cols=3) -U= matrix( "1 2 3 4 5 6 7 8", rows=4, cols=2) -V= matrix( "9 12 10 13 11 14", rows=2, cols=3) +X = matrix( 3, rows=4000, cols=2000) +U = matrix( 4, rows=4000, cols=10) +V = matrix( 5, rows=10, cols=2000) if(1==1){} http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/wdivmmbasic.R ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/wdivmmbasic.R b/src/test/scripts/functions/codegen/wdivmmbasic.R index 7343307..a953067 100644 --- a/src/test/scripts/functions/codegen/wdivmmbasic.R +++ b/src/test/scripts/functions/codegen/wdivmmbasic.R @@ -23,9 +23,9 @@ args<-commandArgs(TRUE) options(digits=22) library("Matrix") -X= matrix( c(1,0,1,2,2,0,0,3,3,0,0,4), nrow=4, ncol=3, byrow = TRUE) -U= matrix( c(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8), nrow=4, ncol=2, byrow = TRUE) -V= matrix( c(0.9,0.12,0.10,0.13,0.11,0.14), nrow=3, ncol=2, byrow = TRUE) +X = matrix( 3, 1000, 1500) +U = matrix( 4, 1000, 10) +V = matrix( 5, 1500, 10) eps = 0.1 S= X/((U%*%t(V))+eps); writeMM(as(S, "CsparseMatrix"), paste(args[2], "S", sep="")); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/wdivmmbasic.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/wdivmmbasic.dml b/src/test/scripts/functions/codegen/wdivmmbasic.dml index 0db04cf..dc74699 100644 --- a/src/test/scripts/functions/codegen/wdivmmbasic.dml +++ b/src/test/scripts/functions/codegen/wdivmmbasic.dml @@ -19,9 +19,9 @@ # #------------------------------------------------------------- -X= matrix( "1 0 1 2 2 0 0 3 3 0 0 4", rows=4, cols=3) -U= matrix( "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8", rows=4, cols=2) -V= matrix( "0.9 0.12 0.10 0.13 0.11 0.14", rows=3, cols=2) +X = matrix( 3, rows=1000, cols=1500) +U = matrix( 4, rows=1000, cols=10) +V = matrix( 5, rows=1500, cols=10) if(1==1){} http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/wsigmoid.R ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/wsigmoid.R b/src/test/scripts/functions/codegen/wsigmoid.R index 68ef61b..dd9090d 100644 --- a/src/test/scripts/functions/codegen/wsigmoid.R +++ b/src/test/scripts/functions/codegen/wsigmoid.R @@ -24,9 +24,9 @@ args<-commandArgs(TRUE) options(digits=22) library("Matrix") -X= matrix( c(1,0,1,2,2,0,0,3,3,0,0,4), nrow=4, ncol=3, byrow = TRUE) -U= matrix( c(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8), nrow=4, ncol=2, byrow = TRUE) -V= matrix( c(0.9,0.12,0.10,0.13,0.11,0.14), nrow=3, ncol=2, byrow = TRUE) +X = matrix( 3, 1000, 2000) +U = matrix( 4, 1000, 10) +V = matrix( 5, 2000, 10) eps = 0.1 S= X*(1/(1+exp(-(U%*%t(V))))); writeMM(as(S, "CsparseMatrix"), paste(args[2], "S", sep="")); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/c5eddccf/src/test/scripts/functions/codegen/wsigmoid.dml ---------------------------------------------------------------------- diff --git a/src/test/scripts/functions/codegen/wsigmoid.dml b/src/test/scripts/functions/codegen/wsigmoid.dml index 78ed611..3841c3b 100644 --- a/src/test/scripts/functions/codegen/wsigmoid.dml +++ b/src/test/scripts/functions/codegen/wsigmoid.dml @@ -19,9 +19,9 @@ # #------------------------------------------------------------- -X= matrix( "1 0 1 2 2 0 0 3 3 0 0 4", rows=4, cols=3) -U= matrix( "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8", rows=4, cols=2) -V= matrix( "0.9 0.12 0.10 0.13 0.11 0.14", rows=3, cols=2) +X = matrix( 3, rows=1000, cols=2000) +U = matrix( 4, rows=1000, cols=10) +V = matrix( 5, rows=2000, cols=10) if(1==1){}
