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/09/10 12:21:53 UTC

[systemds] branch master updated: [SYSTEMDS-3126] Fix misalignment in logical cleaning pipeline enum

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 64ca78e  [SYSTEMDS-3126] Fix misalignment in logical cleaning pipeline enum
64ca78e is described below

commit 64ca78e1a5bd0af29678c949a4fd735640e16dee
Author: Matthias Boehm <mb...@gmail.com>
AuthorDate: Fri Sep 10 14:21:05 2021 +0200

    [SYSTEMDS-3126] Fix misalignment in logical cleaning pipeline enum
    
    This patch fixes an issue of misaligned logical and physical pipelines,
    if the number of generated physical pipelines is less than the
    configured number - this issue has been observed for sets of logical
    pipelines, involving the folliw:
    
    # FRAME: nrow = 1, ncol = 3
    # C1 C2 C3
    # STRING STRING STRING
    ED DUMMY DIM
---
 scripts/pipelines/scripts/enumerateLogical.dml | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/scripts/pipelines/scripts/enumerateLogical.dml b/scripts/pipelines/scripts/enumerateLogical.dml
index 977c0a2..1af125e 100644
--- a/scripts/pipelines/scripts/enumerateLogical.dml
+++ b/scripts/pipelines/scripts/enumerateLogical.dml
@@ -61,32 +61,33 @@ return (Frame[Unknown] bestLg, Double pre_best)
   bestLg = as.frame("")
   best_score = 0.0
   pre_best = 0.0
-  feaFrameOuter = as.frame("NULL")
   iter = 1
   convergedOuter = FALSE
 
   while(iter <= max_iter & !convergedOuter)
   {
-  	print(prefix+" EnumLP iteration "+iter+"/"+as.integer(max_iter)+":" );
+    print(prefix+" EnumLP iteration "+iter+"/"+as.integer(max_iter)+":" );
     physicalPipList = list();
     logicalPipList = list();
     
     # get the physical instances from logical ones
     # unrolled by physical pipelines
+    ppos = list();
     for(i in 1:nrow(population)) { 
       lv = as.integer(as.scalar(population[i, 1])) + 1
       lp = population[i, 2:lv]
       pconf = bandit::get_physical_configurations(lp, num_inst, primitives)
-      for(j in 1:nrow(pconf))
+      for(j in 1:nrow(pconf)) {
         physicalPipList = append(physicalPipList, pconf[j,]);
+        ppos = append(ppos, i)
+      }
       logicalPipList = append(logicalPipList, lp);
     }
     
     # # # execute the physical pipelines
     scores = matrix(0, nrow(physicalPipList), 1)
-    # TODO better parfor-dep handling of multi-assignments to avoid check=0 
-    for(i in 1:length(physicalPipList), check=0) {
-      lp2 = as.frame(logicalPipList[((i-1)%/%num_inst)+1,])
+    for(i in 1:length(physicalPipList)) {
+      lp2 = as.frame(logicalPipList[as.scalar(ppos[i]),])
       pp2 = as.frame(physicalPipList[i,])
       # # append configuration keys for extracting the pipeline later on
       id = seq(1, nrow(pp2))
@@ -112,7 +113,7 @@ return (Frame[Unknown] bestLg, Double pre_best)
     }
     else {
       pre_best = best_score
-      idxR2 = ((idxR-1)%/%num_inst)+1 #logical pipeline ID
+      idxR2 = as.scalar(ppos[idxR]) #logical pipeline ID
       idxC = as.integer(as.scalar(population[idxR2, 1])) + 1
       bestLg = population[idxR2, 2:idxC]
     }
@@ -122,7 +123,7 @@ return (Frame[Unknown] bestLg, Double pre_best)
     i = 1
 
     while(i <= ceil(nrow(scores)/2) & !converged) {
-      top = population[as.scalar(((selected[i]-1)%/%num_inst)+1), ]
+      top = population[as.scalar(ppos[as.scalar(selected[i])]), ]
       length_top = as.integer(as.scalar(top[1, 1]))
       top = top[, 2:(length_top+1)]