Kahibaro
Discord Login Register

Gustafson’s Law

Intuition Behind Gustafson’s Law

Amdahl’s Law assumes that the total problem size stays fixed as you increase the number of processors. This is useful for some questions, but in many realistic HPC scenarios you do increase the problem size when more resources are available (e.g., higher resolution, more time steps, larger datasets).

Gustafson’s Law starts from this different viewpoint:

So instead of “How much faster is my code for the same problem?”, we ask “How much more work can I do in the same time?” This often produces a much more optimistic and realistic view of parallel scalability for large-scale HPC workloads.

Formal Statement and Equation

Let:

Gustafson’s Law defines the scaled speedup $S_G$ as:

$$
S_G = P - \alpha (P - 1)
$$

You will often see it written equivalently as:

$$
S_G = \alpha + (1 - \alpha) P
$$

These two forms are algebraically identical:

So the overall scaled speedup is a weighted sum of these contributions.

Comparing to Amdahl’s Law

Recall that Amdahl’s Law (fixed problem size) says:

$$
S_A = \frac{1}{\alpha + \frac{1 - \alpha}{P}}
$$

Key conceptual differences:

The same $\alpha$ can imply a modest speedup under Amdahl’s Law, but a much more encouraging scaled speedup under Gustafson’s Law when you scale the problem.

Deriving Gustafson’s Law (Conceptually)

Work with normalized time on the parallel system:

  1. Assume the parallel runtime is normalized to 1 unit of time:
    • Serial work time on the parallel machine: $\alpha$.
    • Parallel work time on the parallel machine: $(1 - \alpha)$.
  2. On a single processor, that same amount of work would take:
    • Serial work: still $\alpha$ (no change).
    • Parallel work: now cannot be divided across processors, so it takes $P$ times longer:
      $$
      P (1 - \alpha)
      $$
  3. So the total single-processor time is:
    $$
    T_1 = \alpha + P (1 - \alpha)
    $$
  4. The parallel time (on $P$ processors) is normalized to:
    $$
    T_P = 1
    $$
  5. The scaled speedup is:
    $$
    S_G = \frac{T_1}{T_P} = \alpha + P (1 - \alpha)
    $$

Which is the Gustafson’s Law expression.

Numerical Examples

Example 1: Moderate serial fraction

Take:

Gustafson’s Law:

$$
S_G = \alpha + (1 - \alpha) P = 0.1 + 0.9 \times 16 = 0.1 + 14.4 = 14.5
$$

Interpretation: With 16 processors, you can solve a problem about 14.5 times larger in the same time as the 1-processor version would need for that larger problem.

Compare to Amdahl’s Law for the same $\alpha$:

$$
S_A = \frac{1}{0.1 + \frac{0.9}{16}}
= \frac{1}{0.1 + 0.05625}
\approx 6.4
$$

Example 2: Small serial fraction, many processors

Let:

Then:

$$
S_G = 0.01 + 0.99 \times 1024 \approx 0.01 + 1013.76 \approx 1013.77
$$

Even with 1% serial work, you can achieve a very large scaled speedup: you can use 1024 cores to handle a problem ~1000× larger in the same wall-clock time.

Interpretation in Real HPC Workloads

In many HPC applications (e.g., simulations, large-scale data analysis), practitioners do the following when more cores are available:

All of these effectively increase the parallel portion of the workload while keeping the serial overhead (I/O, setup, global coordination) relatively small. This is exactly the scenario that Gustafson’s Law models: scaled problem sizes.

Implications:

Limitations and Assumptions

Although Gustafson’s Law is optimistic, it also relies on assumptions that can be violated in practice:

  1. Serial fraction $\alpha$ remains small and does not grow with $P$
    • In reality, some overheads (synchronization, communication, I/O) may increase with the number of processors.
    • This can effectively increase the serial (or non-scalable) portion.
  2. The problem can be meaningfully scaled
    • Not all problems have a natural way to “just make them bigger” while still being scientifically or practically useful.
    • Some applications genuinely care about fixed-size speedup.
  3. Parallel work scales efficiently
    • Gustafson’s formula does not explicitly model communication costs, load imbalance, or memory limits.
    • In practice, these reduce the effective parallel fraction as $P$ grows.
  4. Homogeneous processors and ideal scheduling
    • The model assumes identical processors and perfect distribution of parallel work.
    • Heterogeneous systems and real-world scheduling can degrade scalability.

Gustafson’s Law should therefore be seen as a best-case guideline for scaled problems rather than a strict prediction.

Practical Use in HPC Planning

In practical HPC discussions, Gustafson’s Law helps to:

When you perform scaling studies, Gustafson’s viewpoint corresponds to weak scaling behavior: keeping runtime (or runtime per unit of work) approximately constant while increasing problem size and resources together.

Relationship to Other Parallel Concepts

Within the broader context of parallel computing concepts:

Gustafson’s Law provides the theoretical optimistic limit of what weak scaling can achieve under ideal conditions, assuming the serial fraction stays small and overheads are controlled.

Views: 12

Comments

Please login to add a comment.

Don't have an account? Register now!