Javascript must be enabled to continue!
QiMeng-GEMM: Automatically Generating High-Performance Matrix Multiplication Code by Exploiting Large Language Models
View through CrossRef
As a crucial operator in numerous scientific and engineering computing applications, the automatic optimization of General Matrix Multiplication (GEMM) with full utilization of ever-evolving hardware architectures (e.g. GPUs and RISC-V) is of paramount importance. While Large Language Models (LLMs) can generate functionally correct code for simple tasks, they have yet to produce high-performance code. The key challenge resides in deeply understanding diverse hardware architectures and crafting prompts that effectively unleash the potential of LLMs to generate high-performance code.
In this paper, we propose a novel prompt mechanism called QiMeng-GEMM which enables LLMs to comprehend the architectural characteristics of different hardware platforms and automatically search for the optimization combinations for GEMM. The key of QiMeng-GEMM is a set of informative, adaptive, and iterative meta-prompts. Based on this, a searching strategy for optimal combinations of meta-prompts is used to iteratively generate high-performance code. Extensive experiments conducted on 4 leading LLMs, various paradigmatic hardware platforms, and representative matrix dimensions unequivocally demonstrate QiMeng-GEMM’s superior performance in auto-generating optimized GEMM code. Compared to vanilla prompts, our method achieves a performance enhancement of up to 113×. Even when compared to human experts, our method can reach 115% of cuBLAS on NVIDIA GPUs and 211% of OpenBLAS on RISC-V CPUs. Notably, while human experts often take months to optimize GEMM, our approach reduces the development cost by over 240×.
Association for the Advancement of Artificial Intelligence (AAAI)
Title: QiMeng-GEMM: Automatically Generating High-Performance Matrix Multiplication Code by Exploiting Large Language Models
Description:
As a crucial operator in numerous scientific and engineering computing applications, the automatic optimization of General Matrix Multiplication (GEMM) with full utilization of ever-evolving hardware architectures (e.
g.
GPUs and RISC-V) is of paramount importance.
While Large Language Models (LLMs) can generate functionally correct code for simple tasks, they have yet to produce high-performance code.
The key challenge resides in deeply understanding diverse hardware architectures and crafting prompts that effectively unleash the potential of LLMs to generate high-performance code.
In this paper, we propose a novel prompt mechanism called QiMeng-GEMM which enables LLMs to comprehend the architectural characteristics of different hardware platforms and automatically search for the optimization combinations for GEMM.
The key of QiMeng-GEMM is a set of informative, adaptive, and iterative meta-prompts.
Based on this, a searching strategy for optimal combinations of meta-prompts is used to iteratively generate high-performance code.
Extensive experiments conducted on 4 leading LLMs, various paradigmatic hardware platforms, and representative matrix dimensions unequivocally demonstrate QiMeng-GEMM’s superior performance in auto-generating optimized GEMM code.
Compared to vanilla prompts, our method achieves a performance enhancement of up to 113×.
Even when compared to human experts, our method can reach 115% of cuBLAS on NVIDIA GPUs and 211% of OpenBLAS on RISC-V CPUs.
Notably, while human experts often take months to optimize GEMM, our approach reduces the development cost by over 240×.
Related Results
Hubungan Perilaku Pola Makan dengan Kejadian Anak Obesitas
Hubungan Perilaku Pola Makan dengan Kejadian Anak Obesitas
<p><em><span style="font-size: 11.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-langua...
Studies of human pluripotential hemopoietic stem cells (CFU-GEMM) in vitro
Studies of human pluripotential hemopoietic stem cells (CFU-GEMM) in vitro
Abstract
An in vitro clonal assay for a class of human hemopoietic progenitors (CFU-GEMM) with several characteristics of pluripotential stem cells has been previous...
Studies of human pluripotential hemopoietic stem cells (CFU-GEMM) in vitro
Studies of human pluripotential hemopoietic stem cells (CFU-GEMM) in vitro
An in vitro clonal assay for a class of human hemopoietic progenitors (CFU-GEMM) with several characteristics of pluripotential stem cells has been previously described. In the pre...
Učinak poučavanja razrednomu jeziku u izobrazbi nastavnika njemačkoga
Učinak poučavanja razrednomu jeziku u izobrazbi nastavnika njemačkoga
The actual use of classroom language is principally limited to the classroom environment. As far as foreign language learning is concerned, the classroom often turns out to be the ...
QiMeng-TensorOp: One-Line Prompt is Enough for High-Performance Tensor Operator Generation with Hardware Primitives
QiMeng-TensorOp: One-Line Prompt is Enough for High-Performance Tensor Operator Generation with Hardware Primitives
Computation-intensive tensor operators constitute over 90% of the computations in Large Language Models (LLMs) and Deep Neural Networks. Automatically and efficiently generating hi...
QiMeng-TensorOp: One-Line Prompt is Enough for High-Performance Tensor Operator Generation with Hardware Primitives
QiMeng-TensorOp: One-Line Prompt is Enough for High-Performance Tensor Operator Generation with Hardware Primitives
Computation-intensive tensor operators constitute over 90% of the computations in Large Language Models (LLMs) and Deep Neural Networks. Automatically and efficiently generating hi...
PENERAPAN MEDIA PAPAN PERKALIAN DALAM MENGATASI KESULITAN BELAJAR BERHITUNG PERKALIAN KELAS 3
PENERAPAN MEDIA PAPAN PERKALIAN DALAM MENGATASI KESULITAN BELAJAR BERHITUNG PERKALIAN KELAS 3
The problem experienced by 3rd grade students of MI Islamiyah Banjaranyar during the learning process is difficulty in calculating multiplication. This study aims to find out the d...
Increased life expectancy of heart failure patients in a rural center by a multidisciplinary program
Increased life expectancy of heart failure patients in a rural center by a multidisciplinary program
Abstract
Funding Acknowledgements
Type of funding sources: None.
INTRODUCTION Patients with heart failure (HF)...

