ResearchHardware & Inference 🇷🇺 11.08.2026 17:01

Inside Apple Neural Engine in M4, Part 1: Reverse Engineering

AppleApple
Researchers reverse-engineered Apple's Neural Engine (ANE) in the M4 chip, bypassing Core ML to directly compile and run neural network programs. They discovered the ANE's true peak performance is lower than Apple's claimed 38 TOPS, and successfully trained a model on the chip, which is designed only for inference.
The article details how the authors reverse-engineered Apple's Neural Engine (ANE) in the M4 chip, bypassing Core ML to work with the hardware directly. They explored the full software stack from Core ML to the IOKit kernel driver, discovered how to compile and execute programs on ANE without Core ML, and unmasked the binary format. They measured the actual peak performance, finding that Apple's advertised '38 TOPS' is misleading. Ultimately, they managed to train a neural network on the chip, which is intended solely for inference. The ANE is not a GPU or CPU; it is a computational graph engine that executes a compiled neural network as a single atomic operation. They used method swizzling and binary analysis to uncover over 40 private classes in AppleNeuralEngine.framework, including _ANEClient, which allows direct access to the compile-load-execute pipeline. They also discovered that the MIL language is used to describe models, and the binary format E5 is a FlatBuffers file that parameterizes fixed hardware primitives rather than storing traditional machine code. They found a way to compile models in memory using _ANEInMemoryModelDescriptor, though it still writes to a temporary directory. The ANE in M4 has 16 cores, a queue depth of 127, and independent dynamic voltage and frequency scaling (DVFS).
Abbreviations
ANE = Apple Neural Engine — Apple Neural Engine (нейропроцессор Apple)
MIL = Machine Learning Intermediate Language — Промежуточный язык машинного обучения
DVFS = Dynamic Voltage and Frequency Scaling — Динамическое масштабирование напряжения и частоты
SSA = Static Single Assignment — Статическое однократное присваивание
IOKit = I/O Kit — Фреймворк ввода-вывода в macOS/iOS
IOSurface = IOSurface (Apple's shared memory framework) — Механизм разделяемой памяти Apple
TOPS = Tera Operations Per Second — Тера операций в секунду
GPU = Graphics Processing Unit — Графический процессор
CPU = Central Processing Unit — Центральный процессор
API = Application Programming Interface — Программный интерфейс приложения
M4 = M4 (Apple Silicon chip) — M4 (чип Apple Silicon)
Source: Habr — хаб ML — original
Our earlier posts on this topic ↓
Fresh news