Amdahl's Law Calculator

Calculate parallel speedup, efficiency, and the maximum-speedup ceiling with Amdahl's Law. Enter the parallel fraction and cores, or solve backward for the parallel fraction.

https://hexacalculator.com/calculators/other/computers/amdahls-law-calculator

Other

Computers

Amdahl's Law Calculator

Calculate parallel speedup, efficiency, and the maximum-speedup ceiling with Amdahl's Law. Enter the parallel fraction and cores, or solve backward for the parallel fraction.

Amdahl's Law Calculator

Your workload

%

Enter any two of parallel portion, processors, and overall speedup. The calculator solves for the one you leave blank.

Optional analysis

Estimate the runtime and time saved

Turn a single-core runtime into the parallel runtime and the time saved.

Compare with Gustafson's Law

See the optimistic scaled-workload speedup alongside Amdahl's fixed-workload speedup.

Find the worthwhile core count

Find where extra cores stop paying off for a marginal-gain threshold you set.

Charts and scaling table

Watch how the speedup climbs and then flattens as processors are added, and see the serial part that caps it.

Loading calculator…

Amdahl's Law describes how much a task can be maximally accelerated if only part of the task is improved. By entering the proportion of the program that can run in parallel and the number of processors, the calculator gives the overall acceleration ratio, the efficiency of the processors as well as a hard upper limit that cannot be exceeded. It also supports reverse calculation: If either the proportion of parallel parts or the number of processors are left out, the corresponding values can be calculated from the already measured acceleration ratio.

What is Amdahl's Law?

The Amdahl's Law is named after computer architect Gene Amdahl who stated it in 1967. It reveals a simple but persistent fact: a program consists of a part that can be distributed to multiple processors, and another part that must be executed sequentially, step by step. Adding more processors speeds up the parallel part, but has no effect on the serial part.

Thus the serial part becomes a bottleneck. As more processors are added, the time required for parallel work approaches zero while the time required for sequential work remains constant, causing the overall speedup ratio to eventually taper off. This is an example of the law of diminishing returns expressed in a formula.

Amdahl's Law formula:

For a parallel portion P that is divided among N processors, the overall speedup ratio is:

S=1(1P)+PNS = \frac{1}{(1 - P) + \dfrac{P}{N}}

where P is the fraction of the program that can be run in parallel during execution time and is represented by a decimal number between 0 and 1; (1 - P) is the non-parallelizable, sequential part. N is the number of processors, cores or threads involved in running the parallel portion. If we consider N as the speedup factor for the improved portion, then this formula applies to any kind of improvement, not just parallel hardware.

As n approaches infinity, the term p/n disappears, resulting in a maximum acceleration factor of:

Smax=11PS_{\max} = \frac{1}{1 - P}

An example calculation:

Suppose a certain task can be performed 95 percent in parallel and you have 8 processors. Then p is equal to 0.95, (1-p) is equal to 0.05, and n is equal to 8:

S=10.05+0.958=10.168755.93S = \frac{1}{0.05 + \dfrac{0.95}{8}} = \frac{1}{0.16875} \approx 5.93

Eight processors give a speedup of 5.93 times, not 8 times. The parallel efficiency is the speedup factor divided by the number of processors, so 5.93 divided by 8, which is about 74 percent. Regardless of how many more processors are added, the limit to the fraction of code that can be run in parallel is 95 percent, which is 1 divided by 0.05, or 20 times. Finally, the serial execution of 5 percent of the code limits overall performance.

Symbol

Meaning

Example

P

Parallel fraction of the runtime

0.95 (95 percent)

1 - P

Serial fraction (the bottleneck)

0.05 (5 percent)

N

Number of processors or cores

8

S

Overall speedup

5.93 times

S max

Ceiling as N grows without bound

20 times

Efficiency and effective core count.

The speedup ratio indicates how much faster a system is while the efficiency indicates how well the hardware is being used. The efficiency is equal to the speedup ratio divided by the number of processors:

E=SNE = \frac{S}{N}

With 8 processors and a speedup of 5.93, the efficiency is about 74 percent. This means that approximately one quarter of the total processing power of serial code is consumed. You can also think of the ratio of the speedup as being the number of effective cores. A speedup of 5.93 means that your 8 physical cores are performing at a level equivalent to about 5.93 fully loaded cores. This way of thinking makes it easier to compare chips with different numbers of cores and clock speeds.

How to determine the proportion of the parallel part:

In general P is not known beforehand. The practical approach is to do measurements: first measure the execution time on a single core, then on multiple cores, and then calculate the actual speedup ratio in both cases. In this calculator you leave the parallel fraction blank, enter the measured speedup ratio and number of processors used, and the calculator will compute P. This back-calculated value is the serial fraction in Karp-Flatt style that you can use in calculations to estimate performance on other hardware.

Comparison of Amdahl's Law and Gustafson's Law:

Amdahl's Law assumes that the problem size is constant. Therefore, adding processors can only speed up a fraction of the work, and the ratio of acceleration eventually reaches a saturation point. Gustafson's Law takes an opposite approach. In practice, more computing power often solves a larger problem rather than running the same task faster. For such scalable workloads, the ratio of acceleration grows approximately linearly with the number of processors:

Sscaled=1+(N1)PS_{\text{scaled}} = 1 + (N - 1)\,P

Both laws are correct. Amdahl's law is the right perspective for fixed tasks where faster execution is desired; Gustafson's law is the right perspective for workloads that expand to fill purchased hardware. The Gustafson switch in this calculator shows both side by side.

Important restrictions:

The Amdahl's Law gives an idealized upper bound and should therefore be considered as a ceiling rather than a promise. It assumes that the parallel part is perfectly scalable and there are no coordination costs but real parallel code has to deal with communication, synchronization and memory conflicts which cause the result to fall below the curve.

It is also assumed that the processor is the bottleneck; if memory, disk or network are the limiting factors then adding more cores will not provide significant benefits until the time predicted by the algorithm is reached. Also many programs have a fixed number of threads hard-coded and different tasks within the same program often have different scaling factors so a single value for P may only be an average.

This calculator is for planning and teaching purposes only. The actual acceleration ratio will depend on your code, hardware, and specific workload. So be sure to run measurements on your own system before making purchasing or design decisions.

Frequently asked questions

Why does adding more processors eventually stop being beneficial?

Since the serial part of a program never gets faster, the fixed time taken by the serial part dominates once the parallel part is sped up. Thus, the gain per added processor falls, which is referred to as diminishing returns according to Amdahl's law.

What is the maximum acceleration ratio I can achieve?

The upper limit is 1 divided by the serial fraction, so that's 1 divided by (1 - P). If a program has 10 percent of its time spent in a serial part, then you can only get up to 10 times speedup even if you have infinite processors. The calculator shows this upper limit based on your parallel fraction.

How do I find the parallel fraction of a program?

Do the measurements. Measure the execution time for the task with one core and several cores, calculate the actual acceleration ratio, then leave the field for parallel part blank. Enter the measured acceleration ratio and number of processors. The calculator will compute P that you can use to estimate performance on other hardware.

What is the difference between Amdahl's Law and Gustafson's Law?

Amdahl's Law assumes a fixed problem size and predicts an upper bound on the speedup. Gustafson's Law assumes that the problem grows with the number of processors and thus gives more optimistic, approximately linear speedups. Amdahl's Law is good for speeding up fixed tasks while Gustafson's Law is suitable for workloads which can be scaled.

Does Amdahl's Law take actual overhead costs into account?

No. It is an idealized upper bound that assumes perfect parallelization and no communication, synchronization or storage costs, with the processor being the bottleneck. The actual speedup will be below this curve so results should be considered a best-case scenario.

Related calculators

Disclaimer: This calculator is provided for general informational and educational purposes only. Our calculators are under active development, and results may be inaccurate, incomplete, or unsuitable for your situation. Always verify the figures independently and seek advice from a qualified professional before relying on them. We make no warranties and accept no liability for any loss or decision arising from use of this tool.

References

  1. Gene M. Amdahl, Validity of the Single Processor Approach (1967)

    The original AFIPS paper that introduced the argument now known as Amdahl's Law.

  2. Wikipedia: Amdahl's Law

    Derivation, the speedup ceiling, and the relationship to Gustafson's Law.

  3. Wikipedia: Gustafson's Law

    The scaled-workload counterpart used for the comparison in this calculator.