Browse Source

Do not exclude the first measurement for a given size for regression models, otherwise we may not keep any measurement

Samuel Thibault 5 years ago
parent
commit
fa3162ca67
1 changed files with 7 additions and 8 deletions
  1. 7 8
      src/core/perfmodel/perfmodel_history.c

+ 7 - 8
src/core/perfmodel/perfmodel_history.c

@@ -1885,20 +1885,19 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 				STARPU_HG_DISABLE_CHECKING(entry->nsample);
 				STARPU_HG_DISABLE_CHECKING(entry->nsample);
 				STARPU_HG_DISABLE_CHECKING(entry->mean);
 				STARPU_HG_DISABLE_CHECKING(entry->mean);
 
 
-				/* Do not take the first measurement into account, it is very often quite bogus */
+				/* For history-based, do not take the first measurement into account, it is very often quite bogus */
 				/* TODO: it'd be good to use a better estimation heuristic, like the median, or latest n values, etc. */
 				/* TODO: it'd be good to use a better estimation heuristic, like the median, or latest n values, etc. */
-				//entry->mean = 0;
-				//entry->sum = 0;
-
-				//entry->deviation = 0.0;
-				//entry->sum2 = 0;
+				if (model->type != STARPU_HISTORY_BASED) {
+					entry->sum = measured;
+					entry->sum2 = measured*measured;
+					entry->nsample = 1;
+					entry->mean = measured;
+				}
 
 
 				entry->size = _starpu_job_get_data_size(model, arch, impl, j);
 				entry->size = _starpu_job_get_data_size(model, arch, impl, j);
 				entry->flops = j->task->flops;
 				entry->flops = j->task->flops;
 
 
 				entry->footprint = key;
 				entry->footprint = key;
-				//entry->nsample = 0;
-				//entry->nerror = 0;
 
 
 				insert_history_entry(entry, list, &per_arch_model->history);
 				insert_history_entry(entry, list, &per_arch_model->history);
 			}
 			}