基於排程樹模式匹配的核心函數替換

Substitution of Kernel Functions based on Pattern Matching on Schedule Trees

檔案

  • 01.pdf (757.5 KB, Adobe PDF)

日期

2022

類型

語言

英文

摘要

隨著人工智慧的興起,各種具有特定架構的計算硬體也應運而生。對於一些常用於人工智慧運算的核心函數,這些硬體提供了專門的加速器和相應的指令。例如自 Volta 架構以來,Nvidia 圖形處理器提供了 Tensor Core 來優化與矩陣乘法相關的操作。RISC-V 架構的向量擴展為核心函數提供指令層級的平行化。
為了提高核函數的計算性能,自動並行化和優化其數據局部性是一種常見的做法。對於循環優化問題,多面體編譯技術提供了靈活性和豐富的操作語義。本研究擴展了 PPCG(一個基於多面體編譯技術的自動平行化編譯器),以提供排程樹上的模式匹配和核心函數替換的能力,以支持各種特定平台的加速指令調用。
本研究為模式匹配提供了一種語言,方便用戶生成相關匹配器,用於核心函數語義的比較。在實驗中,我們在 x64 平台上使用 CBLAS(intel-mkl),在 GPU 上使用帶有 Tensor Core 指令的 CuBLAS,在 RISC-V 平台上使用包含向量指令的 OpenBLAS(軟體模擬,使用 Ara 向量單元提供的向量指令功能)來執行加速- Polybench上相應平台的指令調用優化。
所選 BLAS 基準的平均(幾何)性能改進總結為: x64 總時間加速 8.67 倍,GPU 內核性能提升 5.27 倍,RISC-V 總時鐘週期加速 5.78 倍。
With the rise of AI, various computing hardware with specific architectures have also emerged. For some commonly used AI kernel functions, the hardware provides special accelerators and corresponding instructions.
For example, since the Volta architecture, Nvidia GPUs have provided tensor cores to optimize operations related to matrix multiplication. The vector extension of the RISC-V architecture provides instruction-level parallelization for kernel functions.
To improve the computing performance of kernel functions, it is a common practice to automatically parallelize and optimize its data locality. For loop optimization problems, polyhedral compilation technology provides flexibility and rich operational semantics. This study extends PPCG (an automatic parallelization compiler based on polyhedral compilation technology) to provide the ability of pattern matching and kernel function replacement on schedule trees to support acceleration-instruction calls for various specific platforms.
This research provides a language for pattern matching, which is convenient for users to generate relevant matchers for the comparison of kernel function semantics. In the experiments, we used CBLAS(intel-mkl) on the x64 platform, CuBLAS with tensor cores instructions on GPU, and OpenBLAS containing vector instructions on the RISC-V platform (software simulation, simulated vector instruction on Ara vector unit) to perform the acceleration-instruction call optimization of the corresponding platform on the Polybench.
Average (geomean) performance improvements on selected BLAS benchmarks are summarized as x64 total-time speedup 8.67x, GPU kernel performance improvement 5.27x, RISC-V total-cycle speedup 5.78x.
顯示完整詮釋資料 統計資料

引用此條目

Chen, Z.-X. (2022). Substitution of Kernel Functions based on Pattern Matching on Schedule Trees. https://thesis.lib.nycu.edu.tw/handle/20.500.14371/80352

BibTeX RIS

引用文字依 APA 第 7 版格式自動產生,使用前請再核對。

分享

永久網址:https://thesis.lib.nycu.edu.tw/handle/20.500.14371/80352