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/14 02:36:27 UTC

systemml git commit: [SYSTEMML-446] Allow SystemML to run in -exec singlenode with gpu

Repository: systemml
Updated Branches:
  refs/heads/master e106966a9 -> c69bd7f30


[SYSTEMML-446] Allow SystemML to run in -exec singlenode with gpu

Currently, we can either force all instructions to:
- CP (via -exec singlenode) OR
- GPU (via -gpu force)

However, a typical user may want to run in singlenode with GPU
acceleration by using the option '-exec singlenode -gpu'. This commit
enables such an option.

Closes #684.


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

Branch: refs/heads/master
Commit: c69bd7f30023cc40351a70586c54cf83d893ce23
Parents: e106966
Author: Niketan Pansare <np...@us.ibm.com>
Authored: Fri Oct 13 18:35:31 2017 -0800
Committer: Niketan Pansare <np...@us.ibm.com>
Committed: Fri Oct 13 19:35:31 2017 -0700

----------------------------------------------------------------------
 src/main/java/org/apache/sysml/hops/Hop.java | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/c69bd7f3/src/main/java/org/apache/sysml/hops/Hop.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/hops/Hop.java b/src/main/java/org/apache/sysml/hops/Hop.java
index 23d4346..ec0a80c 100644
--- a/src/main/java/org/apache/sysml/hops/Hop.java
+++ b/src/main/java/org/apache/sysml/hops/Hop.java
@@ -195,13 +195,23 @@ public abstract class Hop implements ParseInfo
 	public void checkAndSetForcedPlatform()
 	{
 		if(DMLScript.USE_ACCELERATOR && DMLScript.FORCE_ACCELERATOR && isGPUEnabled())
-			_etypeForced = ExecType.GPU;
-		else if ( DMLScript.rtplatform == RUNTIME_PLATFORM.SINGLE_NODE )
-			_etypeForced = ExecType.CP;
+			_etypeForced = ExecType.GPU; // enabled with -gpu force option
+		else if ( DMLScript.rtplatform == RUNTIME_PLATFORM.SINGLE_NODE ) {
+			if(OptimizerUtils.isMemoryBasedOptLevel() && DMLScript.USE_ACCELERATOR && isGPUEnabled()) {
+				// enabled with -exec singlenode -gpu option
+				_etypeForced = findExecTypeByMemEstimate();
+				if(_etypeForced != ExecType.CP && _etypeForced != ExecType.GPU)
+					_etypeForced = ExecType.CP;
+			}
+			else {
+				// enabled with -exec singlenode option
+				_etypeForced = ExecType.CP;  
+			}
+		}
 		else if ( DMLScript.rtplatform == RUNTIME_PLATFORM.HADOOP )
-			_etypeForced = ExecType.MR;
+			_etypeForced = ExecType.MR; // enabled with -exec hadoop option
 		else if ( DMLScript.rtplatform == RUNTIME_PLATFORM.SPARK )
-			_etypeForced = ExecType.SPARK;
+			_etypeForced = ExecType.SPARK; // enabled with -exec spark option
 	}
 	
 	public void checkAndSetInvalidCPDimsAndSize()