DyCL: Dynamic Neural Network Compilation Via Program Rewriting and Graph Optimization

要約

DL コンパイラの主な機能は、PyTorch や TensorFlow などの高レベル DL フレームワークで記述された DNN プログラムを移植可能な実行可能ファイルに変換することです。
これらの実行可能ファイルは、展開されたホスト プログラムによって柔軟に実行できます。
ただし、既存の DL コンパイラーは、ランタイム入力をニューラル ネットワーク プログラムに供給し、プログラムの実行パスをトレースして、コンパイルに必要な計算グラフを生成するトレース メカニズムに依存しています。
残念ながら、このメカニズムは、入力に応じて変化する計算グラフを持つ最新のダイナミック ニューラル ネットワーク (DyNN) を扱う場合には不十分です。
その結果、従来の DL コンパイラーは、DyNN を実行可能コードに正確にコンパイルするのに苦労しています。
この制限に対処するために、既存の DL コンパイラーが DyNN を正常にコンパイルできるようにする一般的なアプローチである \tool を提案します。
\tool は、コンパイル プロセス中に元の DNN プログラムの制御とデータ フローを再分配するコンパイル メカニズムを導入することで、DyNN の動的な性質に取り組みます。
具体的には、\tool は、動的ニューラル ネットワークを複数のサブニューラル ネットワークに変換するプログラム分析およびプログラム変換技術を開発します。
各サブニューラル ネットワークには条件ステートメントがなく、独立してコンパイルされます。
さらに、\tool は、DyNN の制御フローをモデル化し、サブニューラル ネットワークの呼び出しを容易にするホスト モジュールを合成します。
私たちの評価では、\tool の有効性が実証されており、すべての動的ニューラル ネットワークのコンパイルで 100\% の成功率を達成しています。
さらに、\tool によって生成されたコンパイル済み実行可能ファイルはパフォーマンスが大幅に向上し、汎用 DL フレームワークで実行された元の DyNN よりも $1.12\times$ から $20.21\times$ の間で高速に実行されます。

要約(オリジナル)

DL compiler’s primary function is to translate DNN programs written in high-level DL frameworks such as PyTorch and TensorFlow into portable executables. These executables can then be flexibly executed by the deployed host programs. However, existing DL compilers rely on a tracing mechanism, which involves feeding a runtime input to a neural network program and tracing the program execution paths to generate the computational graph necessary for compilation. Unfortunately, this mechanism falls short when dealing with modern dynamic neural networks (DyNNs) that possess varying computational graphs depending on the inputs. Consequently, conventional DL compilers struggle to accurately compile DyNNs into executable code. To address this limitation, we propose \tool, a general approach that enables any existing DL compiler to successfully compile DyNNs. \tool tackles the dynamic nature of DyNNs by introducing a compilation mechanism that redistributes the control and data flow of the original DNN programs during the compilation process. Specifically, \tool develops program analysis and program transformation techniques to convert a dynamic neural network into multiple sub-neural networks. Each sub-neural network is devoid of conditional statements and is compiled independently. Furthermore, \tool synthesizes a host module that models the control flow of the DyNNs and facilitates the invocation of the sub-neural networks. Our evaluation demonstrates the effectiveness of \tool, achieving a 100\% success rate in compiling all dynamic neural networks. Moreover, the compiled executables generated by \tool exhibit significantly improved performance, running between $1.12\times$ and $20.21\times$ faster than the original DyNNs executed on general-purpose DL frameworks.

arxiv情報

著者 Simin Chen,Shiyi Wei,Cong Liu,Wei Yang
発行日 2023-07-11 01:53:19+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL, cs.LG, cs.PL パーマリンク