Three years after pausing work on reverse-engineering Apple's Neural Engine (ANE), a renewed effort has mapped its internal architecture, shedding light on the design decisions Apple made when first introducing the ANE in the 2017 A11 Bionic chip. Initially optimized for convolutional neural networks (CNNs), the ANE's fixed-function dataflow and memory hierarchy reveal why it struggled to adapt to the more dynamic transformer models prevalent today.
The ANE consists of 16 compute cores, each with 128 parallel multiply-accumulate (MAC) units, totaling 2048 MAC lanes. While the MAC units perform standard dot products, the ANE’s specialization lies in its dataflow architecture—how data moves through the MAC units and memory. This design exploits predictable data reuse patterns typical of CNNs but is less efficient for transformer workloads, which have more irregular memory access patterns.
Apple’s M5 chip, expected in 2025, integrates ANE cores within the GPU, signaling a shift away from standalone neural processing units. This move reflects the changing landscape of AI workloads and hardware acceleration strategies.
The ANE uses a multi-level memory hierarchy, including per-core kernel memory (64 KiB per core), per-core input staging areas (L1), and a shared 2 MiB L2 cache. Kernels (weights) are loaded into private kernel memory and reused extensively, reducing bandwidth demands. However, the ANE must copy data from system DRAM into its local memory before processing, limiting throughput by memory bandwidth.
Performance analysis shows the M1 ANE achieves 11 tera-operations per second (TOPS) at 68 GB/s DRAM bandwidth. However, saturating the MAC units would require over 22 TB/s of memory bandwidth if operands streamed directly from DRAM, highlighting the critical role of local memory reuse. The ANE’s arithmetic intensity requirement is about 162 operations per byte of DRAM traffic, emphasizing the importance of data locality.
The ANE’s command interface resembles a GPU’s pushbuffer model, where precompiled task descriptors configure fixed-function hardware registers rather than executing an instruction set. This approach enables deterministic, low-latency operation but limits flexibility.
DMA engines handle data movement: KernelDMASrc loads weights into kernel memory, TileDMASrc loads input tiles into L2 cache, and TileDMADst writes results back to DRAM. Notably, kernel DMA throughput (38 GB/s) and tile DMA throughput (60 GB/s) are both lower than the GPU’s measured DRAM read bandwidth (78 GB/s), and these DMA operations occur serially, further constraining performance.
The analysis suggests that the ANE’s architecture was well-suited for the CNN workloads of its era but is increasingly bottlenecked by memory bandwidth and less adaptable to transformer models requiring more dynamic data access. The integration of ANE cores into GPU cores in future Apple silicon reflects this evolution.
Understanding the ANE’s design and limitations offers valuable insights into the tradeoffs in AI accelerator architectures, particularly the balance between fixed-function efficiency and flexibility for emerging machine learning models.