← All questions
Inference & ServingHard· GPU Architecture· CUDA· Performance

An A100 has 108 SMs. Your kernel launches 109 thread bl...

With 108 SMs, 108 blocks execute in the first wave. The 109th block must execute alone in a second wave, utilizing only 1/108th of the GPU’s capacity. This makes the total execution time approximately double that of a single wave, rather than the ideal 1.009x. To fix this, you should ensure the grid size is a multiple of 108. This can be achieved by coarsening the tile size to reduce the total block count to 108, or by padding the problem dimension so that the grid size becomes 216, ensuring the added work is trivial.

Code playground (Python)