ChatPaper.aiChatPaper

대규모 언어 모델을 위한 컴파일러 생성 피드백

Compiler generated feedback for Large Language Models

March 18, 2024
저자: Dejan Grubisic, Chris Cummins, Volker Seeker, Hugh Leather
cs.AI

초록

우리는 LLVM 어셈블리의 코드 크기를 최적화하기 위해 컴파일러 피드백과 결합된 대형 언어 모델(Large Language Models)을 활용한 새로운 컴파일러 최적화 패러다임을 소개합니다. 이 모델은 최적화되지 않은 LLVM IR을 입력으로 받아 최적화된 IR, 최적의 최적화 패스, 그리고 최적화 전후의 명령어 수를 출력합니다. 그런 다음 생성된 최적화 패스를 사용하여 입력을 컴파일하고, 예측된 명령어 수가 정확한지, 생성된 IR이 컴파일 가능한지, 그리고 컴파일된 코드와 일치하는지 평가합니다. 이 피드백을 다시 LLM에 제공하여 코드를 다시 최적화할 기회를 줍니다. 이 접근 방식은 기존 모델 대비 -Oz에 추가로 0.53%의 개선을 달성했습니다. 피드백을 통해 더 많은 정보를 추가하는 것이 직관적으로 보이지만, 단순한 샘플링 기법은 10개 이상의 샘플이 주어졌을 때 훨씬 더 높은 성능을 보여줍니다.
English
We introduce a novel paradigm in compiler optimization powered by Large Language Models with compiler feedback to optimize the code size of LLVM assembly. The model takes unoptimized LLVM IR as input and produces optimized IR, the best optimization passes, and instruction counts of both unoptimized and optimized IRs. Then we compile the input with generated optimization passes and evaluate if the predicted instruction count is correct, generated IR is compilable, and corresponds to compiled code. We provide this feedback back to LLM and give it another chance to optimize code. This approach adds an extra 0.53% improvement over -Oz to the original model. Even though, adding more information with feedback seems intuitive, simple sampling techniques achieve much higher performance given 10 or more samples.

Summary

AI-Generated Summary

PDF61December 15, 2024