3. Types of Parallelism (DLP, ILP, TLP) and Flynn's Taxonomy
Description
Parallelism means doing multiple operations at once to raise throughput and cut run time. Architects exploit it at different levels:
| Level | Full name | What runs in parallel | Typical hardware |
|---|---|---|---|
| DLP | Data-Level Parallelism | Same operation on many data items | SIMD units, vector processors, GPUs |
| ILP | Instruction-Level Parallelism | Independent instructions from one thread | Pipelines, superscalar, out-of-order cores |
| TLP | Thread-Level Parallelism | Multiple threads/processes | Multicore CPUs, SMT (hyper-threading) |
| RLP | Request-Level Parallelism | Independent user requests | Warehouse-scale computers |
Strengths and drawbacks:
- DLP: high throughput, energy efficient for regular numeric work; suffers from irregular data and control divergence (branches in GPU threads).
- ILP: speeds up single-thread code with no programmer effort; diminishing returns from dependences and mispredicted branches, and complex hardware.
- TLP: scales with cores; costs synchronization, shared-resource contention (caches, memory bandwidth) and harder software.
Flynn's Taxonomy (Michael Flynn, 1966) classifies machines by the number of instruction streams and data streams:
| Model | Instruction streams | Data streams | Example |
|---|---|---|---|
| SISD | 1 | 1 | Simple sequential CPU, early PCs |
| SIMD | 1 | Many | Vector units, AVX/SSE/NEON, GPUs |
| MISD | Many | 1 | Rare; redundant fault-tolerant systems |
| MIMD | Many | Many | Multicore CPUs, clusters, cloud servers |
Modern multicore CPUs are MIMD, and each core may also contain SIMD units and ILP hardware, so one chip uses all levels at once.
Key Formulas
Parallel speedup (Amdahl): S(n) = 1 / [ (1 − f) + f / n ]
Parallel efficiency: E(n) = S(n) / n
Ideal pipeline speedup: ≈ number of pipeline stages
Vector/SIMD speedup (ideal): ≈ number of lanes
Steps
To classify a machine with Flynn: (1) count independent instruction streams, (2) count independent data streams, (3) pick the cell: 1/1 SISD, 1/many SIMD, many/1 MISD, many/many MIMD.
To pick the right parallelism for a workload: (1) same op on big arrays → DLP; (2) independent instructions in a loop body → ILP; (3) independent tasks/requests → TLP/RLP.
Worked Example
- Adding two 1,000,000-element arrays element by element → DLP (SIMD). With 8 lanes the ideal speedup is ~8×.
a = b + c; d = e * f;have no dependence, so a superscalar core issues both in one cycle → ILP.- A web server serving 32 clients on 16 cores → TLP (MIMD).
- Efficiency: 8 cores give speedup 5.93 (95% parallel) → E = 5.93/8 ≈ 74%; 64 cores give 15.4/64 ≈ 24%. More cores, diminishing returns.
- Classify: GPU shader running one program on many pixels → SIMD (more precisely SIMT); lock-step triple-redundant flight computer comparing results → MISD in concept.
Python / Assembly
import numpy as np
from concurrent.futures import ProcessPoolExecutor
# DLP: one vectorized operation over all elements (NumPy uses SIMD underneath)
a = np.arange(1_000_000, dtype=np.float64)
b = np.arange(1_000_000, dtype=np.float64)
c = a + b # replaces a Python loop
# TLP: CPU-bound work needs processes (Python threads share the GIL)
def work(n):
return sum(i * i for i in range(n))
if __name__ == "__main__":
with ProcessPoolExecutor() as pool:
print(list(pool.map(work, [10**6] * 4)))
ILP in assembly: independent instructions can issue together; dependent ones cannot.
add x5, x1, x2 # independent of the next line
mul x6, x3, x4 # can execute in the same cycle on a superscalar core
add x7, x5, x6 # depends on both, must wait (RAW)
Notes
- SIMD vs SIMT: GPUs run thousands of threads in groups (warps) that execute one instruction together; programmers write per-thread code, hardware does the SIMD grouping.
- Python threads do not speed up CPU-bound code because of the Global Interpreter Lock; use processes or native code.
- Quick facts: multicore processors are MIMD; DLP uses one instruction on many data, ILP runs many instructions in parallel.
References: [HP6] Ch. 1 (1.2, 1.4), Ch. 3-5 intros; Flynn, "Very High-Speed Computing Systems," Proc. IEEE, 1966; [PH-RV] Ch. 6;
All rights remain with the original author (Algo-holics). Publishing here does not grant a license to copy or reuse this text. Copyright & license. If you noticed a mistake or copyright issues, please contact: lebroskiofficial@proton.me