IIntroduction to AI Systems Performance EngineeringTechnical textbook
Chapter 4

GPU and Accelerator Architecture

Map software work to accelerator hardware

Learn how GPUs schedule warps, supply execution pipelines, accelerate matrix operations, and move data through the memory hierarchy.

A graphics processing unit (GPU) is not simply a central processing unit (CPU) with more cores. The GPU allocates hardware resources for workloads that contain many similar, independent operations. A CPU invests heavily in reducing the completion time of a small number of instruction streams. A GPU instead keeps many groups of threads available and switches among them when an instruction must wait. Both processors execute instructions and access memory, but the processors tolerate delay in different ways.

The chapter develops the distinction from a concrete memory-load example. The later sections explain how CUDA threads become warps, how warps occupy streaming multiprocessors, how matrix engines accelerate structured operations, and how data moves through the memory hierarchy. The terms are specific enough for NVIDIA profiling tools, but the underlying model also applies to AMD compute units and other tensor accelerators.

The purpose of the chapter is prediction. By the end, you should be able to examine an operator and predict which hardware resources it needs, which conditions can prevent those resources from doing useful work, and which measurements would confirm the prediction. Later chapters will turn this architectural model into CUDA code and profiler analysis.

Prerequisites

Learning objectives

  • Predict when CPU latency mechanisms or GPU throughput mechanisms fit a workload
  • Explain how CUDA threads become blocks and 32-lane warps on an NVIDIA GPU
  • Trace matrix operands and outputs through execution pipelines and the GPU storage hierarchy
Lessons

Study this chapter

  1. 4.1
    Latency processors and throughput processors

    Given one memory-dependent workload, predict whether CPU latency reduction or GPU latency hiding is likely to matter and name the measurement that tests the prediction

    Begin lesson →
  2. 4.2
    SMs, warps, and SIMT

    Map a CUDA grid to blocks, 32-thread warps, and streaming multiprocessors and explain the visible effect of branch divergence

    Begin lesson →
  3. 4.3
    Tensor cores and matrix engines

    Explain why instruction-tile shape, operand layout, input precision, accumulator precision, and surrounding data movement limit measured matrix-kernel throughput

    Begin lesson →
  4. 4.4
    Accelerator memory hierarchy

    Assign one value to registers, block-shared memory, cache, or device memory from its owner, lifetime, reuse, and synchronization requirements

    Begin lesson →
Chapter projects

Extended exercises

Complete these projects after the lesson-level practice tasks. Each project combines several mechanisms from the chapter.

01
Check

Map an operator

For one [2,048, 4,096] normalization or projection tensor, draw the logical threads, blocks, warps, execution pipeline, and each named storage transition.

Evidence: A labeled diagram plus three sentences that predict what Nsight Systems or Nsight Compute would display.

02
Practice

Architecture compare

Compare one NVIDIA GPU and one alternative accelerator using the same matrix shape, datatype, storage capacity, measured payload bandwidth, and programming interface.

Evidence: A source-linked table that distinguishes specified peak values from measured workload values.

03
Challenge

Shape sensitivity

Benchmark one matrix multiplication across aligned, narrow, and ragged M, N, and K dimensions after warm-up.

Evidence: Raw timings, local tile counts, requested and transferred bytes where available, and an explanation of each curve change.

References

Sources and further reading

The lesson explanations synthesize primary papers and official references. Follow the originals for proofs, exact APIs, architecture details, and version-sensitive behavior.

  1. CUDA C++ Programming Guide
  2. AMD HIP Performance Guidelines
  3. In-Datacenter Performance Analysis of a TPU