1 / 40

SUIF Explorer: An Interactive and Interprocedural Parallelizer

SUIF Explorer: An Interactive and Interprocedural Parallelizer. S.-W. Liao, A. Diwan, R. P. Bosch Jr., A Ghuloum, M. S. Lam. Agenda. SUIF Compiler Introduction The SUIF Explorer System Program Slicing A Case Study Experimental Results Conclusion. Agenda. SUIF Compiler Introduction

lani
Download Presentation

SUIF Explorer: An Interactive and Interprocedural Parallelizer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SUIF Explorer: An Interactive and Interprocedural Parallelizer S.-W. Liao, A. Diwan, R. P. Bosch Jr., A Ghuloum, M. S. Lam

  2. Agenda • SUIF Compiler • Introduction • The SUIF Explorer System • Program Slicing • A Case Study • Experimental Results • Conclusion

  3. Agenda • SUIF Compiler • Introduction • The SUIF Explorer System • Program Slicing • A Case Study • Experimental Results • Conclusion

  4. The SUIF Compiler • Stanford 大学で開発中の自動並列化コンパイラ • SUIF1 1994年~ ・ SUIF2 1999年~ • 「コンパイラの研究者のために、共通のインフラを 提供しよう」との理念で発足 • http://suif.Stanford.EDUにて公開 • Stanford University Intermediate Format に変換し、並列化・最適化 • 様々な言語に対応可

  5. The SUIF System PGI Fortran EDG C EDG C++ Java OSUIF Interprocedural Analysis Parallelization Locality Opt * SUIF2 Scalar opt Inst. Scheduling Register Allocation C MachSUIF Alpha x86 * C++ OSUIF to SUIF is incomplete

  6. Agenda • SUIF Compiler • Introduction • The SUIF Explorer System • Program Slicing • A Case Study • Experimental Results • Conclusion

  7. Introduction(1/2) • 自動並列化 • 並列化手法を適用しても、プログラムが持つ逐次の意味に縛られる ⇒アプリケーションに特化した知識が必要 • 手動並列化 • 既存プログラムの並列化には、全コードの理解が必要 • ループの並列実行だけでなく、データ構造の変更も必要なことがある ⇒競合が起こりやすい • 自動並列化と手動並列化の利点を合わせる

  8. Introduction(2/2) • 対話的並列化システム • 深いプログラム解析 • 配列のプライベート化解析、実行性能解析 • パフォーマンス向上の手引き • Parallelization Guru が重要なループを見つけ出し、その並列化を手引きする • スライスを用いたユーザ補助 • 注目している値に影響するプログラム部分を抜き出し、ユーザの負担を軽減する

  9. Agenda • SUIF Compiler • Introduction • The SUIF Explorer System • Program Slicing • A Case Study • Experimental Results • Conclusion

  10. The SUIF Explorer System Sequential Program • SUIF Explorer の動作 • Parallelizing Compiler で自動並列化 • Execution Analyzer で実行時情報を収集 • Parallelization Guru が最もパフォーマンスを向上させるループを特定 • Visualizer を通してプログラマとやりとりを行う Parallelizing Compiler Execution Analyzers Parallelization Guru Rivet Visualizer Programmer

  11. Automatic Parallelization • 各種解析 • シンボル解析(ループ不変式、定数伝播、帰納変数 等) • 依存解析 • プライベート化可能性の検出 • リダクション操作の検出 • 最外ループに適用 • 多くの変数をプライベート化 • 手続き間解析 • 多くの偽のデータ依存関係を解消

  12. Execution Analysis (1/2) • 多くの実行時間は数%のコードで費やされる • loop profile analyzer • 注目すべきループを見つける • 総実行時間(実行時間を支配するループの発見)、1回あたりの平均計算時間(ループの各実行における計算時間がばらつきを検出)を計測 • 実行時間に対するオーバーヘッドは小さい

  13. Execution Analysis (2/2) • dynamic dependence analyzer • 実行時の依存関係を検出する • 全ての read/write を検知し、各メモリ領域における最後のwriteを追跡 • 帰納変数と帰納操作を無視、逆依存を無視 • データのプライベート化が必要になる並列性も見つける • 遅いが非常に有効

  14. The Parallelization Guru (1/2) • 2つの評価基準で手引き • Coverage • 並列部分の占める実行時間の割合 • アムダールの法則: スピードアップは最大 (逐次部分の実行時間)^-1 • Granularity • 同期の間の平均実行時間 • 細粒度では、同期・データ送受信のオーバーヘッドで、パフォーマンスが悪化することも • 自動並列化後に上記の値を提示ループが新たに並列化される毎に情報更新

  15. The Parallelization Guru (2/2) • 並列化ループのリストを提示 • I/Oを持たず、他のループにネストされていない物 • 実行時間の多い順にソートして提示 • 静的に見つかった依存関係数と、実行時に見つかったループ繰越依存の有無の情報を付加 • ユーザインタラクション • 上から順に並列化できるかをプログラマに質問 • 必要なら、静的依存を探し出し、スライスを表示 • プログラマは、無視できる依存関係やプライベート化できる配列を探せばよい

  16. Visualization • Rivet visualization environment • Hyperbolic graph browser • call graph 等で、着目している部分を大きく、その他を小さく表示 • Line-oriented program statistics • プログラムの鳥瞰図を表示 • ループ深さや実行時間といった情報を付加 • Source code viewer • 色、フォント、文字によって付加情報を表示

  17. Hyperbolic graph browser

  18. Line-oriented program statistics

  19. Source code viewer

  20. Agenda • SUIF Compiler • Introduction • The SUIF Explorer System • Program Slicing • A Case Study • Experimental Results • Conclusion

  21. Program Slicing • プログラマはループ内外の関係あるコードを調べる必要がある  ⇒見るべきコードを少なくするべき • プログラムスライスは、参照の値に貢献する操作の集合

  22. Program Slicing • スライスの使用法 • 配列のあるインデックスに関するスライスを見る • 交差していない、読まれた要素は同じループでしか書かれていないならループ繰越依存なし • 読まれた要素が同じイテレーションで先に書かれた値ならばプライベート化して並列化できる • スライスのコード量も大きい場合 • 配列、ループ外コードへのアクセスを無視する

  23. Program slicing

  24. Program Slicing • エイリアス情報 • 同じデータを指す可能性のある変数は、同じエイリアス変数を指すと考える • エイリアス変数への代入は、その変数を集合に加えることで表現 main( ) { a = 10; b = 20; p = &a; p = &b; *p = 30; print (a); } main( ) { av1 = Φ(10, av1); av1 = Φ(20, av1); av2 = &av1; av2 = &av1; av1 = Φ(30, av1); print (av1); }

  25. Agenda • SUIF Compiler • Introduction • The SUIF Explorer System • Program Slicing • A Case Study • Experimental Results • Conclusion

  26. A Case Study • MDG benchmark • 水分子 343 個の相互作用を計算 • 並列化の流れ • 自動並列化  • 動的解析結果 • ユーザのプログラム解析 • ユーザの補助を取り入れた結果

  27. Agenda • SUIF Compiler • Introduction • The SUIF Explorer System • Program Slicing • A Case Study • Experimental Results • Conclusion

  28. Experimental Results (1/2) • MDG • NASA’s Arc3d program • LANL’s Hydro program  の3つのプログラムで計測

  29. Experimental Results (2/2) • 表1:自動並列化のみのプログラム情報 • 表2:手動並列化でないとできない部分 • 表3:スライスの効果 • 表4:コンパイラのユーザ作業削減効果 • 表5:ユーザインタラクションの効果

  30. Agenda • SUIF Compiler • Introduction • The SUIF Explorer System • Program Slicing • A Case Study • Experimental Results • Conclusion

  31. Conclusion • SUIF Explorer のデザインを示した • プログラマが効率的に粗粒度並列性を得られる • 手続間並列性解析、実行解析、プログラムスライスにより、手動並列化時に見るべきコードを削減 • 効率を3つのプログラムにおいて示した • プログラマは全429のループの内12個を調べるだけでよい • 依存解析のために見るべきコードは全体の10% • パフォーマンスも向上

More Related