High-Performance GPU-to-CPU Transpilation and Optimization via High-Level Parallel Constructs

Authors: William S. Moses, Ivan R. Ivanov, Jens Domke, Toshio Endo, Johannes Doerfert, Oleksandr Zinenko

Submitted to arXiv on 01 Jul. 2022
Abstract

While parallelism remains the main source of performance, architectural implementations and programming models change with each new hardware generation, often leading to costly application re-engineering. Most tools for performance portability require manual and costly application porting to yet another programming model. We propose an alternative approach that automatically translates programs written in one programming model (CUDA), into another (CPU threads) based on Polygeist/MLIR. Our approach includes a representation of parallel constructs that allows conventional compiler transformations to apply transparently and without modification and enables parallelism-specific optimizations. We evaluate our framework by transpiling and optimizing the CUDA Rodinia benchmark suite for a multi-core CPU and achieve a 76% geomean speedup over handwritten OpenMP code. Further, we show how CUDA kernels from PyTorch can efficiently run and scale on the CPU-only Supercomputer Fugaku without user intervention. Our PyTorch compatibility layer making use of transpiled CUDA PyTorch kernels outperforms the PyTorch CPU native backend by 2.7$\times$.

The papers around it, by date and closeness

Higher is closer to this paper; left is older. Lines join papers close to each other: groups of lines are sub-topics. Select a point to see why it is there. Back to the summary of this paper

How to read this map? Illustrated guide

Closest papers Prior work it builds on Papers that cite it

Papers around this one

Ranked by how close their title and abstract are to this paper’s. Select some to read them together.

Closest papers

  1. Very close
    GPU First -- Execution of Legacy CPU Codes on GPUs
    Shilei Tian, Tom Scogland, Barbara Chapman et al. · 2023 · Distributed, Parallel, and Cluster Computing · preprint, not peer reviewed · cited 3 times · Not summarized yet
    Abstract

    Utilizing GPUs is critical for high performance on heterogeneous systems. However, leveraging the full potential of GPUs for accelerating legacy CPU applications can be a challenging task for developers. The porting process requires identifying code regions amenable to acceleration, managing distinct memories, synchronizing host and device execution, and handling library functions that may not be directly executable on the device. This complexity makes it challenging for non-experts to leverage GPUs effectively, or even to start offloading parts of a large legacy application. In this paper, we propose a novel compilation scheme called "GPU First" that automatically compiles legacy CPU applic…

  2. Very close Cites this paper
    HPCTransCompile: An AI Compiler Generated Dataset for High-Performance CUDA Transpilation and LLM Preliminary Exploration
    Jia-Qi Lv, Xufeng He, Yanchen Liu et al. · 2025 · arXiv.org · preprint, not peer reviewed · cited 4 times · Not summarized yet
    Abstract

    The rapid growth of deep learning has driven exponential increases in model parameters and computational demands. NVIDIA GPUs and their CUDA-based software ecosystem provide robust support for parallel computing, significantly alleviating computational bottlenecks. Meanwhile, due to the cultivation of user programming habits and the high performance of GPUs, the CUDA ecosystem has established a dominant position in the field of parallel software. This dominance requires other hardware platforms to support CUDA-based software with performance portability. However, translating CUDA code to other platforms poses significant challenges due to differences in parallel programming paradigms and har…

  3. Very close
    On the Portability of CPU-Accelerated Applications via Automated Source-to-Source Translation
    Paul Sathre, M. Gardner, Wu-chun Feng · 2019 · International Conference on High Performance Computing in Asia-Pacific Region · cited 19 times · Not summarized yet
    Abstract

    Over the past decade, accelerator-based supercomputers have grown from 0% to 42% performance share on the TOP500. Ideally, GPU-accelerated code on such systems should be "write once, run anywhere," regardless of the GPU device (or for that matter, any parallel device, e.g., CPU or FPGA). In practice, however, portability can be significantly more limited due to the sheer volume of code implemented in non-portable languages. For example, the tremendous success of CUDA, as evidenced by the vast cornucopia of CUDA-accelerated applications, makes it infeasible to manually rewrite all these applications to achieve portability. Consequently, we achieve portability by using our automated CUDA-to-Op…

  4. Very close Cites this paper
    Unleashing CPU Potential for Executing GPU Programs Through Compiler/Runtime Optimizations
    Ruo-Bing Han, Ji-Shen Zhao, Hyesoon Kim · 2024 · Micro · cited 2 times · Not summarized yet
    Abstract

    Although modern CPUs deliver high performance, they are often under-utilized in CPU-GPU heterogeneous systems. Enabling CPUs to execute GPU programs facilitates workload sharing between CPUs and GPUs, which can increase CPU device utilization and overall benefit heterogeneous systems. The flat collapsing transformation represents a state-of-the-art solution for GPU-to-CPU migration and is widely accepted in both academic and commercial projects. However, in this paper, we identify that CPU programs transformed by flat collapsing transformation are not compatible with standard CPU compiler optimizations and runtime environments, which leads to suboptimal performance. Based on the observation,…

  5. Very close
    Breaking the Vendor Lock: Performance Portable Programming through OpenMP as Target Independent Runtime Layer
    Johannes Doerfert, Marc Jasper, Joseph Huber et al. · 2022 · International Conference on Parallel Architectures and Compilation Techniques · cited 14 times · Not summarized yet
    Abstract

    High performance computing (HPC) systems pervasively feature GPU accelerators. For maximum efficiency, these are usually programmed using vendor-specific languages, such as CUDA. However, this is not portable and leads to vendor lock-in. Existing portable proramming models require transcribing the whole application, which is tedious and often results in sub-optimal performance without necessarily avoiding the need to maintain multiple versions. Although solutions for automated translation exist, they sacrifice either features of the original model, performance, or both. We propose a novel compiler-based approach for performance portable programming of GPUs by generating portable code from th…

  6. Very close
    nomp: A Framework for Building Domain Specific Compilers
    Thilina Ratnayaka, K. Kulkarni, Nipuna Fernando et al. · 2026 · arXiv.org · preprint, not peer reviewed · Not summarized yet
    Abstract

    The low-level GPU programming models (CUDA, HIP, OpenCL, etc.) provide detailed control of the data flow and execution plan of a program in order to extract close-to-metal performance. However, these have a steep learning curve due to the intricacies of their syntax and semantics. This reduces programmer productivity. On the other hand, high-level models (OpenMP, OpenACC, etc.) that serve as abstractions over the low-level models are aimed at improving programmer productivity but achieving performance on-par with the low-level models is a challenge. There are inherent trade-offs between productivity, portability and performance in both approaches and there is no one-size-fits-all solution wh…

  7. Very close
    Proteus: Portable Runtime Optimization of GPU Kernel Execution with Just-in-Time Compilation
    Giorgis Georgakoudis, Konstantinos Parasyris, David Beckingsale · 2025 · IEEE/ACM International Symposium on Code Generation and Optimization · cited 6 times · Not summarized yet
    Abstract

    In High-performance computing (HPC) fast application execution is the primary objective. HPC software is written in high-performance languages (C/C++, Fortran) and is statically compiled Ahead-of-Time (AOT) using optimizing compilers to generate fast code. AOT compilation optimizes source code with only limited information available at compile time, which precludes possible optimization leveraging runtime information. We propose Proteus, an easy-to-use, portable, and lightweight Just-In-Time (JIT) compilation approach to optimize GPU kernels at runtime. Proteus dynamically extracts, compiles, and optimizes language-agnostic LLVM IR to reduce compilation overhead while enhancing portability a…

  8. Close Cites this paper Uses this paper in depth
    Retargeting and Respecializing GPU Workloads for Performance Portability
    Ivan R. Ivanov, O. Zinenko, Jens Domke et al. · 2024 · IEEE/ACM International Symposium on Code Generation and Optimization · cited 12 times · Not summarized yet
    Abstract

    In order to come close to peak performance, accelerators like GPUs require significant architecture-specific tuning that understand the availability of shared memory, parallelism, tensor cores, etc. Unfortunately, the pursuit of higher performance and lower costs have led to a significant diversification of architecture designs, even from the same vendor. This creates the need for performance portability across different GPUs, especially important for programs in a particular programming model with a certain architecture in mind. Even when the program can be seamlessly executed on a different architecture, it may suffer a performance penalty due to it not being sized appropriately to the ava…

Prior work it builds on

  1. Close Used in depth by this paper A method it uses
    pocl: A Performance-Portable OpenCL Implementation
    Pekka Jääskeläinen, Carlos Sánchez de La Lama, Erik Schnetter et al. · 2016 · Int J Parallel Prog (2015) 43: 752 · cited 165 times · Not summarized yet
    Abstract

    OpenCL is a standard for parallel programming of heterogeneous systems. The benefits of a common programming standard are clear; multiple vendors can provide support for application descriptions written according to the standard, thus reducing the program porting effort. While the standard brings the obvious benefits of platform portability, the performance portability aspects are largely left to the programmer. The situation is made worse due to multiple proprietary vendor implementations with different characteristics, and, thus, required optimization strategies. In this paper, we propose an OpenCL implementation that is both portable and performance portable. At its core is a kernel compi…

  2. Close* Used in depth by this paper A method it uses
    MCUDA: An Efficient Implementation of CUDA Kernels for Multi-core CPUs
    John A. Stratton, S. Stone, W. Hwu · 2008 · International Workshop on Languages and Compilers for Parallel Computing · cited 227 times · Not summarized yet
  3. Close A method it uses
    COX: CUDA on X86 by Exposing Warp-Level Functions to CPUs
    Ruobing Han, Jaewon Lee, Jaewoong Sim et al. · 2021 · arXiv.org · preprint, not peer reviewed · cited 3 times · Not summarized yet
    Abstract

    As CUDA programs become the de facto program among data parallel applications such as high-performance computing or machine learning applications, running CUDA on other platforms has been a compelling option. Although several efforts have attempted to support CUDA on other than NVIDIA GPU devices, due to extra steps in the translation, the support is always behind a few years from supporting CUDA's latest features. The examples are DPC, Hipfy, where CUDA source code have to be translated to their native supporting language and then they are supported. In particular, the new CUDA programming model exposes the warp concept in the programming language, which greatly changes the way the CUDA cod…

  4. Close A method it uses
    A Virtual GPU as Developer-Friendly OpenMP Offload Target
    Atmn Patel, Shilei Tian, Johannes Doerfert et al. · 2021 · ICPP Workshops · cited 14 times · Not summarized yet
    Abstract

    While parallel programming is hard, programming accelerators has always been even more complicated. One fundamental reason is the lack of mature tooling that can be used to inspect a program that executes on two different architectures. As GPU software stacks of different vendors provide vastly different experience for developers, it is clear that the gold standard for debugging is still host (CPU) execution with its myriad of mature tooling options. In this work we present a virtual GPU (VGPU) OpenMP offloading target that allows to emulate a GPU execution environment on the host. In contrast to classical “host offloading”, the VGPU target reuses the same execution model, compilation paths,…

  5. Close
    Loo.py: transformation-based code generation for GPUs and CPUs
    Andreas Klöckner · 2014 · ARRAY@PLDI · cited 66 times · Not summarized yet
    Abstract

    Today's highly heterogeneous computing landscape places a burden on programmers wanting to achieve high performance on a reasonably broad cross-section of machines. To do so, computations need to be expressed in many different but mathematically equivalent ways, with, in the worst case, one variant per target machine. Loo.py, a programming system embedded in Python, meets this challenge by defining a data model for array-style computations and a library of transformations that operate on this model. Offering transformations such as loop tiling, vectorization, storage management, unrolling, instruction-level parallelism, change of data layout, and many more, it provides a convenient way to ca…

Papers that cite it

  1. Close Uses this paper in depth
    From Threads to Tiles: T2T, a Compiler for CUDA-to-NPU Translation via 2D Vectorization
    Shuai Li, Jia-Cheng Zhao, Ying Liu et al. · 2026 · IEEE/ACM International Symposium on Code Generation and Optimization · cited 1 time · Not summarized yet
    Abstract

    CUDA’s programming model, exposing massive parallelism via fine-grained scalar threads, has become the de facto standard for GPU computing. Concurrently, NPUs are emerging as highly efficient accelerators, but their architecture is fundamentally different, relying on coarse-grained, explicit 2-D tile-based instructions. This creates a critical challenge: bridging the semantic gap "From Threads to Tiles". A direct translation is infeasible, as it requires lifting the implicit parallelism of CUDA’s scalar model into the explicit, multi-dimensional vector space of NPUs, a problem we formalize as a lifting challenge.This paper introduces T2T, a compiler framework that automates this "Threads to …

  2. Close
    Implementation Techniques for SPMD Kernels on CPUs
    Joachim Meyer, Aksel Alpay, Sebastian Hack et al. · 2023 · International Workshop on OpenCL · cited 9 times · Not summarized yet
    Abstract

    More and more frameworks and simulations are developed using heterogeneous programming models such as OpenCL, SYCL, CUDA, or HIP. A significant hurdle to mapping these models to CPUs in a performance-portable manner is that implementing work-group barriers for such kernels requires providing forward-progress guarantees so that all work-items can reach the barrier. This work provides guidance for implementations of single-program multiple-data (SPMD) programming models, such as OpenCL, SYCL, CUDA, or HIP, on non-SPMD devices, such as CPUs. We discuss the trade-offs of multiple approaches to handling work-group-level barriers. We present our experience with the integration of two known compile…

  3. Close
    A Library and Environment for Parallel Processing in a Power-Limited CPU+GPU Cluster Environment
    Piotr Sieński, S. Leśniewski, Aleksandra Hein et al. · 2025 · IEEE Access · cited 1 time · Not summarized yet
    Abstract

    In this article, we extend the CUDAMPILIB framework, which facilitates the programming of parallel applications for multi-node systems with one or more graphical processing units (GPUs) per node. The framework employs an OpenMP-extended CUDA API while utilizing free CPU cores not engaged in GPU control for additional computation. We further enhance the power-capping algorithm to consider both CPUs and GPUs within a cluster. To maintain the original framework’s workflow, we mimicked CUDA streams functionality for CPUs, ensuring seamless integration. Given the significant architectural differences between GPUs and CPUs, we implemented a dynamic data packet sizing algorithm to prevent CPUs from…

  4. Close
    CKTI: A Domain-Specific Compiler for Lowering CUDA Kernels to Triton-IR
    Chang-Qing Shi, Rui Chen, Yufei Sun et al. · 2026 · International Conference on Supercomputing · Not summarized yet
    Abstract

    CUDA kernels are essential for high-performance computing, yet their deployment has been limited to vendor-specific chips. Unless highly efficient computational kernels are custom-implemented by experts, other chips may face problems such as low utilization and inability to accelerate AI computing. In this paper, we introduce CKTI, a domain-specific compiler that lowers CUDA kernels to Triton-IR, thereby decoupling them from proprietary hardware and fostering diversity across the computing ecosystem. CKTI proposes a scheduling algorithm that transforms the threading model from thread-level to tile-level, along with a mapping scheme from explicit control-structure characteristics to dynamic m…

  5. Close
    A Comparative Analysis of OpenMP and Cuda in Real-Time Applications
    Devesh Nahar, Mangalya D. Phaye, R. Garg et al. · 2025 · International Conference Computing Methodologies and Communication · cited 2 times · Not summarized yet
    Abstract

    The need for effective parallel computing in real-time applications has gained momentum with advancements in multi-core processors and GPUs. OpenMP and CUDA are prominent frameworks, with OpenMP streamlining multi-core CPUs and CUDA utilizing GPU parallelism. This comparison measures performance in real-time applications like image processing, scientific computing, and medical diagnostics. The results show that CUDA performs 2.5×–16× speedups for highly parallel applications, and OpenMP is competitive in memory-bound workloads. This can inspire industrialists and research scholars to implement CUDA for sustainable development and economic growth in parallel processing systems. Chief challeng…

How are these papers found?

We compare the title and abstract of this paper with those of every paper summarized on this site, and with the papers Semantic Scholar recommends, those it cites and those citing it (for a much-cited paper, its most recent citations and, from OpenAlex, the most cited ones). Among the prior work and the follow-ups, the papers that use each other in depth, a method it uses and the much-cited follow-ups come a little higher. The levels (very close, close, related) come from the similarity of the texts, not from a judgment of quality; * marks a paper without an abstract, compared by its title. The sentence under a paper is written by an AI from the two abstracts: check it in the papers. A paper marked not relevant by three readers leaves the list.

Updated on 6 November 2026.

The illustrated guide to the papers around a paper