LLM-Driven Cross-Platform Code Generation for Polyhedral Optimized NPDP Codes
摘要
This paper explores using large language models (LLM) for automatic and source-to-source programming across various cross-platform languages and libraries, including generating CUDA code for high performance computing (HPC). Our proposed solution aims to demonstrate the capabilities of ChatGPT in generating valid CUDA code based on existing OpenMP code obtained from a polyhedral compilers Traco and Dapt. Specifically, we intend to showcase the model’s proficiency in producing equivalent and valid GPU code. Furthermore, we extend the application of our solution by prompting the AI model to generate similar code for another input benchmark, emphasizing its adaptability and versatility across different scenarios. This approach seeks to highlight the model’s capacity to provide automated and efficient solutions for diverse programming challenges. We chose non-trivial kernels from the non-serial polyadic dynamic programming (NPDP) benchmark with non-uniform loops. The focus is on ensuring code validity and understanding limitations in obtaining valid CUDA code. Additionally, we assess the efficiency and scalability of NVIDIA A100 GPU codes generated by artificial intelligence (AI) models, comparing them with optimized Intel Xeon Gold CPU codes from polyhedral optimizers.