speculative-execution

Haskell speculative parallel execution

大憨熊 提交于 2019-12-04 03:16:38
I am thinking about exploiting parallelism for one problem I am trying to solve. The problem is roughly this: given input (sequence of points) find a best output (biggest triangle composed from these points, longest line etc.). There are 3 different 'shapes' to be found in the sequence of points, however I am interested only in the one with 'best score' (usually some form of 'length' times coefficient). Let's call the shapes S1, S2, S3. I have 2 different algorithms for solving S1 - 'S1a' is in O(n 2 ), 'S1b' mostly behaves better, but the worst case is about O(n 4 ). First question: is there

difference between speculation and prediction

你离开我真会死。 提交于 2019-12-03 09:51:25
问题 In computer architecture, what is difference between (branch) prediction and speculation?? These seems very similar, but i think there is a subtle distinction between them. 回答1: Branch prediction is done by the processor to try to determine where the execution will continue after a conditional jump, so that it can read the next instruction(s) from memory. Speculative execution goes one step further and determines what the result would be from executing the next instruction(s). If the branch

Why do we need 'seq' or 'pseq' with 'par' in Haskell?

旧巷老猫 提交于 2019-12-03 06:38:11
问题 I'm trying to understand why we need all parts of the standard sample code: a `par` b `pseq` a+b Why won't the following be sufficient? a `par` b `par` a+b The above expression seems very descriptive: Try to evaluate both a and b in parallel, and return the result a+b . Is the reason only that of efficiency: the second version would spark off twice instead of once? How about the following, more succinct version? a `par` a+b Why would we need to make sure b is evaluated before a+b as in the

difference between speculation and prediction

倾然丶 夕夏残阳落幕 提交于 2019-12-02 23:10:58
In computer architecture, what is difference between (branch) prediction and speculation?? These seems very similar, but i think there is a subtle distinction between them. Guffa Branch prediction is done by the processor to try to determine where the execution will continue after a conditional jump, so that it can read the next instruction(s) from memory. Speculative execution goes one step further and determines what the result would be from executing the next instruction(s). If the branch prediction was correct, the result is used, otherwise it is discarded. Note that speculative execution

Why do we need 'seq' or 'pseq' with 'par' in Haskell?

狂风中的少年 提交于 2019-12-02 20:15:40
I'm trying to understand why we need all parts of the standard sample code: a `par` b `pseq` a+b Why won't the following be sufficient? a `par` b `par` a+b The above expression seems very descriptive: Try to evaluate both a and b in parallel, and return the result a+b . Is the reason only that of efficiency: the second version would spark off twice instead of once? How about the following, more succinct version? a `par` a+b Why would we need to make sure b is evaluated before a+b as in the original, standard code? Ok. I think the following paper answers my question: http://community.haskell

Hadoop Reducer: How can I output to multiple directories using speculative execution?

一世执手 提交于 2019-12-02 04:51:55
I have a reducer that needs to output results to different directories so that we can later use the output as input to Hive as a partitioned table. (Hive creates partitions based on folder name). In order to write out to these locations, we are currently not using any Hadoop framework to accomplish this, we are just writing out to separate locations "behind Hadoop's back", so to speak. In other words we are not using hadoop's API to output these files. We had issues with mapred.reduce.tasks.speculative.execution set to true . I understand this to be the case because multiple task attempts for

Out-of-order execution vs. speculative execution

一个人想着一个人 提交于 2019-11-27 08:57:39
I have read the wikipedia page about out-of-order execution and speculative exectution . What I fail to understant though are the similarities and differences. It seems to me that speculative execution uses out-of-order execution when it has not determined the value of a condition for example. The confusion came when I read the papers of Meltdown and Spectre and did additional research. It is stated in the Meltdown paper that Meltdown is based on out-of-order execution, while some other resources including the wiki page about sepeculative execution state that Meltdown is based on speculative

What exactly happens when a skylake CPU mispredicts a branch?

白昼怎懂夜的黑 提交于 2019-11-27 07:07:29
问题 I'm trying to understand in detail what happens to instructions in the various stages of the skylake CPU pipeline when a branch is mis-predicted, and how quickly instructions from the correct branch destination can start executing. So lets label the two code paths here as red (the one predicted, but not actually taken) and green (the one taken, but not predicted). So questions are: 1. How far through the pipeline does the branch have to get before red instructions start being discarded (and