MODERN SOC DESIGN · PRESENTATION 08
CXL in ML Accelerator SoCs
From Memory Expansion to Fabric-Attached Acceleration
CXL.io · CXL.cache · CXL.mem · Memory pooling · Fabric switches · Type 1/2/3 devices · SoC integration
Navigate: → ← | Overview: Esc | Fullscreen: F
04
Why CXL for ML Accelerators?
The memory wall is the dominant bottleneck in modern ML workloads
The Memory Wall
- Capacity: GPT-4-class models require >1 TB for KV-cache at scale; HBM3E tops out at 144 GB per stack
- Bandwidth: LLM decode is memory-bandwidth-bound — each token reads the entire KV-cache
- Cost: HBM at ~$10-15/GB vs DDR5 at ~$2-3/GB vs CXL-attached DDR5 at ~$3-4/GB
- Stranded memory: Fixed per-device DRAM leads to 30-40% memory waste in heterogeneous clusters
CXL's Value Proposition
- Coherent access to terabytes of shared DDR5 memory
- Cache-line granularity — no DMA descriptor overhead
- PCIe PHY reuse — leverages existing SerDes IP
- Memory pooling — dynamic allocation eliminates stranding
- Fabric scalability — CXL 3.x enables rack-scale shared memory
Key insight: CXL bridges the gap between fast-but-small HBM and large-but-remote networked memory.
--
CXL Protocol Foundation
Sub-protocols, flex bus negotiation, and the CXL version timeline
06
CXL Protocol Stack
Three sub-protocols multiplexed over a single PCIe PHY via flex bus arbitration
CXL.io (PCIe Transaction Layer)
CXL.cache (Device → Host coherency)
CXL.mem (Host → Device memory)
▼
CXL ARB/MUX (Flex Bus Arbitration)
▼
PCIe 5.0 / 6.0 PHY (32/64 GT/s per lane)
Flex Bus dynamically allocates PHY bandwidth across sub-protocols each 2 μs arbitration window.
CXL.io
Equivalent to PCIe TLP. Used for device discovery, configuration, interrupts, DMA. Required by all device types.
CXL.cache
Device caches host memory with hardware coherency. 3 channels: D2H Request, D2H Data, H2D Response. Uses MESI protocol variant. Enables accelerators to cache host data without software intervention.
CXL.mem
Host processor accesses device-attached memory (DDR, HBM) with load/store semantics. 2 channels: M2S (master-to-subordinate), S2M (subordinate-to-master). 64-byte cache-line granularity.
ARB/MUX
Multiplexes CXL.io, CXL.cache, and CXL.mem flits onto shared PCIe lanes. Supports 68B (CXL 2.0) and 256B (CXL 3.0) flit modes.
07
CXL Version Evolution
From PCIe 5.0 coherency to rack-scale fabric attach
| Version |
Year |
PHY |
Bandwidth/dir (x16) |
Key Features |
| CXL 1.0 |
2019 |
PCIe 5.0 |
64 GB/s |
CXL.io + CXL.cache + CXL.mem, 68B flits |
| CXL 1.1 |
2020 |
PCIe 5.0 |
64 GB/s |
Compliance framework, DOE extensions, security hardening |
| CXL 2.0 |
2022 |
PCIe 5.0 |
64 GB/s |
Single-level switching, memory pooling, FM-API, QoS telemetry, hot-plug |
| CXL 3.0 |
2022 |
PCIe 6.0 |
128 GB/s |
256B flits, multi-level switching, back-invalidation, global fabric attach (GFA), peer-to-peer, port-based routing (PBR) |
| CXL 3.1 |
2023 |
PCIe 6.0 |
128 GB/s |
Enhanced coherency, UIO extensions, TSP security, extended PBR, refined memory sharing semantics |
| CXL 3.2 |
Dec 2024 |
PCIe 6.0 |
128 GB/s |
Coherent Hot-Page Monitoring Unit (CHMU), enhanced TSP, Meta-bits Storage for HDM-H, device telemetry, improved OS/app memory-tiering API |
Flit Size Impact
CXL 3.0's 256B flits reduce per-flit header overhead from ~6% to ~1.5%, enabling higher effective bandwidth for bulk transfers.
PHY Bandwidth Doubling
PCIe 6.0 (64 GT/s PAM4) doubles raw bandwidth. CXL 3.0 x16 delivers 128 GB/s per direction — matching one HBM3 stack.
Backward Compatibility
CXL 3.x devices negotiate down to CXL 2.0/1.1 hosts. The flex bus handshake occurs during PCIe LTSSM training.
08
CXL.io — Discovery, Configuration & DMA
PCIe-compatible transaction layer present in every CXL device
Functions
- Device discovery: Standard PCIe enumeration — BIOS/OS sees CXL devices as PCIe endpoints with DVSEC capabilities
- MMIO & config space: BAR-mapped registers, CXL DVSEC (Designated Vendor-Specific Extended Capability) for CXL-specific negotiation
- Interrupts: MSI-X interrupt delivery for completion notifications, error reporting
- Mailbox: CXL mailbox interface for firmware commands — identify, get/set config, scan media, sanitize
- DMA: Bulk data movement for non-coherent transfers (firmware loading, telemetry extraction)
DVSEC IDs: 0x1E98 (CXL), identifying CXL capability, device type, and supported sub-protocols.
CXL.io Transaction Types
Memory Read / Write (MRd, MWr)
Config Read / Write (CfgRd0/1, CfgWr0/1)
Completion (Cpl, CplD)
Message (Msg, MsgD) — vendor-defined, error
Boot Flow
- PCIe PHY link training (LTSSM) — flex bus negotiation
- CXL DVSEC discovery — determine device type (1/2/3)
- CXL.cache/mem link initialization if applicable
- HDM (Host-managed Device Memory) decoder setup
- Memory range mapping visible to host CPU
09
CXL.cache — Device-to-Host Coherency
Enables accelerators to cache host memory lines with hardware-managed coherency
Channel Architecture
| Channel | Direction | Purpose |
| D2H Req | Device → Host | Read, ReadOwn, ItoM, CLFlush |
| D2H Resp | Device → Host | WritePull confirmation, SnpResp |
| D2H Data | Device → Host | 64B dirty/clean data writeback |
| H2D Req | Host → Device | SnpData, SnpInv, SnpCur |
| H2D Resp | Host → Device | GO, WritePull, GO-WritePull, ExtCmp |
| H2D Data | Host → Device | 64B data for read completions |
Coherency maintained via a reduced MSI-style state machine (no Exclusive state on the device side); host home agent tracks all cached lines via a snoop filter.
Snoop Flow Example
Device reads host memory line (cold miss):
1. Device sends D2H Req: RdShared(addr)
↓
2. Host home agent checks snoop filter
↓
3. Host sends H2D Resp: GO-S + H2D Data (64B)
↓
4. Device installs line in Shared state
ML Relevance
Type 2 accelerators (GPUs, NPUs) use CXL.cache to coherently access host-resident weight tensors, page tables, and scheduling queues — avoiding explicit DMA copy overhead.
10
CXL.mem — Host Access to Device Memory
Load/store access to device-attached DDR/HBM at cache-line granularity
M2S / S2M Channels
| Channel | Direction | Messages |
| M2S Req | Host → Device | MemRd, MemWr, MemSpecRd |
| M2S RwD | Host → Device | MemWrData (64B payload) |
| S2M NDR | Device → Host | Cmp (no data response) |
| S2M DRS | Device → Host | MemData (64B read data) |
Bias Modes
Host BiasHost caches device memory — device snoops host on access
Device BiasDevice controls caching — host snoops device on access
Shared BiasBoth can cache — full coherency protocol engaged
Latency Budget
PCIe PHY traversal~30-40 ns
CXL protocol overhead~20-30 ns
Device-side DRAM access~40-60 ns (DDR5)
Total CXL.mem read~150-250 ns
Local DDR5 comparison~80-100 ns
1.5-2.5x local DRAM latency — but CXL.mem enables terabytes of capacity unreachable by local DIMMs alone. For batch-tolerant ML inference, throughput matters more than per-access latency.
HDM Decoders
Host-managed Device Memory (HDM) decoders map CXL memory into the host physical address space. BIOS/firmware configures base/limit/interleave across up to 16 targets.
--
CXL Device Types
Type 1, 2, and 3 — from smart NICs to memory expanders
12
CXL Device Type Taxonomy
Three device types defined by which sub-protocols they implement
| Type |
CXL.io |
CXL.cache |
CXL.mem |
Device Memory |
Examples |
| Type 1 |
✓ |
✓ |
— |
No device-attached memory |
SmartNICs, coherent accelerators without local DRAM |
| Type 2 |
✓ |
✓ |
✓ |
Device-attached (HBM, GDDR, DDR) |
GPUs, FPGAs, ML accelerators with local memory |
| Type 3 |
✓ |
— |
✓ |
Device-attached (DDR5, persistent memory) |
Memory expanders, CXL DRAM modules, CXL PMem |
Type 1 — Coherent I/O
Device caches host memory for low-latency access. No device memory exposed to host. Ideal for SmartNICs that snoop packet buffers in host LLC.
Type 2 — Accelerator
Full bidirectional coherency. Device has its own memory and caches host memory. The critical type for ML accelerator SoCs — enables unified virtual addressing.
Type 3 — Memory Expander
No device-side caching of host memory. Host accesses device memory via CXL.mem. Simplest controller — highest density, lowest cost per GB.
13
Type 3 — CXL Memory Expanders
Expanding host-addressable memory beyond DIMM slot limitations
Architecture
Host CPU (CXL Root Port)
↕ CXL.io + CXL.mem
CXL Type 3 Controller
↕ DDR5 PHY
DDR5 DRAM (up to 2 TB per device)
Bandwidth Characteristics
CXL x16 (PCIe 5.0)~63 GB/s per direction
CXL x16 (PCIe 6.0)~126 GB/s per direction
DDR5-5600 (2ch)~89.6 GB/s
Read latency170-250 ns typical
Products & Deployments
- Samsung CMM-D: CXL 2.0 DDR5 memory module, 128 GB, E1.S form factor, deployed in hyperscale memory tiering
- SK hynix CMS: CXL Memory Semiconductor — 96 GB CXL 2.0 DRAM, PCIe 5.0 x8, <200 ns latency
- Micron CZ120: CXL 2.0 memory expander, 256 GB, E3.S, targets 4 TB per socket via pooling
- Samsung CMM-H: CXL-attached HBM, combining high bandwidth with CXL flexibility
"Type 3 memory expanders turn PCIe slots into DRAM slots — unlocking 2-4x the memory capacity of DIMM-only configurations at ~50% lower cost per GB."
14
Type 2 — CXL Accelerators for ML
Full coherency with device-attached memory — the key CXL device type for ML workloads
Why Type 2 for ML?
- Unified Virtual Memory: GPU/NPU and CPU share a single virtual address space — no explicit copies
- Coherent Host Access: Accelerator caches host-resident data (page tables, scheduling metadata) via CXL.cache
- Host-Visible Device Memory: CPU can directly read/write accelerator HBM/GDDR via CXL.mem
- Demand Paging: CXL.cache supports ATS (Address Translation Services) — enables GPU page faults resolved by host OS
Bias Mode for ML
Device Bias during compute-intensive phases (GEMM, attention) — device owns its memory, minimal snooping. Host Bias during data staging — CPU writes model weights directly into device memory.
Type 2 Architecture
Host CPU + System Memory
↕ CXL.io + CXL.cache + CXL.mem
Type 2 CXL Controller + Coherency Agent
↕
ML Compute Engine (Systolic / Tensor Core)
↕
Device-Attached HBM3 / GDDR7
SVM (Shared Virtual Memory): Type 2 enables the host and device to share page tables via ATS/PRI, eliminating pinned memory requirements and enabling oversubscription of device memory.
--
CXL Fabric & Pooling
Switches, memory pools, and rack-scale shared memory
16
CXL Switches & Fabric Topology
From point-to-point links to multi-level fabric with dynamic resource assignment
Single-Level Switch (CXL 2.0)
Host 0 | Host 1 | Host 2 | Host 3
↕ Upstream Ports
CXL 2.0 Switch + Fabric Manager
↕ Downstream Ports (Virtual CXL Switches)
Type 3 Mem | Type 3 Mem | Type 2 Accel | Type 3 Mem
Each host sees a Virtual CXL Switch (VCS) with dedicated downstream ports. Fabric Manager dynamically binds devices to hosts via MLD (Multi-Logical Device) or SLD (Single-Logical Device) model.
Multi-Level Switching (CXL 3.0+)
Host Rack 0 | Host Rack 1
↕
Level-2 CXL Switch (Spine)
↕
Level-1 Switch | Level-1 Switch
↕
Memory Pool | Accelerators | Memory Pool
Fabric Manager (FM)
- Software entity that discovers, configures, and manages CXL fabric
- Binds/unbinds device LDs to host VCS via FM-API
- Monitors link health, QoS, and handles hot-plug events
- CXL 3.0: Port-Based Routing (PBR) eliminates ID-based routing overhead
17
CXL Memory Pooling
Dynamic shared memory resources across multiple hosts — eliminating stranded capacity
Pooling Architecture
- Multi-Logical Device (MLD): A single physical Type 3 device partitioned into up to 16 Logical Devices (LDs), each assigned to a different host
- Dynamic Capacity Device (DCD): CXL 3.0 feature — host requests memory extents on demand. FM allocates from a shared pool in configurable chunk sizes (256 MB to 1 TB)
- Shared memory regions: CXL 3.0 allows multiple hosts to map the same physical memory — enables inter-host communication without network traversal
Memory utilisation improvement: Hyperscale studies (Meta, Microsoft) show CXL pooling reduces stranded memory by 18-30%, saving ~$2-4M per 10k-server cluster.
Pooling for ML Inference Clusters
Inference Host A (serving GPT-4o)
Inference Host B (serving Llama-3-70B)
Inference Host C (idle — scaling down)
↕ CXL Switch
Shared CXL Memory Pool (4 TB DDR5)
Host A dynamically allocates 1.5 TB for KV-cache. Host B uses 800 GB. When Host C goes idle, its 700 GB returns to the pool. FM reallocates to Host A within microseconds — no data migration needed via DCD.
Allocation granularity256 MB — 1 TB extents
Reallocation time~10-100 μs (FM-API)
Max hosts per pool16 (MLD), 4096+ (DCD/GFA)
18
CXL 3.x / 4.0 — Advanced Fabric Features
Back-invalidation, global fabric attach, and enhanced coherency for rack-scale ML
Back-Invalidation (BI)
Type 3 devices gain limited coherency: device can issue BISnp (Back-Invalidate Snoop) to host caches when another host writes to shared memory. Eliminates stale-data hazards in multi-host pooling without full CXL.cache complexity.
Global Fabric Attach (GFA)
Extends CXL beyond single-switch topologies. Enables multi-level, multi-switch fabrics where any host can reach any device across the fabric. Uses Port-Based Routing (PBR) — switches route by physical port rather than device ID, enabling O(1) lookup latency in switch forwarding tables.
256-Byte Flits
Doubles flit size from CXL 2.0's 68B. Reduces header-to-payload ratio, enables carrying 4x 64B cache lines per flit. Combined with PCIe 6.0, delivers 128 GB/s per direction on x16 link.
CXL 3.1 Enhancements
- TSP (TEE Security Protocol): Hardware-enforced encryption for CXL.mem traffic — essential for multi-tenant ML inference clusters
- Unified I/O (UIO): Extends CXL coherency to non-PCIe fabrics (e.g., AMBA CHI bridges)
- Extended PBR: Supports up to 4096 ports per fabric, enabling warehouse-scale CXL deployments
- Per-device QoS: Fine-grained bandwidth/latency SLAs enforced at the switch level
ML impact: CXL 3.1 GFA + DCD enables a rack of 32 inference servers to share a 64 TB memory pool, dynamically allocating KV-cache capacity per workload — approaching the memory elasticity of disaggregated storage with DRAM latency.
--
CXL for ML Workloads
KV-cache expansion, memory-bound inference, and SoC integration challenges
20
KV-Cache Expansion via CXL Memory
Offloading KV-cache to CXL-attached DRAM for long-context LLM inference
The KV-Cache Problem
- LLM inference stores key/value tensors for every token in every layer
- Llama-3.1-405B @ 128K ctx: ~161 GB KV-cache per sequence at FP16 (GQA=8, 126 layers, 16,384 hidden)
- DeepSeek-V3 @ 128K ctx (MLA): ~8 GB per sequence — ~20× smaller than MHA-equivalent
- Llama-3-405B: ~160 GB KV-cache at 128k tokens, FP16
- Batching 64 concurrent requests: 3-10 TB KV-cache — far exceeds HBM capacity
CXL Tiered Memory Approach
Tier 0: HBM3E (hot KV layers) — 80 GB, ~3.2 TB/s
Tier 1: CXL DDR5 (warm KV layers) — 2 TB, ~64 GB/s
Tier 2: CXL PMem / CXL SSD (cold KV layers) — 16 TB
Latency Analysis
| Access Tier | Latency | BW per Device |
| HBM3E | ~15-20 ns | ~1 TB/s |
| Local DDR5 | ~80-100 ns | ~90 GB/s |
| CXL DDR5 | ~170-250 ns | ~64 GB/s (x16) |
| CXL PMem | ~300-500 ns | ~20 GB/s |
Key insight: Attention is sequential per-layer during decode. Only the current layer's KV entries must be in HBM. Prefetching the next layer from CXL overlaps with compute, hiding 80-90% of CXL latency.
Research results (Meta, 2024): CXL-tiered KV-cache achieves <5% throughput degradation vs all-HBM at 4x the context length capacity.
21
Memory-Bandwidth-Bound Inference
CXL pooled memory for distributed model sharding and capacity-constrained workloads
The Bandwidth Challenge
LLM decode is fundamentally memory-bandwidth-bound: each generated token reads all model weights once. For Llama-3-70B at FP16 (140 GB weights), generating at 30 tokens/s requires 4.2 TB/s — only achievable with 4+ HBM3E stacks.
CXL for Capacity, Not Bandwidth
- CXL x16 PCIe 5.0: ~64 GB/s — insufficient alone for weight streaming
- But ideal for capacity-bound workloads: embeddings, KV-cache, activation checkpoints
- Multiple CXL links aggregate bandwidth: 4x CXL x16 = ~256 GB/s
- CXL 3.0 x16 (PCIe 6.0): ~128 GB/s — approaching DDR5 channel bandwidth
Design rule: Place compute-hot tensors (weights, attention) in HBM. Place capacity-hot but bandwidth-cold data (KV-cache, embeddings, intermediate activations) in CXL DRAM.
Pooled Model Sharding
Inference Server 0 (Layers 0-19 in HBM)
Inference Server 1 (Layers 20-39 in HBM)
↕ CXL Switch
Shared CXL Pool: Full model weights (140 GB) + KV-cache (2 TB)
Each server keeps its pipeline-parallel shard in HBM for fast GEMM execution. The shared CXL pool holds the complete model copy for failover, plus the distributed KV-cache that both servers read during cross-shard attention.
CXL vs RDMA for ML
CXL latency150-250 ns (load/store)
RDMA latency1-2 μs (verb post + completion)
CXL granularity64 B (cache line)
RDMA granularity4 KB+ (page-level practical minimum)
22
CXL SoC Integration
PHY design, controller IP, coherency bridges, and latency budgets for ML accelerator SoCs
SoC Integration Architecture
ML Compute Clusters (Tensor Cores / Systolic Arrays)
↕ On-chip NoC (AXI/CHI)
CXL Controller IP (Type 2: cache agent + mem decoder)
↕ AMBA CHI-to-CXL Bridge
CXL/PCIe Dual-Mode PHY (32/64 GT/s SerDes)
↕ Package bumps / retimers
CXL Root Port / Switch (off-chip)
Key Design Considerations
- PHY IP: CXL reuses PCIe PHY — Synopsys, Cadence, Alphawave offer CXL-ready PHY IP at 32 GT/s (Gen5) and 64 GT/s (Gen6). Area: ~5-8 mm² per x16 PHY at 5nm.
- Controller IP: CXL controller manages flit packing, credit flow, and coherency state machines. ~1-2 mm² area. Vendors: Synopsys, Cadence, Rambus, Montage.
- CHI-CXL Bridge: Translates on-chip AMBA CHI coherency transactions to CXL.cache/mem messages. Critical for ARM-based ML SoCs (e.g., Grace, Neoverse-based designs).
- Latency budget:
On-chip NoC10-15 ns
CXL controller5-10 ns
PHY + link30-40 ns
Remote DRAM40-60 ns
Total round-trip~170-250 ns
23
Industry Case Studies
Real-world CXL deployments in ML-adjacent server platforms and memory products
| Product |
Vendor |
CXL Ver |
Type |
Key Specifications |
| Sapphire Rapids |
Intel |
CXL 1.1 |
Host |
First production CXL-capable CPU. Up to 4 CXL x16 ports. Type 1/2/3 support. Enables memory expansion to 4 TB+ per socket. |
| EPYC Genoa |
AMD |
CXL 1.1+ |
Host |
12 CXL-capable PCIe Gen5 x16 lanes. CXL memory interleaving across 4-way. Linux CXL driver support via cxl_pci/cxl_mem. |
| CMM-D / CMM-H |
Samsung |
CXL 2.0 |
Type 3 |
CMM-D: 128 GB DDR5 CXL module, E1.S. CMM-H: CXL-attached HBM. Deployed in hyperscale memory tiering pilots. |
| CMS (CXL Memory) |
SK hynix |
CXL 2.0 |
Type 3 |
96 GB DDR5-based CXL DRAM. PCIe 5.0 x8. <200 ns latency. Production validation with Intel SPR. |
| Leo |
Astera Labs |
CXL 2.0/3.0 |
Switch |
CXL smart memory controller. PCIe 5.0 retimer + CXL switch in one chip. Fabric Manager support. Memory pooling across 4 hosts. |
| CZ120 |
Micron |
CXL 2.0 |
Type 3 |
256 GB CXL memory expander, E3.S form factor. Targets data center memory tiering and ML KV-cache offload. |
Intel SPR + Samsung CMM-D
First production CXL memory tiering deployment. Linux kernel 6.3+ with NUMA-aware CXL memory tiering via cxl_mem driver. ~180 ns measured read latency.
Astera Labs Leo + SK hynix CMS
Demonstrated 4-host memory pooling with dynamic allocation. Each host gained access to 384 GB shared CXL memory. Hot-plug device migration in <50 μs.
24
References & Further Reading
Specifications, papers, and industry resources
Specifications
- CXL 3.2 (Dec 2024) / CXL 4.0 (Nov 2025) Specifications — CXL Consortium. 4.0 runs on PCIe 7.0 PHY (128 GT/s). computeexpresslink.org
- CXL 3.0 Specification — CXL Consortium (2022). 256B flits, GFA, multi-level switching.
- CXL 2.0 Specification — CXL Consortium (2022). Single-level switching, memory pooling, FM-API.
- PCIe 6.0 Specification — PCI-SIG (2022). 64 GT/s PAM4 PHY underpinning CXL 3.x.
Research Papers
- Pond: CXL-based memory pooling systems for cloud — ASPLOS 2023
- TPP: Transparent page placement for CXL heterogeneous memory — ASPLOS 2023
- CXL-ANNS: Software-hardware collaborative memory disaggregation — USENIX ATC 2023
- Demystifying CXL memory with genuine devices and software — MICRO 2023
Industry Resources
- CXL Consortium — computeexpresslink.org — specifications, white papers, member list
- Linux CXL Subsystem — kernel docs: Documentation/driver-api/cxl/ — cxl_pci, cxl_mem, cxl_port drivers
- QEMU CXL Emulation — Type 3 device emulation for kernel/driver development
- Astera Labs — Leo CXL smart memory controller, Aries CXL retimer
- Montage Technology — CXL controller IP and memory buffer chips
Key Takeaways
CXL transforms ML accelerator SoC design by breaking the memory capacity wall with coherent, low-latency, pooled memory — enabling longer contexts, larger batches, and more efficient cluster utilisation.
Modern SoC Design Series · Presentation 08 · CXL in ML Accelerator SoCs