Apple Neural Engine (M4) · Works · Source available

Reverse engineered Apple Neural Engine private APIs with Claude to train networks on the M4 ANE

View JSON
Apple Neural Engine (M4): Training neural networks on Apple's Neural Engine without CoreML.
Image: maderix.substack.com

Who did what

4 of 42 commits credit an AI: 3 Claude Opus 4.6, 1 Claude (version not given). They were made on 2 separate days between 1 Mar 2026 and 3 Mar 2026.

Counted from the public git history on 16 Nov 2026. How

The README says training works but utilisation is low (about 5 to 9% of peak) and many element-wise ops fall back to CPU. Several hardware limits, such as a compile resource leak and ignored attention masks, needed workarounds.

What was done

With Claude Opus 4.6 as co-developer, the author mapped AppleNeuralEngine.framework's private classes and in-memory compile path, benchmarked the M4 ANE and ran backpropagation on it without CoreML.

Manjeet Singh (maderix), working with Claude Opus 4.6 as a pair, reverse engineered the private APIs behind Apple's Neural Engine on the M4 and trained transformer models on it without CoreML. Training works, but the README says utilisation is low, about 5 to 9% of peak, and many element-wise operations still run on the CPU.

How it was done

The write-up says "we" means maderix and Claude Opus 4.6, with the human driving exploration and the AI reasoning through data and writing code. They dumped every Objective-C class in AppleNeuralEngine.framework with dyld_info -objc, swizzled methods to intercept CoreML's calls, analysed compiled E5 bundles, and ran scaling experiments to infer hardware layout. They found more than 40 private classes, including _ANEClient, _ANEModel, _ANERequest and _ANEInMemoryModelDescriptor. The last accepts MIL program text in memory, which avoids the disk round trip on every weight update, though it still needs a writable temp directory internally.

Results

The project runs forward and backward passes on the ANE, with weight gradients and the Adam optimizer on the CPU. The README reports 91 ms per step for Stories110M (109M parameters) and 412 ms per step for Qwen3-0.6B (596M parameters) on an M4. Listed limitations include the ANE ignoring attention masks, a compiler resource leak after about 119 compiles (worked around by restarting from a checkpoint), fp16 gradient underflow fixed with loss scaling, and a single-input constraint. The author says it does not replace GPU training beyond small research models, and calls it research code rather than a maintained framework.

Discussion

Your library

Sources

Sources reviewed · Added

An AI model drafted this entry from the sources above. Checked against the sources on 14 Oct 2026. The figures are the author's. How entries are checked. Something wrong? Tell me.

The weekly dump: new projects, once a week