Skip to main content
Home › Categories › Artificial Intelligence & Computing › How AI GPUs, Tensor Cores, and High-Bandwidth Memory (HBM) Accelerate Neural Networks

How AI GPUs, Tensor Cores, and High-Bandwidth Memory (HBM) Accelerate Neural Networks

Author: ZUVDEX Team 4 min read
how ai gpus and tensor cores work tensor cores vs cuda cores high bandwidth memory hbm3e roofline model arithmetic intensity nvlink vs infiniband vs pcie flashattention sram tiling

Modern AI GPUs are massively parallel throughput processors engineered around three tightly coupled subsystems: thousands of Tensor Cores that execute mixed-precision matrix-multiply-accumulate (`D = A × B + C`) operations in a single clock cycle; 3D-stacked High-Bandwidth Memory (HBM3e/HBM4) feeding terabytes of neural weights per second across silicon interposers; and ultra-fast NVLink and RDMA network fabrics synchronizing gradients and activations across multi-node clusters.

Key Highlights

  • CPUs dedicate silicon area to branch prediction, out-of-order execution, and huge L3 caches for sequential single-thread speed; GPUs dedicate silicon to thousands of parallel ALUs hiding memory latency across tens of thousands of threads.
  • Tensor Cores accelerate General Matrix Multiplication (GEMM)—which accounts for >90% of Transformer training and prefill FLOPs—supporting BF16, FP16, FP8, and microscaled FP4.
  • Moving two numbers from off-chip DRAM into an ALU consumes roughly 100× more picojoules of energy and far more time than multiplying them—the physics known as the Memory Wall.
  • The Roofline Model explains why LLM prefill is compute-bound (high FLOPs per byte) while batch-1 autoregressive token decoding is strictly HBM memory-bandwidth-bound.

1. Latency Engines (CPUs) vs Throughput Engines (GPUs) vs Tensor Cores

A server CPU is like a Formula 1 car: built to carry one complex, branch-heavy operating-system or database transaction through conditional `if/else` forks at minimum single-thread latency. An AI GPU is a bullet train carrying 50,000 passengers along identical parallel tracks simultaneously (`SIMT`—Single Instruction, Multiple Threads).

Even standard GPU scalar CUDA/Stream cores perform one fused multiply-add (`a * b + c`) per clock per lane. Dedicated Tensor Cores go much further: operating on entire 4×4 or larger sub-matrices per instruction in reduced precision (BF16, FP8, or FP4 accumulated into FP32), delivering 4× to 16× higher math throughput per watt.

2. The GPU Memory Hierarchy and Why FlashAttention Changed Everything

To understand why AI chips cost tens of thousands of dollars and why kernel engineers obsess over memory tiling, look at the dramatic bandwidth cliff across a GPU’s memory tiers:

Typical Data-Center AI GPU Memory & Interconnect Hierarchy
Memory / Link Tier Typical Capacity Approximate Bandwidth Engineering Role in LLM Execution
SM Registers & Shared SRAM 256 KB per SM (~30–50 MB total) ~25–35+ TB/s Holds active matrix tiles inside fused kernels (FlashAttention)
L2 On-Die Cache 50–128 MB ~6–12 TB/s Buffers shared KV-cache prefixes and hot tensor slices
On-Package HBM3e / HBM4 80 GB to 288 GB per GPU 3.3 to 8.0+ TB/s Stores full LLM weights, optimizer states & dynamic KV caches
NVLink (Intra-Rack Scale-Up) Pools 8 to 72 GPUs 900 to 1,800 GB/s per GPU Enables low-latency Tensor Parallelism across a single huge model
PCIe Gen5 (Host CPU ↔ GPU) System DDR5 RAM ~128 GB/s bidirectional 50× slower than HBM—offloading weights here stalls token speed

The Roofline Model: Compute-Bound Prefill vs Bandwidth-Bound Decode

Suppose a 70B model in FP8 occupies 70 GB of HBM on a GPU with 3.5 TB/s of memory bandwidth. Generating just one output token for a single user requires streaming all 70 GB of weights from HBM into SRAM once: `70 GB ÷ 3,500 GB/s = 20 milliseconds` (a theoretical ceiling of 50 tokens/sec—regardless of whether the chip has 1,000 TFLOPS or 10,000 TFLOPS!). Batching 32 concurrent user requests together reuses each weight load across 32 tokens simultaneously, lifting arithmetic intensity back toward the compute roof.

FAQs

Why does HBM memory cost so much more than regular DDR5 or GDDR6?

HBM stacks 8 to 16 thinned DRAM dies vertically like a skyscraper, drills thousands of microscopic Through-Silicon Vias (TSVs) straight through the silicon, and bonds the stack onto a precision silicon interposer (CoWoS) millimeters from the GPU die—achieving a 1,024-bit+ bus per stack at fractionally lower power per bit.

Can RoCEv2 Ethernet compete with InfiniBand for AI training clusters?

Yes. Modern Ultra Ethernet / RoCEv2 fabrics with adaptive packet spraying, congestion telemetry, and RDMA bypass now rival InfiniBand at multi-thousand-GPU scale while leveraging familiar Ethernet switching ecosystems.

What is Speculative Decoding and how does it beat the HBM bandwidth wall?

Speculative decoding uses a tiny 1B draft model (or lightweight prediction heads) to guess 4–6 upcoming tokens rapidly, then verifies all 5 tokens in a single parallel forward pass of the 70B target model—reading the 70 GB weights once instead of five times and accelerating generation by 1.8×–2.5× with mathematically identical output.

References & Sources

  • Williams, S.; Waterman, A.; Patterson, D. — Roofline: An Insightful Visual Performance Model for Multicore Architectures, Communications of the ACM.
  • Dao, T. et al. — FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness, NeurIPS.
  • JEDEC Solid State Technology Association — High Bandwidth Memory (HBM3 / HBM4) DRAM Specifications.
  • Shoeybi, M. et al. — Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism.