LearnViz CompSci
Home / Learn / Concurrency & Parallelism / Parallel Reduction

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

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Concurrency & Parallelism quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Parallel Reduction?
Combining many values using a tree of operations. It belongs to Concurrency & Parallelism and is an intermediate-level topic.
Where do people use Parallel Reduction?
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.
What is the most common mistake with Parallel Reduction?
Floating-point addition is not associative, so results can differ from run to run and from the sequential order, which matters for reproducibility.
What should I learn before this topic?
Start with Fork-Join Model, the topic just before it in Concurrency & Parallelism.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Concurrency & Parallelism quiz.
Is Parallel Reduction hard to learn?
It is an Intermediate topic. Be comfortable with the Beginner topics in this area first, then read the common pitfall carefully, since it is where most mistakes happen.
How long does it take to learn Parallel Reduction?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Parallel Reduction?
Fork-Join Model, Parallel Prefix Sum, Task Parallelism are closely connected. The full list is in the related topics section of this page.
What should I study after Parallel Reduction?
Continue with Parallel Prefix Sum, the next topic in Concurrency & Parallelism.

Related topics