[論文レビュー] AutoPhase: Juggling HLS Phase Orderings in Random Forests with Deep Reinforcement Learning
AutoPhaseは、ランダムフォレストを用いて探索空間の削減を支援する深層強化学習フレームワークを提案する。このフレームワークは、High-Level Synthesis (HLS) コンパilationにおける最適なフェーズ順序を自動で決定する。100個の合成プログラムでの学習後、12,874個の多様なベンチマークで効果的に一般化され、-O3最適化よりも28%優れたパフォーランスを達成する。
The performance of the code a compiler generates depends on the order in which it applies the optimization passes. Choosing a good order--often referred to as the phase-ordering problem, is an NP-hard problem. As a result, existing solutions rely on a variety of heuristics. In this paper, we evaluate a new technique to address the phase-ordering problem: deep reinforcement learning. To this end, we implement AutoPhase: a framework that takes a program and uses deep reinforcement learning to find a sequence of compilation passes that minimizes its execution time. Without loss of generality, we construct this framework in the context of the LLVM compiler toolchain and target high-level synthesis programs. We use random forests to quantify the correlation between the effectiveness of a given pass and the program's features. This helps us reduce the search space by avoiding phase orderings that are unlikely to improve the performance of a given program. We compare the performance of AutoPhase to state-of-the-art algorithms that address the phase-ordering problem. In our evaluation, we show that AutoPhase improves circuit performance by 28% when compared to using the -O3 compiler flag, and achieves competitive results compared to the state-of-the-art solutions, while requiring fewer samples. Furthermore, unlike existing state-of-the-art solutions, our deep reinforcement learning solution shows promising result in generalizing to real benchmarks and 12,874 different randomly generated programs, after training on a hundred randomly generated programs.
研究の動機と目的
- High-Level Synthesis (HLS) コンパイラーにおけるNP困難なフェーズ順序問題に対処し、生成コードのパフォーマンスに顕著な影響を与えること。
- 多様なプログラムに一般化しにくいヒューリスティックベースのフェーズ順序戦略への依存を低減すること。
- プログラム固有の特徴に基づいて、最適なパスシーケンスを動的に選択する学習ベースのアプローチを開発すること。
- 必要なトレーニングサンプル数を最小限に抑えつつ、既存の最先端のフェーズ順序技術を上回るパフォーランスを向上させること。
- 限定的なトレーニング後、実ベンチマークおよび多数のランダムに生成されたプログラムに対して一般化能力を評価すること。
提案手法
- LLVMツールチェーンにおけるHLSコンパイルの最適フェーズ順序ポリシーを学習するために、深層強化学習を活用する。
- プログラム特徴とパスの有効性の相関関係をモデル化するためにランダムフォレストを用い、効率的な探索空間の削減を実現する。
- プログラム固有の特徴を用いて、パフォーマンス向上の可能性が高いコンパイルパスを予測し、候補となるフェーズ順序の数を削減する。
- 100個のランダムに生成されたプログラムの小さなセットでの学習により、12,874個の追加の合成および実ベンチマークに一般化可能である。
- 学習されたポリシーをコンパイルパイプラインに統合し、適応的なフェーズシーケンシングによって実行時間を最小化する。
実験結果
リサーチクエスチョン
- RQ1手作業で設計されたヒューリスティクスに依存せずに、深層強化学習がHLSコンパイルにおける最適フェーズ順序を効果的に学習できるか?
- RQ2特徴に基づくパス有効性予測にランダムフォレストを統合することで、フェーズ順序の探索効率はどの程度向上するか?
- RQ3合成プログラムの少数のセットで学習したモデルが、実世界および多様なベンチマークプログラムにどの程度一般化できるか?
- RQ4既存の最先端のフェーズ順序技術と比較して、AutoPhaseのパフォーマンスとサンプル効率はどのように異なるか?
- RQ5学習されたポリシーは、さまざまなプログラムタイプやワークロードにおいて一貫したパフォーマンス向上を達成できるか?
主な発見
- AutoPhaseは、デフォルトの-O3コンパイラ最適化フラグと比較して、回路パフォーマンスを28%向上する。
- フレームワークは、最先端のフェーズ順序ソリューションと同等のパフォーマンスを達成するが、必要なトレーニングサンプル数が少ない。
- わずか100個のランダムに生成されたプログラムでの学習後、AutoPhaseは12,874個の異なるプログラム(実ベンチマークを含む)に効果的に一般化する。
- パス有効性を予測するためにランダムフォレストを用いることで、探索空間が顕著に削減され、トレーニング効率が向上する。
- 深層強化学習ポリシーは優れた一般化性能を示し、多様なプログラムシナリオにおいてヒューリスティックベースのアプローチを上回る。
より良い研究を、今すぐ始めましょう
論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。