Spiking neural networks (SNNs) are increasingly trained in a wide range of frameworks (SnnTorch, Lava, Norse, and others) each with its own model format. The Neuromorphic Intermediate Representation (NIR) addresses this fragmentation by providing a common, framework-independent format for exchanging trained SNN models. NIR solves the exchange problem, but it stops there. It provides a description of a network, not a path to running one. Each backend is still left to implement deployment on its own, with no shared, transformable compiler representation in between. This paper presents snn-mlir, an outof-tree MLIR dialect for SNNs together with a NIR-MLIR-C compilation bridge. The dialect provides a small set of typepolymorphic operations that work identically on floating-point (f32/f64) and quantized data, so a single intermediate representation serves both simulation and hardware-oriented deployment. A Python front end reads any NIR file and emits dialect IR, automatically inserting rescaling operations to keep quantization scales consistent across layers. A reference lowering pass converts the dialect to standard linalg and arith operations, from which the toolchain produces self-contained, dependency free C11 code that compiles and runs on any C-capable CPU or embedded target. We evaluate numerical fidelity against reference outputs, portability across CPU targets, and the cost of quantization. The current scope is feedforward, fully-connected networks with a CPU backend. snn-mlir is released as open source under the Apache-2.0 license with LLVM-exception and it is already available on Github.


翻译:脉冲神经网络(SNNs)正越来越多地在多种框架(如SnnTorch、Lava、Norse等)中训练,每种框架均使用自有模型格式。神经形态中间表示(NIR)通过提供通用的、框架无关的格式来交换已训练的SNN模型,解决了碎片化问题。NIR解决了交换问题,但也仅限于此:它仅提供网络描述,而非运行网络的方法。每个后端仍需自行实现部署,且缺乏共享的可转换编译器中间表示。本文提出snn-mlir,一种面向SNN的树外MLIR方言,并构建了NIR-MLIR-C编译桥梁。该方言提供一组小型类型多态操作,在浮点(f32/f64)和量化数据上行为一致,因此单一中间表示即可同时支持仿真和面向硬件的部署。Python前端可读取任意NIR文件并生成方言IR,自动插入重缩放操作以保持层间量化尺度一致。参考降级通道将该方言转换为标准linalg和arith操作,工具链由此生成自包含、无依赖的C11代码,可在任何支持C的CPU或嵌入式目标上编译运行。我们评估了相较参考输出的数值保真度、跨CPU目标的移植性以及量化成本。当前范围涵盖前馈全连接网络及CPU后端。snn-mlir已基于Apache-2.0许可证(含LLVM例外)开源发布,并已在Github上提供。

0
下载
关闭预览

相关内容

编译器(Compiler),是一种计算机程序,它会将用某种编程语言写成的源代码(原始语言),转换成另一种编程语言(目标语言)。
脉冲神经网络的架构原理、数据集和训练方法
专知会员服务
23+阅读 · 2024年8月13日
【NeurIPS2021】NeRV:视频的神经表示
专知会员服务
12+阅读 · 2021年10月28日
【GNN】MPNN:消息传递神经网络
深度学习自然语言处理
17+阅读 · 2020年4月11日
【GNN】深度学习之上,图神经网络(GNN )崛起
产业智能官
16+阅读 · 2019年8月15日
脉冲神经网络(SNN)概述
人工智能前沿讲习班
62+阅读 · 2019年5月30日
掌握图神经网络GNN基本,看这篇文章就够了
新智元
164+阅读 · 2019年2月14日
SNN,像你的大脑一样工作
中国科学院自动化研究所
80+阅读 · 2018年11月7日
脉冲神经网络,下一代机器学习?
专知
13+阅读 · 2018年1月13日
前沿 | 简述脉冲神经网络SNN:下一代神经网络
机器之心
39+阅读 · 2018年1月13日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
4+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
6+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
3+阅读 · 6月17日
相关VIP内容
脉冲神经网络的架构原理、数据集和训练方法
专知会员服务
23+阅读 · 2024年8月13日
【NeurIPS2021】NeRV:视频的神经表示
专知会员服务
12+阅读 · 2021年10月28日
相关资讯
【GNN】MPNN:消息传递神经网络
深度学习自然语言处理
17+阅读 · 2020年4月11日
【GNN】深度学习之上,图神经网络(GNN )崛起
产业智能官
16+阅读 · 2019年8月15日
脉冲神经网络(SNN)概述
人工智能前沿讲习班
62+阅读 · 2019年5月30日
掌握图神经网络GNN基本,看这篇文章就够了
新智元
164+阅读 · 2019年2月14日
SNN,像你的大脑一样工作
中国科学院自动化研究所
80+阅读 · 2018年11月7日
脉冲神经网络,下一代机器学习?
专知
13+阅读 · 2018年1月13日
前沿 | 简述脉冲神经网络SNN:下一代神经网络
机器之心
39+阅读 · 2018年1月13日
相关基金
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员