Skip to main content
QUICK REVIEW

[Paper Review] Bring Your Own Codegen to Deep Learning Compiler

Zhi Chen, Cody Hao Yu|arXiv (Cornell University)|May 3, 2021
Advanced Neural Network ApplicationsComputer Science31 references7 citations
TL;DR

This paper proposes a unified open-source framework that enables deep learning accelerator vendors to plug in their proprietary code generation tools into existing deep learning compilers, decoupling accelerator-specific codegen from shared compiler infrastructure. By reusing standard compiler optimizations and enabling flexible model partitioning, the framework reduces development effort to just a few thousand lines of code and has been successfully deployed in commercial stacks like NVIDIA Jetson and Xilinx Vitis-AI with measurable performance gains.

ABSTRACT

Deep neural networks (DNNs) have been ubiquitously applied in many applications, and accelerators are emerged as an enabler to support the fast and efficient inference tasks of these applications. However, to achieve high model coverage with high performance, each accelerator vendor has to develop a full compiler stack to ingest, optimize, and execute the DNNs. This poses significant challenges in the development and maintenance of the software stack. In addition, the vendors have to contiguously update their hardware and/or software to cope with the rapid evolution of the DNN model architectures and operators. To address these issues, this paper proposes an open source framework that enables users to only concentrate on the development of their proprietary code generation tools by reusing as many as possible components in the existing deep learning compilers. Our framework provides users flexible and easy-to-use interfaces to partition their models into segments that can be executed on "the best" processors to take advantage of the powerful computation capability of accelerators. Our case study shows that our framework has been deployed in multiple commercial vendors' compiler stacks with only a few thousand lines of code.

Motivation & Objective

  • To address the high engineering cost of developing full compiler stacks for DNN accelerators, which are duplicated across vendors despite shared optimization needs.
  • To enable accelerator vendors to focus exclusively on their proprietary code generation while reusing standard compiler optimizations and model partitioning techniques.
  • To solve the challenges of model incompatibility, inefficient execution on complex operators, and redundant implementation of common compiler components across vendors.
  • To provide a flexible, extensible framework that supports diverse accelerators and integrates seamlessly with existing deep learning compiler ecosystems.
  • To reduce time-to-deployment and maintenance overhead by abstracting platform-agnostic optimizations and enabling modular integration of accelerator-specific code generation.

Proposed method

  • Decomposes the deep learning compiler into two parts: a shared, platform-agnostic pipeline and an accelerator-exclusive codegen module.
  • Leverages existing deep learning compiler backends (e.g., ONNX Runtime, Glow) to handle model ingestion, graph optimization, and runtime execution.
  • Introduces a model partitioning mechanism that splits DNNs into subgraphs based on operator support and performance characteristics.
  • Provides standardized interfaces for vendors to plug in their own code generation logic, abstracting low-level hardware details.
  • Supports hardware-aware optimizations such as layout transformation, quantization, and common subexpression elimination within the shared pipeline.
  • Enables end-to-end compilation and execution by integrating the generated code with a lightweight runtime that manages data movement and kernel launches.

Experimental results

Research questions

  • RQ1How can accelerator vendors reduce the engineering burden of building full compiler stacks for DNN inference?
  • RQ2To what extent can shared compiler optimizations be reused across diverse accelerators while supporting vendor-specific code generation?
  • RQ3Can a modular framework enable efficient and performant execution of complex DNN models with control flow and non-linear operators?
  • RQ4How does the framework simplify integration for commercial accelerators like NVIDIA Jetson and Xilinx Vitis-AI?
  • RQ5What performance and development-effort improvements does the framework deliver compared to building custom compiler stacks from scratch?

Key findings

  • The framework enables commercial accelerator vendors to integrate their codegen into state-of-the-art compilers with only a few thousand lines of code.
  • Multiple vendors have successfully deployed the framework in production compiler stacks, including NVIDIA Jetson Xavier and Xilinx Vitis-AI.
  • The framework achieves measurable performance gains over baseline implementations by leveraging shared optimizations and efficient model partitioning.
  • By decoupling codegen from shared infrastructure, the framework reduces maintenance overhead and accelerates time-to-market for new accelerators.
  • The approach supports complex models with control flow and non-linear operators by offloading them to CPU or runtime execution while accelerating compute-intensive kernels on accelerators.
  • The framework demonstrates compatibility and reusability across diverse hardware targets, including FPGAs, ASICs, and general-purpose accelerators.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.