arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.17090cs.PLcs.AIcs.MS
收藏

ANEForge: 用于直接在Apple Neural Engine上进行计算的Python工具

ANEForge: Python for direct computation on the Apple Neural Engine

School of Computational Science \& Engineering, Georgia Institute of Technology, Atlanta, GA 30332, USA -0.35cm;Daniel Guggenheim School of Aerospace Engineering, Georgia Institute of Technology, Atlanta, GA 30332, USA -0.35cm;George W. Woodruff School of Mechanical Engineering, Georgia Institute of Technology, Atlanta, GA 30332, USA

Spencer H. Bryngelson

AI总结:

ANEForge是一个Python包,通过编译惰性张量图直接编程Apple Neural Engine,无需CoreML,支持推理和训练,性能接近引擎硬件极限。

摘要:

ANEForge是一个Python包,它直接编程Apple Neural Engine(ANE),即每个最新Apple设备上的固定功能神经加速器,无需CoreML。在生产环境中,引擎只能通过CoreML访问,而CoreML将其视为调度选项:没有配置要求使用ANE,模型可以静默地在CPU或GPU上运行。ANEForge将由58个融合操作和19个原生桥接操作构建的惰性张量图编译成单个ANE程序。该程序通过与Apple内部框架相同的ANE守护进程和内核驱动程序堆栈进行调度。除了推理之外,该包还访问引擎的原生融合注意力,流式传输int8、int4和稀疏权重,在步骤之间保持解码器和优化器状态,并在引擎上运行训练的前向传播、反向传播和优化器更新。一个小的融合程序在大约90微秒内完成一次调用,接近引擎每程序70微秒的调度下限,预训练的ResNet-18前向传播端到端运行时间为0.33毫秒。ResNet-18、句子编码器和Vision Transformer在框架参考上端到端运行,Stable Diffusion U-Net验证了其前向传播。ANEForge针对macOS 14及更高版本下的Apple Silicon。每个版本都针对记录的macOS和ANE编译器版本进行验证。

英文摘要:

ANEForge is a Python package that programs the Apple Neural Engine (ANE), the fixed-function neural accelerator on every recent Apple device, directly and without CoreML. In production the engine is reachable only through CoreML, which treats it as a scheduling option: no configuration requires the ANE, and a model can silently run on the CPU or GPU instead. ANEForge compiles a lazy tensor graph, built from 58 fused operators and 19 native bridge operators, into a single ANE program. The program is dispatched through the same ANE daemon and kernel-driver stack as Apple's internal framework. Beyond inference, the package reaches the engine's native fused attention, streams int8, int4, and sparse weights, keeps decoder and optimizer state resident across steps, and runs the forward pass, backward pass, and optimizer update of training on the engine. A small fused program completes a call in about 90us, near the engine's 70us per-program dispatch floor, and a pretrained ResNet-18 forward runs end-to-end in 0.33ms. ResNet-18, a sentence encoder, and a Vision Transformer run end-to-end against framework references, and a Stable Diffusion U-Net validates its forward pass. ANEForge targets Apple Silicon under macOS 14 and later. Each release is verified against a recorded macOS and ANE-compiler version.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑