Fail Fast, Run Faster: Shape Safe Deep Learning in Rust on Apple Silicon [pdf]
This paper presents a novel approach to building shape-safe deep learning frameworks using Rust on Apple Silicon hardware. By leveraging Rust's type system and ownership model, the authors demonstrate how to achieve compile-time shape checking for neural network operations, reducing runtime errors while maintaining high performance through efficient SIMD and GPU utilization on Apple's M-series processors.
背景メモ
- 本稿はスタンフォード大学の講義「CS231n: Convolutional Neural Networks for Visual Recognition」の2025年度受講生によるプロジェクト論文。同講義はコンピュータビジョンと深層学習の世界で最も知られる大学講義の一つ。
- RustはMozillaが開発したシステムプログラミング言語。メモリ安全性(メモリリークやバッファオーバーフローが起きにくい設計)と高い実行性能を両立することで知られ、近年C++に代わる深層学習フレームワークの実装言語として注目されている。
- Apple SiliconはAppleが設計するARMベースの独自プロセッサ(M1/M2/M3シリーズ)。従来のIntel Macとは命令セットが異なり、特にGPU統合アーキテクチャ(Apple GPU)向けの機械学習最適化が独自の課題となっている。
- 「Fail Fast」はソフトウェア工学の設計原則の一つで、エラーが発生したら即座に停止・報告することで誤った計算を続行させない方針。深層学習では数値エラー(NaNやinf)を放置しがちな問題に対処する意味合いがある。
- 本論文の核心:Rustの型安全性を活かしてニューラルネットの「形状ミス」(テンソルの次元不一致など)をコンパイル時に検出し、Apple SiliconのGPUを活用しながら高速に学習・推論するフレームワークを提案している。