liveBook · Manning

Tile size

As explained in Grokking GPU Programming

Tile size is the number of rows and columns in a tile used by a tiled computation.

When multiplying matrices in tiles, tile size is the number of elements along one edge of each square tile. A tile size of 32 means each tile contains 32 × 32 elements. The computation processes matching chunks of the input matrices and accumulates partial results. section 12.3

Figure 12.7 Splitting one dot product into per-tile partial sums. Row i of A and column j of B are cut into T-element segments; segments that share a tile number (0, 1, …, last) are multiplied together and accumulated, one pair at a time. Summing the partial results gives the same answer as computing the full dot product for C[i][j] at once.

A matrix product can be computed by accumulating partial dot products from matching tile-sized segments. section 12.3

In a one-element-per-thread CUDA kernel, match both block dimensions to the tile size: a 32 × 32 tile needs a 32 × 32 block. A smaller block leaves tile entries unloaded; a larger one can overwrite entries or write beyond the shared-memory arrays. Larger tiles also face hardware limits: a 64 × 64 tile needs 4,096 threads, above the 1,024-thread block limit. section 12.4 section 12.13

How Grokking GPU Programming covers it

How deep it goes
Defines tile size and relates it to thread-block matching and hardware limits, without comparing performance across tile sizes.
Examples
Uses 32 × 32 tiles, mismatched 16 × 16 blocks, and 64- and 128-element tiles to illustrate loading errors and limits.
What you can do after
Configure a one-element-per-thread tiled kernel by matching block dimensions to tile size and checking thread and shared-memory limits.
How it connects
Connects matrix multiplication with shared memory, thread blocks, CPU cache reuse, and distributed-memory algorithms.

Also explained in

Compare how 2 books explain tile size →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking GPU Programming. The section links point to the parts of the book it draws on.