Home
ArenaGraphSignalTopics
/Large Language Model Infrastructure: Building and Deploying Production AI Systems
Chapter 2 • Module 1 9 min breakdown +15 XP Module

Modern GPU Architecture: Streaming Multiprocessors, Tensor Cores, and VRAM Hierarchy

To engineer high-performance Large Language Model (LLM) serving systems, infrastructure engineers must understand the physical hardware silicon executing the tensor operations. Modern generative AI is not bottlenecked by general-purpose CPU compute; it is governed by the specialized microarchitecture of massively parallel accelerators—predominantly NVIDIA Hopper (H100/H200), NVIDIA Blackwell (B200), and AMD Instinct (MI300X) GPUs.

Every architectural decision in LLM serving frameworks like vLLM, TensorRT-LLM, and TGI—from PagedAttention and continuous batching to FlashAttention kernel fusion—is an explicit accommodation for the memory hierarchies, compute units, and execution models of these accelerators.

Interactive Blueprint
Rendering diagram...

1. Silicon Microarchitecture: Streaming Multiprocessors (SMs)

At the silicon level, a GPU is an array of independent compute engines called Streaming Multiprocessors (SMs). The execution model is SIMT (Single Instruction, Multiple Threads).

A. The Anatomy of an SM

In the NVIDIA Hopper GH100 architecture:

  • The GPU die features 132 to 144 SMs (depending on die binning and yield).
  • Each SM contains:
    • 4 Warp Schedulers: Capable of dispatching instructions across warps every clock cycle.
    • 128 FP32 CUDA Cores: Standard floating-point ALU units.
    • 4 Fourth-Generation Tensor Cores: Matrix multiply-accumulate engines.
    • 256 KB Register File: Ultra-fast storage holding variable states for active threads.
    • 228 KB Unified L1 Data Cache / Shared Memory (SRAM): Software-managed on-chip scratchpad.
    • Asynchronous Data Transfer Engine (TMA - Tensor Memory Accelerator): Hardware block that transfers multidimensional tensors directly from global HBM memory into shared memory without consuming SM register or ALU cycles.
Interactive Blueprint
Rendering diagram...

B. Warps and Warp Scheduling

Threads in CUDA are executed in locked lockstep groups of 32 threads known as a Warp.

  1. Warp Divergence: If threads within the same warp take different branches of a conditional (if/else), the SM must serialize both paths, disabling inactive threads with an execution mask. This cuts execution throughput by 50% or more. High-performance LLM kernels avoid conditional branch divergence within warps.
  2. Latency Hiding: GPUs lack the massive out-of-order execution logic and branch predictors found in CPUs. Instead, GPUs hide high-latency operations (like global memory loads taking 200–400 cycles) by context-switching between warps instantaneously (in 0 cycles) as long as other warps have ready instructions.

2. Tensor Cores: The Engine of Matrix Multiplication

Standard CUDA cores perform one floating-point scalar multiply-add operation per clock cycle (). In contrast, Tensor Cores execute matrix multiply-accumulate (MMA) operations directly at the hardware gate level in a single cycle:

Where and are small sub-matrices (e.g., or ), and and are accumulator matrices.

Interactive Blueprint
Rendering diagram...

Generational Evolution of Tensor Cores

GPU ArchitectureProcess NodeFP16/BF16 Tensor TFLOPSFP8 Tensor TFLOPSMemory BandwidthKey Hardware Innovations
Volta (V100)12nm FFN125 TFLOPSN/A900 GB/s (HBM2)1st Gen Tensor Cores (FP16 only)
Ampere (A100)7nm (TSMC)312 TFLOPSN/A2,039 GB/s (HBM2e)3rd Gen Tensor Cores, TF32, Sparse 2:4 support
Hopper (H100 SXM)4N (TSMC)989 TFLOPS1,978 TFLOPS3,350 GB/s (HBM3)4th Gen Tensor Cores, FP8 Transformer Engine, TMA, DPX
Hopper (H200 SXM)4N (TSMC)989 TFLOPS1,978 TFLOPS4,800 GB/s (HBM3e)141 GB HBM3e Capacity expansion for massive KV caches
Blackwell (B200)4NP (TSMC)2,250 TFLOPS4,500 TFLOPS (FP4: 9,000)8,000 GB/s (HBM3e)5th Gen Tensor Cores, 4-bit Floating Point (FP4), Dual-Die NV-HighBand
AMD MI300X5nm/6nm Chiplet1,300 TFLOPS2,610 TFLOPS5,300 GB/s (HBM3)192 GB Unified HBM3, CDNA 3 Architecture

3. The GPU Memory Hierarchy

Understanding memory latency and bandwidth across the storage tiers on the GPU die is critical for diagnosing performance bottlenecks.

Interactive Blueprint
Rendering diagram...

Why SRAM (Shared Memory) Matters

When a CUDA kernel executes on an SM:

  • Fetching data from HBM3 (Global VRAM) incurs a penalty of over 300 clock cycles.
  • Fetching data from Shared Memory (SRAM) takes fewer than 30 cycles.
  • The fundamental speedup of FlashAttention is moving sub-matrices of Query, Key, and Value tensors into on-chip SRAM once, computing Softmax and output reductions entirely within SRAM, and writing back to HBM only once.

4. Arithmetic Intensity and the Roofline Model

To predict whether an LLM workload is bottlenecked by compute units (Tensor Cores) or memory transfer speed (HBM bandwidth), engineers use Arithmetic Intensity ():

The Roofline Model defines the maximum attainable performance () of a GPU kernel:

Where:

  • is the theoretical maximum compute throughput (e.g., FLOPs/sec for H100 FP16).
  • is the memory bandwidth ( Bytes/sec for H100 HBM3).
Interactive Blueprint
Rendering diagram...

The Ridge Point

The Ridge Point () is the critical arithmetic intensity where a kernel transitions from being memory-bandwidth bound to compute bound:

  • If : The workload is Memory-Bound (e.g., autoregressive token generation with batch size 1 has ). The Tensor Cores sit largely idle waiting for weights to stream from HBM.
  • If : The workload is Compute-Bound (e.g., prompt prefill phase with batch size and context length has ). The GPU achieves maximum TFLOPS.

When LLM weights exceed the memory capacity of a single GPU, the model must be partitioned across multiple GPUs using Tensor Parallelism (TP) or Pipeline Parallelism (PP). Inter-GPU communication bandwidth dictates the scalability of these techniques.

Interactive Blueprint
Rendering diagram...

Bandwidth Comparison

Interconnect TypeGeneration / StandardPeak Unidirectional BandwidthPeak Bidirectional BandwidthTypical Roundtrip LatencyRecommended Use Case
PCIe Gen4 x16PCI-SIG 4.031.5 GB/s63 GB/s~1.5 Host-to-Device data staging
PCIe Gen5 x16PCI-SIG 5.063 GB/s126 GB/s~1.2 Model weight loading from NVMe
NVLink 3 (A100)Custom SerDes300 GB/s600 GB/s~0.4 Tensor Parallelism (TP )
NVLink 4 (H100)Custom SerDes450 GB/s900 GB/s~0.2 Megatron-LM All-Reduce in TP
NVLink 5 (B200)Custom SerDes900 GB/s1,800 GB/s~0.15 Intra-rack 72-GPU unified memory domain
InfiniBand NDRQuantum-250 GB/s (400 Gbps)100 GB/s~1.0 Multi-node Pipeline/Data Parallelism

6. Real-World Architecture Benchmark Script

The following Python script interrogates the local CUDA device to inspect SM topology, compute capability, memory clock rates, and theoretical peak memory bandwidth.

python
Loading code editor...

7. Production Failure Modes and Troubleshooting Runbook

Failure Mode 1: Tensor Core Inefficiency Due to Matrix Dimension Misalignment

  • Symptom: Custom CUDA kernels or unpadded linear projections exhibit a 60–75% reduction in TFLOPS compared to cuBLAS benchmarks.
  • Root Cause: Tensor Cores require matrix dimensions () to be exact multiples of warp tile dimensions (e.g., multiples of 8 or 16 in FP16, and multiples of 16 or 32 in FP8). If a vocabulary size or hidden dimension is not divisible by 16 (e.g., ), the compiler falls back to slow scalar CUDA core instructions or injects expensive boundary padding.
  • Resolution: Always pad vocabulary dimensions and linear layers to the nearest multiple of 64 or 128 (e.g., expand from to ).

Failure Mode 2: Multi-GPU TP Bottleneck via PCIe Fallback

  • Symptom: Scaling a 70B parameter model from 1 GPU to 4 GPUs using Tensor Parallelism causes Time Per Output Token (TPOT) to increase from 30ms to 95ms instead of speeding up.
  • Root Cause: The 4 GPUs are hosted on consumer or cloud PCIe slots without NVLink bridge interconnects. Tensor Parallelism executes two All-Reduce operations per transformer layer. Over PCIe Gen4 (), inter-GPU communication latency () overwhelms the compute savings.
  • Resolution: Restrict Tensor Parallelism () exclusively to nodes with high-speed NVLink fabrics (e.g., SXM5 HGX nodes). On PCIe-only clusters, use Pipeline Parallelism or pure Data Parallel serving instead.

8. Summary & Architectural Key Takeaways

  1. The SM is the Fundamental Compute Unit: GPU performance is a function of SM count, warp scheduler efficiency, and register occupancy.
  2. Tensor Cores Multiply Matrices at the Silicon Level: FP8 and FP16 MMA operations provide 5x–10x higher compute density than traditional FP32 CUDA cores.
  3. The Memory Wall Dominates Inference: HBM3 memory bandwidth () is orders of magnitude slower than on-chip SRAM (). LLM generation speeds are fundamentally bounded by how fast weights and KV cache tensors can be streamed from HBM.
  4. NVLink is Mandatory for Low-Latency Tensor Sharding: Distributing sub-matrices across GPUs requires hundreds of gigabytes per second of interconnect bandwidth to hide communication overhead behind computation.
Milestone Verification

Ready for the next lesson?

Mark this module complete to record verified progress and earn +15 XP toward your architect profile.