请输入您要查询的百科知识:

 

词条 Amdahl's law
释义

  1. Definition

  2. Derivation

      Parallel programs    Serial programs    Optimizing the sequential part of parallel programs    Transforming sequential parts of parallel programs into parallelizable  

  3. Relation to the law of diminishing returns

  4. See also

  5. References

  6. Further reading

  7. External links

{{more footnotes|date=April 2017}}

In computer architecture, Amdahl's law (or Amdahl's argument[1]) is a formula which gives the theoretical speedup in latency of the execution of a task at fixed workload that can be expected of a system whose resources are improved. It is named after computer scientist Gene Amdahl, and was presented at the AFIPS Spring Joint Computer Conference in 1967.

Amdahl's law is often used in parallel computing to predict the theoretical speedup when using multiple processors. For example, if a program needs 20 hours using a single processor core, and a particular part of the program which takes one hour to execute cannot be parallelized, while the remaining 19 hours ({{nowrap|1=p = 0.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 theoretical speedup is limited to at most 20 times . For this reason, parallel computing with many processors is useful only for highly parallelizable programs.

Definition

Amdahl's law can be formulated in the following way:

where

  • Slatency is the theoretical speedup of the execution of the whole task;
  • s is the speedup of the part of the task that benefits from improved system resources;
  • p is the proportion of execution time that the part benefiting from improved resources originally occupied.

Furthermore,

shows that the theoretical speedup of the execution of the whole task increases with the improvement of the resources of the system and that regardless of the magnitude of the improvement, the theoretical speedup is always limited by the part of the task that cannot benefit from the improvement.

Amdahl's law applies only to the cases where the problem size is fixed. In practice, as more computing resources become available, they tend to get used on larger problems (larger datasets), and the time spent in the parallelizable part often grows much faster than the inherently serial work. In this case, Gustafson's law gives a less pessimistic and more realistic assessment of the parallel performance.[2]

Derivation

A task executed by a system whose resources are improved compared to an initial similar system can be split up into two parts:

  • a part that does not benefit from the improvement of the resources of the system;
  • a part that benefits from the improvement of the resources of the system.

An example is a computer program that processes files from disk. A part of that program may scan the directory of the disk and create a list of files internally in memory. After that, another part of the program passes each file to a separate thread for processing. The part that scans the directory and creates the file list cannot be sped up on a parallel computer, but the part that processes the files can.

The execution time of the whole task before the improvement of the resources of the system is denoted as . It includes the execution time of the part that would not benefit from the improvement of the resources and the execution time of the one that would benefit from it. The fraction of the execution time of the task that would benefit from the improvement of the resources is denoted by . The one concerning the part that would not benefit from it is therefore {{nowrap |}}. Then:

It is the execution of the part that benefits from the improvement of the resources that is accelerated by the factor after the improvement of the resources. Consequently, the execution time of the part that does not benefit from it remains the same, while the part that benefits from it becomes:

The theoretical execution time of the whole task after the improvement of the resources is then:

Amdahl's law gives the theoretical speedup in latency of the execution of the whole task at fixed workload , which yields

Parallel programs

If 30% of the execution time may be the subject of a speedup, p will be 0.3; if the improvement makes the affected part twice as fast, s will be 2. Amdahl's law states that the overall speedup of applying the improvement will be:

For example, assume that we are given a serial task which is split into four consecutive parts, whose percentages of execution time are {{nowrap|1=p1 = 0.11}}, {{nowrap|1=p2 = 0.18}}, {{nowrap|1=p3 = 0.23}}, and {{nowrap|1=p4 = 0.48}} respectively. Then we are told that the 1st part is not sped up, so {{nowrap|1=s1 = 1}}, while the 2nd part is sped up 5 times, so {{nowrap|1=s2 = 5}}, the 3rd part is sped up 20 times, so {{nowrap|1=s3 = 20}}, and the 4th part is sped up 1.6 times, so {{nowrap|1=s4 = 1.6}}. By using Amdahl's law, the overall speedup is

Notice how the 5 times and 20 times speedup on the 2nd and 3rd parts respectively don't have much effect on the overall speedup when the 4th part (48% of the execution time) is accelerated by only 1.6 times.

Serial programs

For example, with a serial program in two parts A and B for which {{nowrap|1=TA = 3 s}} and {{nowrap|1=TB = 1 s}},

  • if part B is made to run 5 times faster, that is {{nowrap|1=s = 5}} and {{nowrap|1=p = TB/(TA + TB) = 0.25}}, then

  • if part A is made to run 2 times faster, that is {{nowrap|1=s = 2}} and {{nowrap|1=p = TA/(TA + TB) = 0.75}}, then

Therefore, making part A to run 2 times faster is better than making part B to run 5 times faster. The percentage improvement in speed can be calculated as

  • Improving part A by a factor of 2 will increase overall program speed by a factor of 1.60, which makes it 37.5% faster than the original computation.
  • However, improving part B by a factor of 5, which presumably requires more effort, will achieve an overall speedup factor of 1.25 only, which makes it 20% faster.

Optimizing the sequential part of parallel programs

If the non-parallelizable part is optimized by a factor of {{nowrap |}}, then

It follows from Amdahl's law that the speedup due to parallelism is given by

When , we have , meaning that the speedup is

measured with respect to the execution time after the non-parallelizable part is optimized.

When ,

If , and , then:

Transforming sequential parts of parallel programs into parallelizable

Next, we consider the case wherein the non-parallelizable part is reduced by a factor of {{nowrap |}}, and the parallelizable part is correspondingly increased. Then

It follows from Amdahl's law that the speedup due to parallelism is given by

The derivation above is in agreement with Jakob Jenkov's analysis of the execution time vs. speedup tradeoff.[3]

Relation to the law of diminishing returns

Amdahl's law is often conflated with the 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 speedup) 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 the 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 require larger development time than others.

Amdahl's law does represent the law of diminishing returns if on considering what sort of return one gets by adding more processors to a machine, if one is running a fixed-size computation that will use all available processors to their capacity. Each new processor added to the system will add less usable power than the previous one. Each time one doubles the number of processors the speedup ratio will diminish, as the total throughput heads toward the limit of 1/(1 − p).

This analysis neglects other potential bottlenecks such as memory bandwidth and I/O bandwidth. If these resources do not scale with the number of processors, then merely adding processors provides even lower returns.

An implication of Amdahl's law is that to speedup real applications which have both serial and parallel portions, heterogeneous computing techniques are required.[4] For example, a CPU-GPU heterogeneous processor may provide higher performance and energy efficiency than a CPU-only or GPU-only processor.[5]

See also

  • Gustafson's law
  • Critical path method
  • Moore's law

References

1. ^{{harv|Rodgers|1985|p=226}}
2. ^{{cite book| author1=Michael McCool| author2=James Reinders| author3=Arch Robison| title=Structured Parallel Programming: Patterns for Efficient Computation| publisher=Elsevier| year=2013| pages=61}}
3. ^http://tutorials.jenkov.com/java-concurrency/amdahls-law.html
4. ^"Amdahl's Law in the Multicore Era", Computer, 41 (7), 33–38, 2008
5. ^"[https://www.academia.edu/12355899/A_Survey_of_CPU-GPU_Heterogeneous_Computing_Techniques A Survey of CPU-GPU Heterogeneous Computing Techniques]", ACM Computing Surveys, 47(4), 69:1–69:35, 2015

Further reading

  • {{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 = https://dl.acm.org/citation.cfm?id=327215
| title = Improvements in multiprocessor system design
| journal = ACM SIGARCH Computer Architecture News
| volume = 13
| issue = 3
| pages = 225–231
| issn = 0163-5964
| publisher = ACM
| location = New York, NY, USA
| doi = 10.1145/327070.327215
| ref=harv
| isbn=0-8186-0634-7}}

External links

{{commonscat}}
  • {{Webarchive

| url=https://web.archive.org/web/20170508130755/http://www.futurechips.org/thoughts-for-researchers/parallel-programming-gene-amdahl-said.html
| title=Parallel Programming: When Amdahl’s law is inapplicable?
| date=2017-05-08}}
  • [https://hdl.handle.net/11299/104341 Oral history interview with Gene M. Amdahl] Charles Babbage Institute, University of Minnesota (1989). Amdahl discusses his graduate work at the University of Wisconsin and his design of WISC. Discusses his role in the design of several computers for IBM including the STRETCH, IBM 701, and IBM 704. He discusses his work with Nathaniel Rochester and IBM's management of the design process. Mentions work with Ramo-Wooldridge, Aeronutronic, and Computer Sciences Corporation
  • Amdahl's Law: Not all performance improvements are created equal (2007)
  • "Amdahl's Law" by Joel F. Klein, Wolfram Demonstrations Project (2007)
  • [https://research.cs.wisc.edu/multifacet/amdahl/ Amdahl's Law in the Multicore Era] (July 2008)
  • What the $#@! is Parallelism, Anyhow? (Charles Leiserson, May 2008)
  • [https://www.cs.sfu.ca/~fedorova/papers/TurboBoostEvaluation.pdf Evaluation of the Intel Core i7 Turbo Boost feature], by James Charles, Preet Jassi, Ananth Narayan S, Abbas Sadat and Alexandra Fedorova (2009)
  • [https://www.researchgate.net/publication/228569958 Calculation of the acceleration of parallel programs as a function of the number of threads], by George Popov, Valeri Mladenov and Nikos Mastorakis (January 2010)
  • [https://www.webofstories.com/play/danny.hillis/109 Danny Hillis - Proving Amdahl's Law wrong, video recorded October 2016]
{{Computer laws}}{{Parallel Computing}}

2 : Analysis of parallel algorithms|Computer architecture statements

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/22 17:32:18