Comparing Llama-2 and GPT-3 LLMs for HPC kernels generation
arXiv:2309.07103
Abstract
We evaluate the use of the open-source Llama-2 model for generating well-known, high-performance computing kernels (e.g., AXPY, GEMV, GEMM) on different parallel programming models and languages (e.g., C++: OpenMP, OpenMP Offload, OpenACC, CUDA, HIP; Fortran: OpenMP, OpenMP Offload, OpenACC; Python: numpy, Numba, pyCUDA, cuPy; and Julia: Threads, CUDA.jl, AMDGPU.jl). We built upon our previous work that is based on the OpenAI Codex, which is a descendant of GPT-3, to generate similar kernels with simple prompts via GitHub Copilot. Our goal is to compare the accuracy of Llama-2 and our original GPT-3 baseline by using a similar metric. Llama-2 has a simplified model that shows competitive or even superior accuracy. We also report on the differences between these foundational large language models as generative AI continues to redefine human-computer interactions. Overall, Copilot generates codes that are more reliable but less optimized, whereas codes generated by Llama-2 are less reliable but more optimized when correct.
arXiv commentAccepted at LCPC 2023, The 36th International Workshop on Languages and Compilers for Parallel Computing http://www.lcpcworkshop.org/LCPC23/ . 13 pages, 5 figures, 1 table
References in corpus (6)
- The NumPy array: a structure for efficient numerical computation
- Llama 2: Open Foundation and Fine-Tuned Chat Models
- PyCUDA and PyOpenCL: A Scripting-Based Approach to GPU Run-Time Code Generation
- Effective Extensible Programming: Unleashing Julia on GPUs
- Evaluation of OpenAI Codex for HPC Parallel Programming Models Kernel Generation
- Evaluating performance and portability of high-level programming models: Julia, Python/Numba, and Kokkos on exascale nodes