DistriFusion: Distributed Parallel Inference for High-Resolution Diffusion Models
Authors:
- Muyang LiMLMuyang Li
- Han CaiHCHan Cai
- Song HanSHSong Han
- 16 June 2024
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 7183-7193
Abstract
Diffusion models have achieved great success in synthesizing high-quality images. However, generating high-resolution images with diffusion models is still challenging due to the enormous computational costs, resulting in a pro-hibitive latency for interactive applications. In this paper, we propose DistriFusion to tackle this problem by leveraging parallelism across multiple GPUs. Our method splits the model input into multiple patches and assigns each patch to a GPU. However,naïvely implementing such an algorithm breaks the interaction between patches and loses fidelity, while incorporating such an interaction will incur tremendous communication overhead. To overcome this dilemma, we observe the high similarity between the input from adjacent diffusion steps and propose displaced patch parallelism, which takes advantage of the sequential nature of the diffusion process by reusing the pre-computed feature maps from the previous timestep to provide context for the current step. Therefore, our method supports asynchronous commu-nication, which can be pipelined by computation. Extensive experiments show that our method can be applied to recent Stable Diffusion XL with no quality degradation and achieve up to a 6.1 ×speedup on eight A100 GPUs compared to one.Keywords
All Related Versions
Funding Information
- National Science Foundation
This publication has 23 references indexed in Scilit:
- Semantic Image Synthesis With Spatially-Adaptive Normalization2019
- Group Normalization2018
- Recurrent Residual Module for Fast Inference in Videos2018
- The Unreasonable Effectiveness of Deep Features as a Perceptual Metric2018
- SBNet: Sparse Blocks Network for Fast Inference2018
- Not All Pixels Are Equal: Difficulty-Aware Semantic Segmentation via Deep Layer Cascade2017
- OctNet: Learning Deep 3D Representations at High Resolutions2017
- More is Less: A More Complicated Network with Less Inference Complexity2017
- U-Net: Convolutional Networks for Biomedical Image Segmentation2015
- Microsoft COCO: Common Objects in Context2014