Lune

SIGMOD2024Top-tier venue

BladeDISC: Optimizing Dynamic Shape Machine Learning Workloads via Compiler Approach

Zhen Zheng, Zaifeng Pan, Dalin Wang, Kai Zhu, Wenyi Zhao, Tianyou Guo, Xiafei Qiu, Minmin Sun, Junjie Bai, Feng Zhang, Xiaoyong Du, Jidong Zhai, Wei Lin

Abstract

Compiler optimization plays an increasingly important role to boost the performance of machine learning models for data processing and management. With increasingly complex data, the dynamic tensor shape phenomenon emerges for ML models. However, existing ML compilers either can only handle static shape models or expose a series of performance problems for both operator fusion optimization and code generation in dynamic shape scenes. This paper tackles the main challenges of dynamic shape optimization: the fusion optimization without shape value, and code generation supporting arbitrary shapes. To tackle the fundamental challenge of the absence of shape values, it systematically abstracts and excavates the shape information and designs a cross-level symbolic shape representation. With the insight that what fusion optimization relies upon is tensor shape relationships between adjacent operators rather than exact shape values, it proposes the dynamic shape fusion approach based on shape information propagation. To generate code that adapts to arbitrary shapes efficiently, it proposes a compile-time and runtime combined code generation approach. Finally, it presents a complete optimization pipeline for dynamic shape models and implements an industrial-grade ML compiler, named BladeDISC. The extensive evaluation demonstrates that BladeDISC outperforms PyTorch, TorchScript, TVM, ONNX Runtime, XLA, Torch Inductor (dynamic shape), and TensorRT by up to 6.95×, 6.25×, 4.08×, 2.04×, 2.06×, 7.92×, and 4.16× (3.54×, 3.12×, 1.95×, 1.47×, 1.24×, 2.93×, and 1.46× on average) in terms of end-to-end inference speedup on the A10 and T4 GPU, respectively. BladeDISC's source code is publicly available at https://github.com/alibaba/BladeDISC.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

7 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Malleus: Straggler-Resilient Hybrid Parallel Training of Large-scale Models via Malleable Data and Model Parallelization cites Galvatron: Efficient Transformer Training over Multiple GPUs Using Automatic Parallelism
  • Malleus: Straggler-Resilient Hybrid Parallel Training of Large-scale Models via Malleable Data and Model Parallelization cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • A Sample-Free Compilation Framework for Efficient Dynamic Tensor Computation cites Ansor: Generating High-Performance Tensor Programs for Deep Learning
  • A Sample-Free Compilation Framework for Efficient Dynamic Tensor Computation cites Orca: A Distributed Serving System for Transformer-Based Generative Models
  • MonoNN: Enabling a New Monolithic Optimization Space for Neural Network Inference Tasks on Modern GPU-Centric Architectures cites Ansor: Generating High-Performance Tensor Programs for Deep Learning
  • Yggdrasil: Bridging Dynamic Speculation and Static Runtime for Latency-Optimal Tree-Based LLM Decoding cites Orca: A Distributed Serving System for Transformer-Based Generative Models
  • PluS: Highly Efficient and Expandable ML Compiler with Pluggable Graph Schedules cites ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
  • PluS: Highly Efficient and Expandable ML Compiler with Pluggable Graph Schedules cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • PluS: Highly Efficient and Expandable ML Compiler with Pluggable Graph Schedules cites Ansor: Generating High-Performance Tensor Programs for Deep Learning
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. MonoNN: Enabling a New Monolithic Optimization Space for Neural Network Inference Tasks on Modern GPU-Centric ArchitecturesDonglin Zhuang, Zhen Zheng, Haojun Xia, Xiafei Qiu et al.OSDI 2024 · 11 citations
  2. Malleus: Straggler-Resilient Hybrid Parallel Training of Large-scale Models via Malleable Data and Model ParallelizationHaoyang Li, Fangcheng Fu, Hao Ge, Sheng Lin et al.SIGMOD 2025 · 6 citations
  3. PluS: Highly Efficient and Expandable ML Compiler with Pluggable Graph SchedulesRuofan Wu, Zhen Zheng, Feng Zhang, Chuanjie Liu et al.USENIX ATC 2025 · 5 citations
  4. Yggdrasil: Bridging Dynamic Speculation and Static Runtime for Latency-Optimal Tree-Based LLM DecodingYue Guan, Changming Yu, Shihan Fang, Weiming Hu et al.NeurIPS 2025 · 4 citations
  5. A Sample-Free Compilation Framework for Efficient Dynamic Tensor ComputationYangjie Zhou, Honglin Zhu, Qian Qiu, Weihao Cui et al.SC 2025 · 3 citations

Builds on25

  1. ALBERT: A Lite BERT for Self-supervised Learning of Language RepresentationsZhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel et al.ICLR 2020 · 7,418 citations
  2. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
  3. Orca: A Distributed Serving System for Transformer-Based Generative ModelsGyeong-In Yu, Joo Seong Jeong, Geon-Woo Kim, Soojeong Kim et al.OSDI 2022 · 690 citations
  4. Ansor: Generating High-Performance Tensor Programs for Deep LearningLianmin Zheng, Chengfan Jia, Minmin Sun, Zhao Wu et al.OSDI 2020 · 551 citations
  5. Galvatron: Efficient Transformer Training over Multiple GPUs Using Automatic ParallelismXupeng Miao, Yujie Wang, Youhe Jiang, Chunan Shi et al.VLDB 2023 · 113 citations

Related papers

  1. Optimizing Dynamic-Shape Neural Networks on Accelerators via On-the-Fly Micro-Kernel PolymerizationFeng Yu, Guangli Li, Jiacheng Zhao, Huimin Cui et al.ASPLOS 2024 · 18 citations
  2. Relax: Composable Abstractions for End-to-End Dynamic Machine LearningRuihang Lai, Junru Shao, Siyuan Feng, Steven Lyubomirsky et al.ASPLOS 2025 · 15 citations
  3. AStitch: enabling a new multi-dimensional optimization space for memory-intensive ML training and inference on modern SIMT architecturesZhen Zheng, Xuanda Yang, Pengzhan Zhao, Guoping Long et al.ASPLOS 2022 · 78 citations
  4. SoD2: Statically Optimizing Dynamic Deep Neural Network ExecutionWei Niu, Gagan Agrawal, Bin RenASPLOS 2024 · 6 citations
  5. RECom: A Compiler Approach to Accelerating Recommendation Model Inference with Massive Embedding ColumnsZaifeng Pan, Zhen Zheng, Feng Zhang, Ruofan Wu et al.ASPLOS 2023 · 7 citations
Dusk over the sea between two cliffs drawn in fine vertical lines