Intermediate Topic 33 of 51 Concurrency & Parallelism
Parallel Reduction
Combining many values using a tree of operations.
How it works
A parallel reduction combines many values into one using an associative operator such as sum, minimum, maximum or logical and. Each worker reduces its chunk locally, then partial results are combined in a tree, taking O(n over p plus log p) time with p processors, instead of serial accumulation to a single variable. GPU reductions use shared memory within a block and then combine block results. Associativity allows regrouping, and commutativity allows reordering.
Where it is used
Computing sums and averages over large arrays, finding maxima, dot products in numerical code, counting histograms, gradient aggregation in distributed training with all-reduce and MapReduce reduce phases use parallel reduction.
Common pitfall
Floating-point addition is not associative, so results can differ from run to run and from the sequential order, which matters for reproducibility. Using a shared accumulator with locks or atomics serializes the work. Operators must be associative, or the answer is wrong. Divergent threads and bank conflicts hurt GPU reductions. Use library primitives such as OpenMP reduction clauses and Thrust.
Where it fits in the course
Parallel Reduction is topic 33 of 51 in Concurrency & Parallelism, rated Intermediate. It follows Fork-Join Model. The next topic is Parallel Prefix Sum.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Concurrency & Parallelism quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Concurrency & Parallelism quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Parallel Reduction?
Where do people use Parallel Reduction?
What is the most common mistake with Parallel Reduction?
What should I learn before this topic?
How can I practice it?
Is Parallel Reduction hard to learn?
How long does it take to learn Parallel Reduction?
Which topics are related to Parallel Reduction?
What should I study after Parallel Reduction?
Related topics
- Fork-Join Model (Concurrency & Parallelism)
- Parallel Prefix Sum (Concurrency & Parallelism)
- Task Parallelism (Concurrency & Parallelism)
- OpenMP (Concurrency & Parallelism)
- Dimensionality Reduction (AI & Machine Learning)