Skip to main content
QUICK REVIEW

[論文レビュー] Analyzing Latency Hiding and Parallelism in an MLIR-based AI Kernel Compiler

Javed Absar, Samarth Narang|arXiv (Cornell University)|Feb 22, 2026
Parallel Computing and Optimization TechniquesComputer Science被引用数 0
ひとこと要約

この論文は、Triton/Inductorで生成されたカーネルとアブレーション階段を用いて、MLIRベースのAIカーネルコンパイラにおけるベクトル化、マルチスレッド、およびデュアルバッファリングの個別影響を再現可能な方法論で定量化します。

ABSTRACT

AI kernel compilation for edge devices depends on the compiler's ability to exploit parallelism and hide memory latency in the presence of hierarchical memory and explicit data movement. This paper reports a benchmark methodology and corresponding results for three compiler-controlled mechanisms in an MLIR-based compilation pipeline: vectorization (Vec), multi-threading (MT) across hardware contexts, and double buffering (DB) using ping--pong scratchpad buffers to overlap DMA transfers with compute. Using Triton/Inductor-generated kernels, we present an ablation ladder that separates the contribution of Vec, MT, and DB, and we quantify how MT speedup scales with problem size using GELU as a representative activation kernel. The results show that vectorization provides the primary gain for bandwidth-sensitive kernels, MT delivers substantial improvements once scheduling overhead is amortized, and DB provides additional benefit when transfers and compute can be overlapped (i.e., outside the extremes of purely memory-bound or purely compute-bound behavior).

研究の動機と目的

  • エッジAIワークロードにおけるコンパイラ制御メカニズムのカ kernel-focused な再現可能評価を動機づける。
  • ベクトル化、マルチスレッド、デュアルバッファリングの寄与を、統制されたアブレーション階梯を用いて定量化する。
  • MLIR IRパターンとパスが、MTとDBをポータブルかつ拡張可能な方法で実現することを示す。

提案手法

  • スカラー → Vec → Vec+MT → Vec+MT+DB の簡易アブレーション階梯を定義し、各メカニズムへの利得を帰属する。
  • タイル化カーネルからscf.forall、さらにAsyncフォーク–ジョインへの二段階降下を実装し、構造化された遅延降下スケジュールを可能にする。
  • 二-buffer ping–pongスケジュールを構築し、同期転送を非同期DMAプリミティブで置換してデュアルバッファリングを実装する。
  • 実行時構造体へ降ろす前に、計算を可能な限り構造化IRに保つMLIRベースの設計を用いる。
  • 2Dベクトル加算とGELUの2つのカーネルを、異なる問題サイズでベンチマークし、スケーリングとオーバーラップ効果を観察する。
  • 適用可能な場合、レイテンシ(μs)とスピードアップ(シングルスレッド対マルチスレッドの比)を報告する。
Figure 1: vec-add-2d ( $[64,128\times 128]$ elements) ablation ladder: Scalar (132,479 $\mu$ s), Vec (3,210 $\mu$ s), Vec+MT (3,000 $\mu$ s), Vec+MT+DB (2,689 $\mu$ s).
Figure 1: vec-add-2d ( $[64,128\times 128]$ elements) ablation ladder: Scalar (132,479 $\mu$ s), Vec (3,210 $\mu$ s), Vec+MT (3,000 $\mu$ s), Vec+MT+DB (2,689 $\mu$ s).

実験結果

リサーチクエスチョン

  • RQ1MLIR生成カーネルに対するベクトル化、マルチスレッド、デュアルバッファリングの相対的影響はどれか。
  • RQ2問題サイズが大きくなるとマルチスレッドはどのようにスケールし、スケジューリングオーバーヘッドはどこで償却されるか。
  • RQ3DMA転送と計算のオーバーラップが意味のある利点をデュアルバッファリングにもたらすのはいつか。
  • RQ4再現可能なMLIRベースの方法論は、特定のコンパイラメカニズムへの性能向上を帰属できるか。

主な発見

  • ベクトル化は帯域幅に敏感なカーネル(例:vec-add-2d)で優位な改善をもたらす:132,479 μs → 3,210 μs; 約41.3×。
  • ベクトル化後、マルチスレッドは追加の利得をもたらし、オーバーヘッドが償却されるとMT以降の小さな改善が続く。
  • デュアルバッファリングは転送と計算のオーバーラップがあるときに漸進的な利点を与え、純粋なメモリ境界または純粋な計算境界では減少する。
  • GELUは1,048,576要素でMTスピードアップが最大約3.91×(シングルスレッド12,947 μs 対 マルチスレッド3,313 μs)。
  • 問題サイズが大きくなるにつれてMTの利得はオーバーヘッドが償却されるため増加するが、メモリ帯域幅やバリアコストにより飽和する。
Figure 2: GELU latency vs problem size for single-threaded and multi-threaded execution.
Figure 2: GELU latency vs problem size for single-threaded and multi-threaded execution.

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。