STParOpt: An End-to-End Framework for Execution-Aware Parallelism Inference and Optimized CUDA Migration
Abstract
Automatically migrating serial C programs to CUDA is important for high-performance computing, yet remains challenging due to the partial observability of data dependencies: critical memory access patterns are difficult to infer from source code alone. Static analyses are often conservative on irregular and pointer-intensive loops, while LLM-based approaches lack explicit execution evidence for memory-access-dependent optimization decisions. To address these limitations, we propose STParOpt, an execution-aware framework that combines static program structure with runtime memory-access features for joint parallelism and optimization inference. STParOpt augments static program graphs with stride-level execution features via cross-attention and uses entropy-guided fusion to adaptively weight static and dynamic evidence. Experiments on standard HPC benchmarks demonstrate that STParOpt outperforms both compiler-based and LLM-based baselines on parallelism detection and CUDA code generation. Notably, STParOpt achieves 96.63 ± 0.23% parallelism detection accuracy across three seeds and 86.1% end-to-end generation correctness, surpassing the strongest compared baselines by 2.06 pp and 11.4 pp, respectively.