AI Infra Interviews logo
Reading performance · free reference

Shared-memory bank conflict

A bank conflict occurs when a shared-memory instruction requests different addresses that the hardware must serve through the same bank, requiring additional service steps.

Bank conflictShared memory padding

How it works

For a simplified 32-bank layout with four-byte words, word index modulo 32 selects the bank. Consecutive words distribute across banks; a stride of 32 words maps different addresses to the same bank. Supported same-address broadcasts are a separate case.

Work through an example

A row-major 32 × 32 FP32 tile read down a column maps all 32 words to one bank in this model. Padding rows to 33 words distributes that column across 32 banks.

Change one address pattern

The padding fix, one lane at a time

One warp reads 32 distinct four-byte words from 32 shared-memory banks. Watch which bank each lane uses.

lane 00
lane 10
lane 20
lane 30
lane 40
lane 50
lane 60
lane 70
lane 80
lane 90
lane 100
lane 110
lane 120
lane 130
lane 140
lane 150
lane 160
lane 170
lane 180
lane 190
lane 200
lane 210
lane 220
lane 230
lane 240
lane 250
lane 260
lane 270
lane 280
lane 290
lane 300
lane 310
1banks touched
32×maximum distinct words per bank
Teaching model: bank = word index mod 32. All addresses here are distinct, so same-address broadcast is excluded. Wider accesses and specialized instructions need their own mapping. This is not a runtime predictor.
Predict it: what changes from stride 32 to 33?

Stride 32 sends 32 different words to one bank. Stride 33 sends one word to each of 32 banks. Padding changes the mapping, while using one extra word of storage per row.

Where the term can mislead

Padding consumes storage and can affect other access paths. Wider accesses and specialized instructions require their actual bank mapping, not this simplified rule alone.

Connect the idea

Take it into practice

Continue with the existing concept, apply it to an interview problem, or follow a course lesson. Access requirements are shown before you open a page.

New to GPUs? Start with the free execution-model concept.

Sources and scope

Examples here are teaching calculations, not measured GPU performance. Consult the linked documentation for the exact device, instruction and tool version. Source review: 25 October 2026.

  1. NVIDIA CUDA C++ Best Practices Guide ↗