Amdahl's law: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>Trappist the monk
en>DMacks
→‎See also: similar concept in general scheduling of tasks
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Image:AmdahlsLaw.svg|thumb|right|300px|The speedup of a program using multiple processors in parallel computing is limited by the sequential fraction of the program. For example, if 95% of the program can be parallelized, the theoretical maximum speedup using parallel computing would be 20× as shown in the diagram, no matter how many processors are used.]]
Every day you are bombarded with junk food advertisement, inside United Kingdom government has banned quickly food diners near school premises. The reason behind this is simple, individuals are getting obese, teenage obesity is a huge concern nowadays. Young people ought to be educated regarding food they consume.<br><br>One doesn't should take in much of the caffeine which comes with coffee when taking in the [http://greencoffeeweightlossplan.blogspot.com green coffee bean extract] supplement. It just has 20mg of caffeine per serving that is technique less compared to the regular cup which has 100mg of caffeine. No have to worry about which nervous, jittery feeling which normal coffee provides. Just sit back, relax plus wait for the chlorogenic acid, the active component of this particular supplement, to function its means to achieve the ideal weight.<br><br>Coffee is the world's second-most useful exported legal commodity, after oil. Exports throughout 2010 alone were worth some $15.4bn, according to the International Coffee Organization.<br><br>We all know that green foods (fruits and vegetables) are the ideal source of nutrients; the body will observe these healthy vitamins plus burn calories fairly swiftly. Unlike fatty junk foods that you are wrongly chosen to it, these will likely not be observe by the body but stored as fat and it takes many exercise to burn body fat.<br><br>As I revealed, how does that hurt you? As my past statement demonstrated, which platitude is excellent. Everybody understands which these are the situations inside reference to a means. I recognize you must understand what's going on here. I'll try plus create this easy for you. I type of comply with that impeccable hypothesis. Irregardless, by the time you're done reading this you'll recognize what this might be or it was called weight loss at this time.<br><br>But, creating lean muscle mass from exercise is a wonderful means to burn fat, lose fat, and get thinner! She did not recognize how it all works and reacted to words she thought she understood.<br><br>In 2012, Dr. Mehmet Oz proclaimed green coffee bean extract to be a weight reduction miracle on his favored talk show. Calling it a holistic "magic pill," he mentioned which it could burn fat rapidly. We've got bad news, Dr. Oz: Your "miracle" flunked the newest tests performed by scientists, reported Healthline on June 14. Not only do these holistic supplements are not able to boost fat loss, but the American Chemical Society researchers inform that they could cause fatty deposits inside the liver.<br><br>Before purchasing vegetable seeds create sure you let the eco-friendly beans sit on a unique paper towel inside order to dry out. Although they may not necessarily appear to be wet, you must take the precaution. Failing to accomplish this usually ruin your seeds when they are in storage. Once a week has passed, have the green beans in case any of the beans glimpse malformed or an odd coloration you will want to discard these people. Then take the remaining coffee beans and region them in a bag, I utilize just a normal food storage region bag. Be sure this bag is closed tight plus try to obtain as much air available as possible. Now only receive a dry spot to retailer these and you may be all set to go for having free seeds for upcoming year!
 
'''Amdahl's law''', also known as '''Amdahl's argument''',<ref>{{harv|Rodgers|1985|p=226}}</ref> is used to find the maximum expected improvement to an overall system when only part of the system is improved. It is often used in [[parallel computing]] to predict the theoretical maximum [[speedup]] using multiple processors. The law is named after [[Computer architecture|computer architect]] [[Gene Amdahl]], and was presented at the [[American Federation of Information Processing Societies|AFIPS]] Spring Joint Computer Conference in 1967.
 
The speedup of a program using multiple processors in parallel computing is limited by the time needed for the sequential fraction of the program. For example, if a program needs 20 hours using a single processor core, and a particular portion of the program which takes one hour to execute cannot be parallelized, while the remaining 19 hours (95%) of execution time can be parallelized, then regardless of how many processors are devoted to a parallelized execution of this program, the minimum execution time cannot be less than that critical one hour. Hence the speedup is limited to at most 20×.
 
==Definition ==
Given:
* <math>n \in \mathbb{N}</math>, the number of [[thread of execution|threads of execution]],
* <math>B\in [0, 1]</math>, the fraction of the algorithm that is strictly serial,
 
The time <math>T \left(n \right)</math> an algorithm takes to finish when being executed on <math>n</math> thread(s) of execution corresponds to:
 
<math>T(n) = T(1) \left(B + \frac{1}{n}\left(1 - B\right)\right)</math>
 
 
Therefore, the theoretical speedup that can be had by executing a given algorithm on a system capable of executing <math>n</math> threads of execution is:
 
<math>S(n) = \frac{ T\left(1\right)}{T\left(n\right)} = \frac{T\left(1\right)}{T\left(1\right)\left(B + \frac{1}{n}\left(1 - B\right)\right) } =  \frac{1}{B + \frac{1}{n}\left(1-B\right)}</math>
 
==Description==
Amdahl's law is a model for the relationship between the expected speedup of parallelized implementations of an algorithm relative to the serial algorithm, under the assumption that the problem size remains the same when parallelized. For example, if for a given problem size a parallelized implementation of an algorithm can run 12% of the algorithm's operations arbitrarily quickly (while the remaining 88% of the operations are not parallelizable), Amdahl's law states that the maximum speedup of the parallelized version is {{nowrap|1=1/(1 – 0.12) = 1.136}} times as fast as the non-parallelized implementation.
 
More technically, the law is concerned with the speedup achievable from an improvement to a computation that affects a proportion ''P'' of that computation where the improvement has a speedup of ''S''. (For example, if 30% of the computation may be the subject of a speed up, ''P'' will be 0.3; if the improvement makes the portion affected twice as fast, ''S'' will be 2.) Amdahl's law states that the overall speedup of applying the improvement will be:
 
:<math>\frac{1}{(1 - P) + \frac{P}{S}} = \frac{1}{(1 - 0.3) + \frac{0.3}{2}} = 1.1765</math>
 
To see how this formula was derived, assume that the running time of the old computation was 1, for some unit of time. The running time of the new computation will be the length of time the unimproved fraction takes (which is 1 &minus; ''P''), plus the length of time the improved fraction takes. The length of time for the improved part of the computation is the length of the improved part's former running time divided by the speedup, making the length of time of the improved part ''P''/''S''. The final speedup is computed by dividing the old running time by the new running time, which is what the above formula does.
 
Here's another example. We are given a sequential task which is split into four consecutive parts: P1, P2, P3 and P4 with the percentages of runtime being 11%, 18%, 23% and 48% respectively.  Then we are told that P1 is not sped up, so S1 = 1, while P2 is sped up 5×, P3 is sped up 20×, and P4 is sped up 1.6×. By using the formula
P1/S1 + P2/S2 + P3/S3 + P4/S4, we find the new sequential running time is:
 
:<math>\frac{0.11}{1} + \frac{0.18}{5} + \frac{0.23}{20} + \frac{0.48}{1.6} = 0.4575.</math>
 
or a little less than {{frac|1|2}} the original running time. Using the formula {{nowrap|(P1/S1 + P2/S2 + P3/S3 + P4/S4)<sup>−1</sup>}}, the overall speed boost is 1 / 0.4575 = 2.186, or a little more than double the original speed.  Notice how the 20× and 5× speedup don't have much effect on the overall speed when P1 (11%) is not sped up, and P4 (48%) is sped up only 1.6 times.
 
== Parallelization ==
In the case of parallelization, Amdahl's law states that if ''P'' is the proportion of a program that can be made parallel (i.e., benefit from parallelization), and (1 − ''P'') is the proportion that cannot be parallelized (remains serial), then the maximum speedup that can be achieved by using ''N'' processors is
 
:<math>S(N) = \frac{1}{(1-P) + \frac{P}{N}}</math>.
 
In the limit, as ''N'' tends to [[Extended real number line|infinity]], the maximum speedup tends to 1 / (1 − ''P''). In practice, performance to price ratio falls rapidly as ''N'' is increased once there is even a small component of (1 − ''P'').
 
As an example, if ''P'' is 90%, then (1 − ''P'') is 10%, and the problem can be sped up by a maximum of a factor of 10, no matter how large the value of ''N'' used. For this reason, parallel computing is only useful for either small numbers of [[central processing unit|processor]]s, or problems with very high values of ''P'': so-called [[embarrassingly parallel]] problems. A great part of the craft of [[parallel programming]] consists of attempting to reduce the component (1 – ''P'') to the smallest possible value.
 
''P'' can be estimated by using the measured speedup (''SU'') on a specific number of processors (''NP'') using
 
:<math>P_\text{estimated} = \frac{\frac{1}{SU} - 1}{\frac{1}{NP} - 1}</math>.
 
''P'' estimated in this way can then be used in Amdahl's law to predict speedup for a different number of processors.
 
==Relation to law of diminishing returns==
Amdahl's law is often conflated with the [[Diminishing returns|law of diminishing returns]], whereas only a special case of applying Amdahl's law demonstrates 'law of diminishing returns'. If one picks optimally (in terms of the achieved speed-up) what to improve, then one will see monotonically decreasing improvements as one improves. If, however, one picks non-optimally, after improving a sub-optimal component and moving on to improve a more optimal component, one can see an increase in return. Note that it is often rational to improve a system in an order that is "non-optimal" in this sense, given that some improvements are more difficult or consuming of development time than others.
 
Amdahl's law does represent the law of diminishing returns if you are considering what sort of return you get by adding more processors to a machine, if you are running a fixed-size computation that will use all available processors to their capacity. Each new processor you add to the system will add less usable power than the previous one. Each time you double the number of processors the speedup ratio will diminish, as the total throughput heads toward the limit of <math>\scriptstyle 1 / (1 \,-\, P)</math>.
 
This analysis neglects other potential bottlenecks such as [[memory bandwidth]] and I/O bandwidth, if they do not scale with the number of processors; however, taking into account such bottlenecks would tend to further demonstrate the diminishing returns of only adding processors.
 
== Speedup in a sequential program ==
[[Image:Optimizing-different-parts.svg|thumb|400px|Assume that a task has two independent parts, A and B. B takes roughly 25% of the time of the whole computation. By working very hard, one may be able to make this part 5 times faster, but this only reduces the time for the whole computation by a little. In contrast, one may need to perform less work to make part A be twice as fast. This will make the computation much faster than by optimizing part B, even though B's speed-up is greater by ratio, (5× versus 2×).]]
The maximum speedup in an improved sequential program, where some part was sped up <math>p</math> times is limited by inequality
 
:<math>\text{maximum speedup } \le \frac{p}{1 + f \cdot (p - 1)}</math>
 
where <math>\scriptstyle f</math> (<math>\scriptstyle 0 \;<\; f \;<\; 1</math>) is the fraction of time (before the improvement) spent in the part that was not improved. For example (see picture on right):
 
*If part B is made five times faster (<math>\scriptstyle p \;=\; 5</math>), <math>\scriptstyle t_A \;=\; 3</math>, <math>\scriptstyle t_B \;=\; 1</math>, and <math>\scriptstyle f \;=\; t_A / (t_A \,+\, t_B) \;=\; 0.75</math>, then
*:<math>\text{maximum speedup } \le \frac{5}{1 + 0.75 \cdot (5 - 1)} = 1.25</math>
*If part A is made to run twice as fast (<math>\scriptstyle p \;=\; 2</math>), <math>\scriptstyle t_B \;=\; 1</math>, <math>\scriptstyle t_A \;=\; 3</math>, and <math>\scriptstyle f \;=\; t_B / (t_A \,+\, t_B) \;=\; 0.25</math>, then
*:<math>\text{maximum speedup } \le \frac{2}{1 + 0.25 \cdot (2 - 1)} = 1.60</math>
 
Therefore, making A twice as fast is better than making B five times faster. The percentage improvement in speed can be calculated as
 
:<math>\text{percentage improvement} = \left(1 - \frac{1}{\text{speedup factor}}\right) \cdot 100</math>
 
*Improving part A by a factor of two will increase overall program speed by a factor of 1.6, which makes it 37.5% faster than the original computation.
*However, improving part B by a factor of five, which presumably requires more effort, will only achieve an overall speedup factor of 1.25, which makes it 20% faster.
 
== Relation to Gustafson's Law ==
{{Unreferenced section|date=August 2010}}
 
[[John L. Gustafson]] pointed out in 1988 what is now known as [[Gustafson's Law]]: people typically are not interested in solving a fixed problem in the shortest possible period of time, as Amdahl's Law describes, but rather in solving the largest possible problem (e.g., the most accurate possible approximation) in a fixed "reasonable" amount of time.  If the non-parallelizable portion of the problem is fixed, or grows very slowly with problem size (e.g., [[Big O notation|O]](log ''n'')), then additional processors can increase the possible problem size without limit.
 
== See also ==
 
* [[Amdahl Corporation]]
* [[Karp–Flatt metric]]
* [[Moore's law]]
* [[Gustafson's law]]
 
==Notes==
{{Reflist}}
 
==References==
* {{Cite journal | first = Gene M. | last = Amdahl | url = http://www-inst.eecs.berkeley.edu/~n252/paper/Amdahl.pdf|doi=10.1145/1465482.1465560 | title = Validity of the Single Processor Approach to Achieving Large-Scale Computing Capabilities | journal = AFIPS Conference Proceedings | issue = 30 | pages = 483–485 | year = 1967|ref=harv}}
* {{Cite journal | last = Rodgers | first = David P. |date=June 1985 | url = http://portal.acm.org/citation.cfm?id=327215 | title = Improvements in multiprocessor system design | journal = ACM SIGARCH Computer Architecture News archive | volume = 13 | issue = 3  | pages = 225–231 | issn = 0163-5964 | publisher = [[Association for Computing Machinery|ACM]] | location = New York, NY, USA | doi = 10.1145/327070.327215|ref=harv|isbn=0-8186-0634-7}}
 
==External links==
{{Commons category|Amdahl's law}}
* [http://www.futurechips.org/thoughts-for-researchers/parallel-programming-gene-amdahl-said.html Cases where Amdahl's law is inapplicable]
* [http://purl.umn.edu/104341 Oral history interview with Gene M. Amdahl] [[Charles Babbage Institute]], University of Minnesota.  Amdahl discusses his graduate work at the University of Wisconsin and his design of [[Wisconsin Integrally Synchronized Computer|WISC]]. Discusses his role in the design of several computers for IBM including the [[IBM Stretch|STRETCH]], [[IBM 701]], and [[IBM 704]]. He discusses his work with [[Nathaniel Rochester (computer scientist)|Nathaniel Rochester]] and IBM's management of the design process. Mentions work with [[TRW Inc.|Ramo-Wooldridge]], [[Aeronutronic]], and [[Computer Sciences Corporation]]
* [http://www.scl.ameslab.gov/Publications/Gus/AmdahlsLaw/Amdahls.html Reevaluating Amdahl's Law]
* [http://www.julianbrowne.com/article/viewer/amdahls-law A simple interactive Amdahl's Law calculator]
* [http://demonstrations.wolfram.com/AmdahlsLaw/ "Amdahl's Law"] by Joel F. Klein, [[Wolfram Demonstrations Project]], 2007.
* [http://www.cs.wisc.edu/multifacet/amdahl/ Amdahl's Law in the Multicore Era]
* [http://www.gordon-taft.net/Amdahl_Law.html Amdahl's Law explanation]
* [http://www.cilk.com/multicore-blog/bid/5365/What-the-is-Parallelism-Anyhow Blog Post: "What the $#@! is Parallelism, Anyhow?"]
* [http://www.multicorepacketprocessing.com/how-should-amdahl-law-drive-the-redesigns-of-socket-system-calls-for-an-os-on-a-multicore-cpu Amdahl's Law applied to OS system calls on multicore CPU]
{{Parallel Computing}}
 
{{DEFAULTSORT:Amdahl's Law}}
[[Category:Parallel computing]]
[[Category:Programming rules of thumb]]

Latest revision as of 10:12, 2 January 2015

Every day you are bombarded with junk food advertisement, inside United Kingdom government has banned quickly food diners near school premises. The reason behind this is simple, individuals are getting obese, teenage obesity is a huge concern nowadays. Young people ought to be educated regarding food they consume.

One doesn't should take in much of the caffeine which comes with coffee when taking in the green coffee bean extract supplement. It just has 20mg of caffeine per serving that is technique less compared to the regular cup which has 100mg of caffeine. No have to worry about which nervous, jittery feeling which normal coffee provides. Just sit back, relax plus wait for the chlorogenic acid, the active component of this particular supplement, to function its means to achieve the ideal weight.

Coffee is the world's second-most useful exported legal commodity, after oil. Exports throughout 2010 alone were worth some $15.4bn, according to the International Coffee Organization.

We all know that green foods (fruits and vegetables) are the ideal source of nutrients; the body will observe these healthy vitamins plus burn calories fairly swiftly. Unlike fatty junk foods that you are wrongly chosen to it, these will likely not be observe by the body but stored as fat and it takes many exercise to burn body fat.

As I revealed, how does that hurt you? As my past statement demonstrated, which platitude is excellent. Everybody understands which these are the situations inside reference to a means. I recognize you must understand what's going on here. I'll try plus create this easy for you. I type of comply with that impeccable hypothesis. Irregardless, by the time you're done reading this you'll recognize what this might be or it was called weight loss at this time.

But, creating lean muscle mass from exercise is a wonderful means to burn fat, lose fat, and get thinner! She did not recognize how it all works and reacted to words she thought she understood.

In 2012, Dr. Mehmet Oz proclaimed green coffee bean extract to be a weight reduction miracle on his favored talk show. Calling it a holistic "magic pill," he mentioned which it could burn fat rapidly. We've got bad news, Dr. Oz: Your "miracle" flunked the newest tests performed by scientists, reported Healthline on June 14. Not only do these holistic supplements are not able to boost fat loss, but the American Chemical Society researchers inform that they could cause fatty deposits inside the liver.

Before purchasing vegetable seeds create sure you let the eco-friendly beans sit on a unique paper towel inside order to dry out. Although they may not necessarily appear to be wet, you must take the precaution. Failing to accomplish this usually ruin your seeds when they are in storage. Once a week has passed, have the green beans in case any of the beans glimpse malformed or an odd coloration you will want to discard these people. Then take the remaining coffee beans and region them in a bag, I utilize just a normal food storage region bag. Be sure this bag is closed tight plus try to obtain as much air available as possible. Now only receive a dry spot to retailer these and you may be all set to go for having free seeds for upcoming year!