SoD$^2$: Statically Optimizing Dynamic Deep Neural Network

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Niu, Wei, Agrawal, Gagan, Ren, Bin
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866910349067812864
author Niu, Wei
Agrawal, Gagan
Ren, Bin
author_facet Niu, Wei
Agrawal, Gagan
Ren, Bin
contents Though many compilation and runtime systems have been developed for DNNs in recent years, the focus has largely been on static DNNs. Dynamic DNNs, where tensor shapes and sizes and even the set of operators used are dependent upon the input and/or execution, are becoming common. This paper presents SoD$^2$, a comprehensive framework for optimizing Dynamic DNNs. The basis of our approach is a classification of common operators that form DNNs, and the use of this classification towards a Rank and Dimension Propagation (RDP) method. This framework statically determines the shapes of operators as known constants, symbolic constants, or operations on these. Next, using RDP we enable a series of optimizations, like fused code generation, execution (order) planning, and even runtime memory allocation plan generation. By evaluating the framework on 10 emerging Dynamic DNNs and comparing it against several existing systems, we demonstrate both reductions in execution latency and memory requirements, with RDP-enabled key optimizations responsible for much of the gains. Our evaluation results show that SoD$^2$ runs up to $3.9\times$ faster than these systems while saving up to $88\%$ peak memory consumption.
format Preprint
id arxiv_https___arxiv_org_abs_2403_00176
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle SoD$^2$: Statically Optimizing Dynamic Deep Neural Network
Niu, Wei
Agrawal, Gagan
Ren, Bin
Machine Learning
Artificial Intelligence
Programming Languages
Though many compilation and runtime systems have been developed for DNNs in recent years, the focus has largely been on static DNNs. Dynamic DNNs, where tensor shapes and sizes and even the set of operators used are dependent upon the input and/or execution, are becoming common. This paper presents SoD$^2$, a comprehensive framework for optimizing Dynamic DNNs. The basis of our approach is a classification of common operators that form DNNs, and the use of this classification towards a Rank and Dimension Propagation (RDP) method. This framework statically determines the shapes of operators as known constants, symbolic constants, or operations on these. Next, using RDP we enable a series of optimizations, like fused code generation, execution (order) planning, and even runtime memory allocation plan generation. By evaluating the framework on 10 emerging Dynamic DNNs and comparing it against several existing systems, we demonstrate both reductions in execution latency and memory requirements, with RDP-enabled key optimizations responsible for much of the gains. Our evaluation results show that SoD$^2$ runs up to $3.9\times$ faster than these systems while saving up to $88\%$ peak memory consumption.
title SoD$^2$: Statically Optimizing Dynamic Deep Neural Network
topic Machine Learning
Artificial Intelligence
Programming Languages
url https://arxiv.org/abs/2403.00176