Documentation
¶
Overview ¶
Command espressoe5rtdispatch runs a MIL program on the Apple Neural Engine through Espresso's private e5rt_* direct dispatch route, and checks the answer. It calls the generated private/espresso binding through the example-local espressoe5rt adapter.
The route skips Core ML entirely. A MIL program and its weights are written to a directory, Espresso's compiler lowers them to a signed hardware program inside the aned daemon, and the result is bound to buffer objects and submitted on an execution stream:
config -> compiler -> options -> compile -> library -> function
-> operation -> ports -> buffers -> stream -> execute
Compile runs once and is expensive; bind and dispatch are the hot loop.
Every stage prints what it observed. The demo's claim to have run on the Neural Engine rests on the last stage: the output buffer is compared against a float64 CPU reference computed in Go, so a route that silently returned zeros, or ran the wrong program, fails the check rather than printing a success it did not earn.
Two programs run. The first has a single weight tensor in its own file, the shape every MIL template in this repository emits. The second packs two weight tensors into one file at two different offsets, which is how the reference implementation lays out real models; it exercises github.com/tmc/apple/x/ane/mil.BlobWriter multi-entry output, a path this repository has never previously submitted to the compiler.
go run ./examples/ane/espressoe5rtdispatch go run ./examples/ane/espressoe5rtdispatch -in 64 -out 64 -spatial 32 go run ./examples/ane/espressoe5rtdispatch -device cpu
The e5rt_* argument lists are not Apple-documented. They come from ANEForge, the source paper author's own working implementation. If a signature is wrong the process faults in C, where the fault is fatal and recover cannot see it, so a crash here is a real result and is reported as one.