What is Streaming multiprocessor?

On NVIDIA GPUs, a unit bundling arithmetic units, registers, shared memory and warp-scheduling circuitry. A GPU is built from many SMs.

Field: GPU Programming

Japanese name: ストリーミングマルチプロセッサ

GPU thread hierarchy and assignment to SMs Grid B0 B1 B2 B3 B4 B5 Block Warp 0 Warp 1 Warp 2 Warp (32 threads) Same instruction in lockstep Threads grouped by 32 Each block goes to an SM SM0 B0 B3 Shared memory SM1 B1 B4 Shared memory SM2 B2 B5 Shared memory Global memory (read/write from all blocks) A block runs on one SM and cooperates via shared memory
GPU thread hierarchy and assignment to SMs · View in diagrams

What an SM contains

An NVIDIA GPU is built as an array of many SMs. Each SM has a register file, circuits that perform arithmetic, and storage that serves as shared memory and L1 cache. It also contains schedulers that decide which warp issues its next instruction. The SM manages and executes threads in warps of 32. Its role resembles that of a CPU core, but it holds far more threads at once.

How blocks and warps are assigned

When a kernel is launched, the blocks of the grid are distributed to SMs that have capacity. One block runs on one SM, and one SM can hold several blocks at the same time. The SM partitions the blocks it receives into warps. A scheduler picks warps that are ready and issues their instructions. When a block finishes, the next block is placed on the freed SM.

Why switching is fast

The state of every warp on an SM stays on the SM until the warp finishes. Registers are allocated per warp and shared memory per block. Switching from one warp to another therefore costs nothing extra. Even when some warps are waiting for memory, the SM can keep its arithmetic units busy with instructions from other warps. How many warps fit at once depends on the registers and shared memory the kernel uses.

Try it: questions about Streaming multiprocessor

In CUDA, what is the relationship between blocks and SMs (streaming multiprocessors)?

  1. AA block's threads are spread across all SMs
  2. BThe number of blocks must always equal the number of SMs
  3. CEach block is assigned to one SM and runs there to completion, and one SM may hold several blocks at once
Show answer and explanation

Answer: C. Each block is assigned to one SM and runs there to completion, and one SM may hold several blocks at once

A GPU has many SMs and assigns a kernel's blocks to free SMs in turn. A block runs on one SM, so its threads can use that SM's shared memory and synchronize. Launching many more blocks than SMs keeps every SM busy regardless of the GPU's size, with the next block assigned to whichever SM finishes.

FAQ

Does the same program run on GPUs with different numbers of SMs?

Yes. Blocks must be written to execute independently, so the GPU can hand them to free SMs one after another. On a GPU with more SMs, more blocks make progress at the same time.

Is an SM the same as a CPU core?

Its role is similar, but it is built differently. A CPU core advances a small number of threads as fast as possible. An SM holds many warps and switches among them to raise total throughput.

Books on GPU Programming Ad

As an Amazon Associate I earn from qualifying purchases.

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary