The Coherent Accelerator Processor Interface (CAPI) is an architecture developed by IBM to let external accelerators (FPGAs, ASICs, GPUs) attach to a POWER system as if they were coherent peers of the CPU, not just peripheral devices.
On systems like IBM POWER10 (and earlier POWER8/9), CAPI fundamentally changes how accelerators interact with memory and software.
π§ Core idea of CAPI
β Traditional model (PCIe): accelerator = I/O device
β
CAPI model: accelerator = coherent processor sharing memory
This eliminates much of the overhead of:
-
DMA setup
-
Data copies
-
OS intervention
ποΈ CAPI Architecture Components
1. β‘ Physical layer: PCIe-based transport
CAPI uses:
-
PCI Express as the physical link
-
Standard slots and signaling
π But adds a custom protocol layer on top
2. π§© Coherent Accelerator Processor Proxy (CAPP)
This is the key hardware block in the CPU:
-
Sits between:
-
CPU cache hierarchy
-
PCIe interface
Functions:
-
Maintains cache coherence between CPU and accelerator
-
Translates accelerator requests into CPU memory operations
-
Tracks memory consistency
π Makes accelerator appear like another coherent agent
3. π Coherent memory model
With CAPI:
-
Accelerator can:
-
Directly read/write system memory
-
Access virtual addresses (not just physical)
-
Shares the same address space as CPU
π No need for:
-
Explicit DMA buffers
-
Address translation in software
4. π Shared page tables
CAPI integrates with system MMU:
-
Accelerators use same page tables as CPU
-
Hardware handles:
-
Address translation
-
Protection checks
π Enables:
-
Simplified programming model
-
Secure access control
5. βοΈ Accelerator functional unit (AFU)
On the accelerator side:
-
Logic is implemented as an AFU (Accelerator Functional Unit)
AFU:
-
Issues memory requests
-
Participates in coherence protocol
-
Appears like a compute unit attached to CPU fabric
π 6. Coherence protocol integration
CAPI ties into POWER cache coherence:
-
Ensures:
-
Data consistency between CPU caches and accelerator
-
Handles:
-
Cache line states
-
Invalidations and updates
π Eliminates stale data issues
π 7. Interrupt and synchronization model
-
Low-latency communication between CPU and accelerator
-
Lightweight signaling (doorbells, queues)
π Faster than traditional device interrupts
β‘ How CAPI differs from traditional PCIe
| Feature | PCIe | CAPI |
|---|
| Memory access | DMA-based | Load/store (coherent) |
| Addressing | Physical | Virtual (shared) |
| Coherence | None | Full cache coherence |
| Software overhead | High | Low |
| Latency | Higher | Lower |
π§© Evolution: OpenCAPI
CAPI evolved into:
Enhancements:
-
Higher bandwidth than PCIe
-
Independent physical layer
-
Broader ecosystem support
π Why CAPI matters for performance
β Eliminates data copies
-
No CPU-mediated DMA transfers
-
Direct shared-memory access
β Reduces latency
-
Coherent access avoids round trips
β Improves programmability
-
Accelerator behaves like a thread/process
β Enables fine-grained acceleration
-
Not just bulk offload, but tight CPU-accelerator coupling
π§ Big insight
CAPI transforms accelerators from:
β βexternal devices that you send data toβ
into
β
βcoherent compute units that operate directly on your memoryβ
π₯ Real-world impact
-
FPGA acceleration for databases
-
Compression/encryption offload
-
AI inference pipelines
-
High-frequency trading systems