Grape: Practical and Efficient Graph-based Executions for Dynamic Deep Neural Networks on GPUs

被引:0
|
作者
Zheng, Bojian [1 ]
Yu, Cody Hao [2 ]
Wang, Jie [2 ]
Ding, Yaoyao [1 ]
Liu, Yizhi [2 ]
Wang, Yida [2 ]
Pekhimenko, Gennady [1 ,3 ]
机构
[1] Univ Toronto, CentML, Toronto, ON, Canada
[2] Amazon, Santa Clara, CA USA
[3] Vector Inst, Toronto, ON, Canada
基金
加拿大自然科学与工程研究理事会; 加拿大创新基金会;
关键词
machine learning compilers; CUDA graphs; dynamic neural networks;
D O I
10.1145/3613424.3614248
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
Achieving high performance in machine learning workloads is a crucial yet difficult task. To achieve high runtime performance on hardware platforms such as GPUs, graph-based executions such as CUDA graphs are often used to eliminate CPU runtime overheads by submitting jobs in the granularity of multiple kernels. However, many machine learning workloads, especially dynamic deep neural networks (DNNs) with varying-sized inputs or datadependent control flows, face challenges when directly using CUDA graphs to achieve optimal performance. We observe that the use of graph-based executions poses three key challenges in terms of efficiency and even practicability: (1) Extra data movements when copying input values to graphs' placeholders. (2) High GPU memory consumption due to the numerous CUDA graphs created to efficiently support dynamic-shape workloads. (3) Inability to handle data-dependent control flows. To address those challenges, we propose Grape, a new graph compiler that enables practical and efficient graph-based executions for dynamic DNNs on GPUs. Grape comprises three key components: (1) an alias predictor that automatically removes extra data movements by leveraging code positions at the Python frontend, (2) a metadata compressor that efficiently utilizes the data redundancy in CUDA graphs' memory regions by compressing them, and (3) a predication rewriter that safely replaces control flows with predication contexts while preserving programs' semantics. The three components improve the efficiency and broaden the optimization scope of graph-based executions while allowing machine learning practitioners to program dynamic DNNs at the Python level with minimal source code changes. We evaluate Grape on state-of-the-art text generation (GPT-2, GPT-J) and speech recognition (Wav2Vec2) workloads, which include both training and inference, using real systems with modern GPUs. Our evaluation shows that Grape achieves up to 36.43x less GPU memory consumption and up to 1.26x better performance than prior works on graph-based executions that directly use CUDA graphs. Furthermore, Grape can optimize workloads that are impractical for prior works due to the three key challenges, achieving 1.78x and 1.82x better performance on GPT-J and Wav2Vec2 respectively than the original implementations that do not use graph-based executions.
引用
下载
收藏
页码:1364 / 1380
页数:17
相关论文
共 50 条
  • [21] PAVER: Locality Graph-Based Thread Block Scheduling for GPUs
    Tripathy, Devashree
    Abdolrashidi, Amirali
    Bhuyan, Laxmi Narayan
    Zhou, Liang
    Wong, Daniel
    ACM TRANSACTIONS ON ARCHITECTURE AND CODE OPTIMIZATION, 2021, 18 (03)
  • [22] Graph-based knowledge tracing: Modeling student proficiency using graph neural networks
    Nakagawa, Hiromi
    Iwasawa, Yusuke
    Matsuo, Yutaka
    WEB INTELLIGENCE, 2021, 19 (1-2) : 87 - 102
  • [23] Software bug prediction using graph neural networks and graph-based text representations
    Siachos, Ilias
    Kanakaris, Nikos
    Karacapilidis, Nikos
    Expert Systems with Applications, 2025, 259
  • [24] Evaluation of Table Grape Flavor Based on Deep Neural Networks
    Liu, Zheng
    Zhang, Yu
    Zhang, Yicheng
    Guo, Lei
    Wu, Chase
    Shen, Wei
    APPLIED SCIENCES-BASEL, 2023, 13 (11):
  • [25] Graph-Based Thermal-Inertial SLAM With Probabilistic Neural Networks
    Saputra, Muhamad Risqi U.
    Lu, Chris Xiaoxuan
    de Gusmao, Pedro Porto Buarque
    Wang, Bing
    Markham, Andrew
    Trigoni, Niki
    IEEE TRANSACTIONS ON ROBOTICS, 2022, 38 (03) : 1875 - 1893
  • [26] Multi-Stream General and Graph-Based Deep Neural Networks for Skeleton-Based Sign Language Recognition
    Miah, Abu Saleh Musa
    Hasan, Md. Al Mehedi
    Jang, Si-Woong
    Lee, Hyoun-Sup
    Shin, Jungpil
    ELECTRONICS, 2023, 12 (13)
  • [27] Exploring Graph-Based Neural Networks for Automatic Brain Tumor Segmentation
    Saueressig, Camillo
    Berkley, Adam
    Kang, Elliot
    Munbodh, Reshma
    Singh, Ritambhara
    Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 2021, 12611 LNCS : 18 - 37
  • [28] A Graph-Based Approach to Interpreting Recurrent Neural Networks in Process Mining
    Hanga, Khadijah Muzzammil
    Kovalchuk, Yevgeniya
    Gaber, Mohamed Medhat
    IEEE ACCESS, 2020, 8 : 172923 - 172938
  • [29] Graph-based saliency and ensembles of convolutional neural networks for glaucoma detection
    Serte, Sertan
    Serener, Ali
    IET IMAGE PROCESSING, 2021, 15 (03) : 797 - 804
  • [30] A Graph-Based Semi-Supervised PolSAR Image Classification Method Using Deep Convolutional Neural Networks
    Wei Z.-Q.
    Bi H.-X.
    Liu X.
    Bi, Hai-Xia (bhxwzq@163.com), 1600, Chinese Institute of Electronics (48): : 66 - 74