You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by ni...@apache.org on 2017/10/26 03:30:24 UTC

systemml git commit: [MINOR] Enable single precision GPU tests

Repository: systemml
Updated Branches:
  refs/heads/master d3917effd -> f04067466


[MINOR] Enable single precision GPU tests

Project: http://git-wip-us.apache.org/repos/asf/systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/f0406746
Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/f0406746
Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/f0406746

Branch: refs/heads/master
Commit: f040674661ae818d0379abbcac624a726d3b3e3a
Parents: d3917ef
Author: Niketan Pansare <np...@us.ibm.com>
Authored: Wed Oct 25 20:29:55 2017 -0700
Committer: Niketan Pansare <np...@us.ibm.com>
Committed: Wed Oct 25 20:29:55 2017 -0700

----------------------------------------------------------------------
 src/test/java/org/apache/sysml/test/gpu/GPUTests.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/f0406746/src/test/java/org/apache/sysml/test/gpu/GPUTests.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/sysml/test/gpu/GPUTests.java b/src/test/java/org/apache/sysml/test/gpu/GPUTests.java
index d7d1ad5..a83b110 100644
--- a/src/test/java/org/apache/sysml/test/gpu/GPUTests.java
+++ b/src/test/java/org/apache/sysml/test/gpu/GPUTests.java
@@ -55,7 +55,7 @@ public abstract class GPUTests extends AutomatedTestBase {
 	private static final boolean PRINT_MAT_ERROR = false;
 	
 	// We will use this flag until lower precision is supported on CP. 
-	private final static String DATA_TYPE = "double";  
+	private final static String FLOATING_POINT_PRECISION = "double";  
 	protected final double SINGLE_PRECISION_THRESHOLD = 1e-3;    // for relative error
 	
 	
@@ -75,9 +75,9 @@ public abstract class GPUTests extends AutomatedTestBase {
 	 * @return a valid threshold
 	 */
 	protected double getTHRESHOLD() {
-		if(DATA_TYPE.equals("double"))  return DOUBLE_PRECISION_THRESHOLD;
-		else if(DATA_TYPE.equals("float"))  return SINGLE_PRECISION_THRESHOLD;
-		else throw new RuntimeException("Unsupported datatype:" + DATA_TYPE);
+		if(FLOATING_POINT_PRECISION.equals("double"))  return DOUBLE_PRECISION_THRESHOLD;
+		else if(FLOATING_POINT_PRECISION.equals("single"))  return SINGLE_PRECISION_THRESHOLD;
+		else throw new RuntimeException("Unsupported precision:" + FLOATING_POINT_PRECISION);
 	}
 
 	@After
@@ -263,7 +263,7 @@ public abstract class GPUTests extends AutomatedTestBase {
 						format.format(
 								"Relative error(%f) is more than threshold (%f). Expected = %f, Actual = %f, differed at [%d, %d]",
 								relativeError, getTHRESHOLD(), expectedDouble, actualDouble, i, j);
-						if(DATA_TYPE.equals("double"))
+						if(FLOATING_POINT_PRECISION.equals("double"))
 							Assert.assertTrue(format.toString(), relativeError < getTHRESHOLD());
 						else
 							Assert.assertTrue(format.toString(), relativeError < getTHRESHOLD() || absoluteError < getTHRESHOLD());
@@ -324,7 +324,7 @@ public abstract class GPUTests extends AutomatedTestBase {
 	protected List<Object> runOnGPU(SparkSession spark, String scriptStr, Map<String, Object> inputs,
 			List<String> outStrs) {
 		MLContext gpuMLC = new MLContext(spark);
-		gpuMLC.setConfigProperty("sysml.gpu.dataType", DATA_TYPE);
+		gpuMLC.setConfigProperty("sysml.floating.point.precision", FLOATING_POINT_PRECISION);
 		gpuMLC.setGPU(true);
 		gpuMLC.setForceGPU(true);
 		gpuMLC.setStatistics(true);