You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemds.apache.org by mb...@apache.org on 2021/12/01 20:47:19 UTC

[systemds] branch main updated: [SYSTEMDS-3233] Fix parfor optimizer handling of shared reads

This is an automated email from the ASF dual-hosted git repository.

mboehm7 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git


The following commit(s) were added to refs/heads/main by this push:
     new 61c04ee  [SYSTEMDS-3233] Fix parfor optimizer handling of shared reads
61c04ee is described below

commit 61c04ee4b4862c81de1eb1b849537a0870aa645e
Author: Matthias Boehm <mb...@gmail.com>
AuthorDate: Wed Dec 1 21:46:33 2021 +0100

    [SYSTEMDS-3233] Fix parfor optimizer handling of shared reads
    
    This patch fixes a severe issue when computing the adjusted maximum
    degree of parallelism for shared reads (e.g., a read-only matrix is
    used by all iterations and hence should be taken only once into
    account while memory requirements of temporary intermediates are scale
    by the degree of parallelism). Missing parentheses led to an invalid
    large degree of parallelism and thus out-of-memory situations.
---
 .../sysds/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java b/src/main/java/org/apache/sysds/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java
index b2c82c1..13b846e 100644
--- a/src/main/java/org/apache/sysds/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java
+++ b/src/main/java/org/apache/sysds/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java
@@ -1227,7 +1227,7 @@ public class OptimizerRuleBased extends Optimizer {
 		//note: we compute max K for both w/o and w/ shared reads and take the max, because
 		//the latter might reduce the degree of parallelism if shared reads don't dominate
 		int k1 = (int)Math.floor(memBudget / M);
-		int k2 = (int)Math.floor(memBudget-memShared / memNonShared);
+		int k2 = (int)Math.floor((memBudget-memShared) / memNonShared);
 		return Math.max(k1, k2);
 	}