[論文レビュー] Matrix-free GPU implementation of a preconditioned conjugate gradient solver for anisotropic elliptic PDEs
本稿では、数値 weaer予測(NWP)モデルに生じる異方性楕円型PDEに対して、行列を用いないGPUアクセラレート型プリコンディショニング共役勾配(PCG)ソルバを提示する。垂直方向の異方性を活用し、行列を用いないステンシル評価、ループ融合、最適化されたメモリアクセスを採用することで、高いスループットとグローバルメモリ帯域幅の削減を実現し、大規模問題において、逐次CPUおよび行列明示的GPU実装を上回る性能を発揮する。
Many problems in geophysical and atmospheric modelling require the fast solution of elliptic partial differential equations (PDEs) in "flat" three dimensional geometries. In particular, an anisotropic elliptic PDE for the pressure correction has to be solved at every time step in the dynamical core of many numerical weather prediction models, and equations of a very similar structure arise in global ocean models, subsurface flow simulations and gas and oil reservoir modelling. The elliptic solve is often the bottleneck of the forecast, and an algorithmically optimal method has to be used and implemented efficiently. Graphics Processing Units have been shown to be highly efficient for a wide range of applications in scientific computing, and recently iterative solvers have been parallelised on these architectures. We describe the GPU implementation and optimisation of a Preconditioned Conjugate Gradient (PCG) algorithm for the solution of a three dimensional anisotropic elliptic PDE for the pressure correction in NWP. Our implementation exploits the strong vertical anisotropy of the elliptic operator in the construction of a suitable preconditioner. As the algorithm is memory bound, performance can be improved significantly by reducing the amount of global memory access. We achieve this by using a matrix-free implementation which does not require explicit storage of the matrix and instead recalculates the local stencil. Global memory access can also be reduced by rewriting the algorithm using loop fusion and we show that this further reduces the runtime on the GPU. We demonstrate the performance of our matrix-free GPU code by comparing it to a sequential CPU implementation and to a matrix-explicit GPU code which uses existing libraries. The absolute performance of the algorithm for different problem sizes is quantified in terms of floating point throughput and global memory bandwidth.
研究の動機と目的
- 数値weaer予測(NWP)モデルにおける楕円型ソルバの性能ボトルネックを解消すること。これは、異方的で平坦な3次元幾何形状のため、計算が高コストであるためである。
- GPU向けに高性能かつメモリ効率の良いPCGソルバを、異方性楕円型PDEに対して開発すること。目的は、運用NWPおよび地球物理モデリングワークロードを対象とする。
- PCGアルゴリズムにおける行列を用いない実装とループ融合を通じて、グローバルメモリ帯域幅とアクセスオーバーヘッドを低減すること。
- 標準的なCUDAライブラリを用いた行列明示的GPU実装と比較して、優れた性能を示すことを実証すること。
提案手法
- 行列を明示的に格納しないアプローチを採用し、行列-ベクトル積の実行時に局所的なステンシルを動的に再計算することで、メモリ使用量を削減する。
- 楕円型作用素の強い垂直方向異方性を踏まえた物理的インサイトに基づくプリコンディショナを構築し、収束性を向上させる。
- 複数のPCG演算(例:ベクトル更新、内積、行列-ベクトル積)を1つのカーネルに統合するループ融合を適用し、メモリトラフィックを低減する。
- CUDAカーネルを用い、スレッドブロックを水平方向グリッド平面に対応させることで、連続メモリアクセスを実現し、並列処理を効率化する。
- 内積およびノルムのグローバル還元処理は、2次元水平ベクトル上でBLAS呼び出しを実行することで行い、通信コストを最小限に抑える。
- スケーラビリティを考慮した設計となっており、ハローエクスチェンジを用いたマルチGPUシステムへの拡張が可能であり、データ転送オーバーヘッドを最小限に抑える。
実験結果
リサーチクエスチョン
- RQ1行列を用いないおよびループ融合されたGPUカーネルは、異方性楕円型PDEの解法において、グローバルメモリアクセスをどのように低減し、性能を向上させ得るか?
- RQ2大気および海洋PDEに対して、プリコンディショナにおける垂直方向異方性を活用することで、どの程度の性能向上が達成可能か?
- RQ3CUDAライブラリを用いた行列明示的GPU実装と比較して、行列を用いないGPU PCGソルバは、スループットおよびメモリ帯域幅においてどの程度優れているか?
- RQ4ループ融合は、GPUアーキテクチャ上でのPCGアルゴリズムの実行時間にどの程度の削減効果をもたらすか?
- RQ5提案された実装は、最小限のデバイス間通信でマルチGPUクラスタに効率的にスケーリング可能か?
主な発見
- 行列を用いないGPU PCGソルバは、逐次CPUおよび行列明示的GPU実装と比較して、顕著に高い浮動小数点スループットと低いグローバルメモリ帯域幅を達成した。
- ループ融合により、不要なメモリアクセスの削減とメモリの連続アクセスの向上が図られ、PCGカーネルの実行時間が短縮された。
- 行列を用いないアプローチにより、大規模なスパース行列の格納が不要となり、グローバルメモリフットプリントが削減され、メモリアクセス効率が向上した。
- 本ソルバは、NWPおよび地下水流シミュレーションに一般的な大規模3次元異方性問題において高い性能を示し、Aquilaスーパーコンピュータ上で強いスケーリング特性が観察された。
- プリコンディショナは垂直方向異方性を効果的に活用し、約100イテレーションで収束を達成した。これはマルチグリッド法と同等の性能を示した。
- 本実装は、消費電力および絶対的性能の観点から極めて効率的であり、運用型weaerおよび気候モデルに適していることが示された。
より良い研究を、今すぐ始めましょう
論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。