Comparing Llama-2 and GPT-3 LLMs for HPC Kernels Generation

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

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.

Original languageEnglish
Title of host publicationLanguages and Compilers for Parallel Computing - 36th International Workshop, LCPC 2023, Revised Selected Papers
EditorsHenry Dietz
PublisherSpringer Science and Business Media Deutschland GmbH
Pages20-32
Number of pages13
ISBN (Print)9783032024350
DOIs
StatePublished - 2026
Event36th International Workshop on Languages and Compilers for Parallel Computing, LCPC 2023 - Lexington, United States
Duration: Oct 11 2023Oct 13 2023

Publication series

NameLecture Notes in Computer Science
Volume14480 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Conference

Conference36th International Workshop on Languages and Compilers for Parallel Computing, LCPC 2023
Country/TerritoryUnited States
CityLexington
Period10/11/2310/13/23

Funding

This work is funded by Bluestone, an X-Stack project in the DOE Advanced Scientific Computing Office with program manager Hal Finkel.

Keywords

  • GPT
  • HPC
  • LLM
  • Llama-2

Fingerprint

Dive into the research topics of 'Comparing Llama-2 and GPT-3 LLMs for HPC Kernels Generation'. Together they form a unique fingerprint.

Cite this