arXiv:2409.11600cs.PLcs.AI2024-09

用纯编译方式实现类Python神经网络编程,兼顾性能与易用性。

No Saved Kaleidosope: an 100% Jitted Neural Network Coding Language with Pythonic Syntax

  • 基于C++/LLVM/Cuda的全编译器,支持面向对象与自动微分
  • CIFAR-10上达到PyTorch同等速度与精度,ImageNet表现略差
  • 适合追求极致性能但可接受部分兼容性损失的开发者

我们开发了一个基于C++、LLVM和CUDA的神经网络训练编译器,具备面向对象特性、强类型、并行数据预处理、类Python表达式语法、类似PyTorch的模型定义方式及自动微分。通过引入缓存与池化机制管理VRAM,使用cuBLAS加速矩阵乘法,cuDNN优化卷积层。在ImageNet上的残差卷积网络实验中,速度相近但性能下降;GRU实验中精度相当但速度较慢。但在CIFAR-10基准测试中,性能与速度均与PyTorch相当。代码已公开于:https://github.com/NoSavedDATA/NoSavedKaleidoscope。

原文摘要 · Abstract (English)

We developed a jitted compiler for training Artificial Neural Networks using C++, LLVM and Cuda. It features object-oriented characteristics, strong typing, parallel workers for data pre-processing, pythonic syntax for expressions, PyTorch like model declaration and Automatic Differentiation. We implement the mechanisms of cache and pooling in order to manage VRAM, cuBLAS for high performance matrix multiplication and cuDNN for convolutional layers. Our experiments with Residual Convolutional Neural Networks on ImageNet, we reach similar speed but degraded performance. Also, the GRU network experiments show similar accuracy, but our compiler have degraded speed in that task. However, our compiler demonstrates promising results at the CIFAR-10 benchmark, in which we reach the same performance and about the same speed as PyTorch. We make the code publicly available at: https://github.com/NoSavedDATA/NoSavedKaleidoscope

编译器神经网络高性能

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。