Home Knowledge Base Parallel Reduction

Parallel Reduction — a fundamental parallel algorithm that combines N elements into a single result (sum, max, min, product) using $O(\log n)$ steps instead of $O(n)$ sequential steps.

Sequential vs Parallel

Tree Reduction

Step 1: [a0+a1] [a2+a3] [a4+a5] [a6+a7]  (4 additions in parallel)
Step 2: [s01+s23]       [s45+s67]          (2 additions in parallel)
Step 3: [s0123+s4567]                      (1 addition — final result)

GPU Implementation (CUDA)

__shared__ float sdata[256];
sdata[tid] = input[i];
__syncthreads();
for (int s = blockDim.x/2; s > 0; s >>= 1) {
    if (tid < s) sdata[tid] += sdata[tid + s];
    __syncthreads();
}

Optimizations

Applications

Parallel reduction is one of the most important parallel primitives — it appears as a building block in countless parallel algorithms.

parallel reductionreduction operationparallel sum

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.