arrow
Return

TSCompiler: efficient compilation framework for dynamic-shape models

delete2024-09-13
delete0
PRE
AI
C
Chen Zhang *
Y
Yanzhi Yi
J
Jiahui Hu
R
Renwei Zhang
Z
Zhen Zhang
杨
杨帆 (Fan Yang)
顾
顾宁 (Ning Gu)
S
Shang Li *
DOI:10.1007/s11432-024-4071-6delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Today's deep learning models face an increasing demand to handle dynamic shape tensors and computation whose shape information remains unknown at compile time and varies in a nearly infinite range at runtime. This shape dynamism brings tremendous challenges for existing compilation pipelines designed for static models which optimize tensor programs relying on exact shape values. This paper presents TSCompiler, an end-to-end compilation framework for dynamic shape models. TSCompiler first proposes a symbolic shape propagation algorithm to recover symbolic shape information at compile time to enable subsequent optimizations. TSCompiler then partitions the shape-annotated computation graph into multiple subgraphs and fine-tunes the backbone operators from the subgraph within a hardware-aligned search space to find a collection of high-performance schedules. TSCompiler can propagate the explored backbone schedule to other fusion groups within the same subgraph to generate a set of parameterized tensor programs for fused cases based on dependence analysis. At runtime, TSCompiler utilizes an occupancy-targeted cost model to select from pre-compiled tensor programs for varied tensor shapes. Extensive evaluations show that TSCompiler can achieve state-of-the-art speedups for dynamic shape models. For example, we can improve kernel efficiency by up to 3.97x on NVIDIA RTX3090, and 10.30 x on NVIDIA A100 and achieve up to five orders of magnitude speedups on end-to-end latency.
Keywords:
machine learning
tensor compilers
dynamic shape
operator fusion
code generation
autotuning

Journal

Science China Information Sciences cover
Science China Information Sciences
IF:
7.6
Papers:
4.9K
Citations:
8.9K

Organization

H
harbin institute of technology
Scholars:
8.0W
Papers: 6.6W
Citations: 66
H
huawei technologies
Scholars:
3.3K
Papers: 2.9K
Citations: 1
F
fudan university
Scholars:
11.8W
Papers: 7.7W
Citations: 121
S
shanghai jiao tong university
Scholars:
15.7W
Papers: 11.7W
Citations: 159
researcher View more organizations
Cited Papers

Cited Papers

Reconstruction of Below-Knee Stump Using the Salvaged Foot Fillet Flap
err1995-09-01
err0
PREAI
errYuan-Cheng Chiang; Fu-Chan Wei; Jun-Wen Wang; Wun-Schen Chen
errShare
errSave
HAOTuner: A Hardware Adaptive Operator Auto-Tuner for Dynamic Shape Tensor Compilers
err2023-11-01
err4
PREAI
errMu, Pengyu; Liu, Yi; Wang, Rui; Liu, Guoxiang; Sun, Zhonghao; Yang, Hailong; Luan, Zhongzhi; Qian, Depei
errShare
errSave