Treffer: Using ChatGPT for Converting Sequential Python Programs into Parallel Code

Title:
Using ChatGPT for Converting Sequential Python Programs into Parallel Code
Source:
College of Health, Science, and Technology
Publisher Information:
DigitalCommons@Fayetteville State University
Publication Year:
2025
Collection:
DigitalCommons@Fayetteville State University
Document Type:
Fachzeitschrift text
Language:
unknown
Accession Number:
edsbas.F44267BE
Database:
BASE

Weitere Informationen

This paper investigates ChatGPT capability to automatically convert sequential Python programs into parallel code, addressing the challenge of parallelizing code for multi-core processors. We develop a methodology where sequential code is fed to ChatGPT with prompts to introduce parallel constructs (e.g., multithreading, multiprocessing), and we evaluate the correctness and performance of the AI-generated parallel code. A comparative analysis against traditional parallelization methods—including manual expert refactoring and existing automated tools—highlights the effectiveness and limitations of ChatGPT in parallel code transformation. The results show that ChatGPT can identify independent computations and inject parallelism to achieve notable speedups comparable to human-written parallel code in simple cases, significantly reducing development effort. However, ChatGPT, if not guided by appropriate patterns, fails with more complex scenarios: it may overlook Python-specific constraints, leading to suboptimal or incorrect parallel code that requires manual correction. © 2025 Elsevier B.V., All rights reserved.