论文标题

有条件的gan和扩散模型的有效空间稀疏推断

Efficient Spatially Sparse Inference for Conditional GANs and Diffusion Models

论文作者

Li, Muyang, Lin, Ji, Meng, Chenlin, Ermon, Stefano, Han, Song, Zhu, Jun-Yan

论文摘要

在图像编辑过程中,现有的深层生成模型倾向于从头开始重新合成整个输出,包括未编辑的区域。这导致了严重的计算浪费,尤其是对于较小的编辑操作。在这项工作中,我们介绍了空间稀疏推理(SSI),这是一种通用技术,可以选择性地对编辑区域执行计算,并加速各种生成模型,包括条件gan和扩散模型。我们的关键观察是,用户容易逐步编辑输入图像。这激发了我们缓存并重用原始图像的特征图。给定编辑的图像,我们将卷积过滤器稀少地应用于编辑的区域,同时重用未编辑区域的缓存功能。根据我们的算法,我们进一步提出了稀疏的增量生成引擎(SIGE),以将减少计算减少转换为现成硬件的延迟。 Sige在NVIDIA RTX 3090上加速DDPM $ 3.0 \ times $,在Apple M1 Pro GPU上加速DDPM $ 3.0 \ times $,稳定的扩散$ 7.2 \ times $ $ 5.6 \ times $ 5.6 \ $ 5.6 \ $ 5.6 \ gp gp gp gp,与我们的会议版本相比,我们扩展了SIGE以适应注意力层并将其应用于稳定的扩散。此外,我们为Apple M1 Pro GPU提供了支持,并提供了更大且顺序编辑的更多结果。

During image editing, existing deep generative models tend to re-synthesize the entire output from scratch, including the unedited regions. This leads to a significant waste of computation, especially for minor editing operations. In this work, we present Spatially Sparse Inference (SSI), a general-purpose technique that selectively performs computation for edited regions and accelerates various generative models, including both conditional GANs and diffusion models. Our key observation is that users prone to gradually edit the input image. This motivates us to cache and reuse the feature maps of the original image. Given an edited image, we sparsely apply the convolutional filters to the edited regions while reusing the cached features for the unedited areas. Based on our algorithm, we further propose Sparse Incremental Generative Engine (SIGE) to convert the computation reduction to latency reduction on off-the-shelf hardware. With about $1\%$-area edits, SIGE accelerates DDPM by $3.0\times$ on NVIDIA RTX 3090 and $4.6\times$ on Apple M1 Pro GPU, Stable Diffusion by $7.2\times$ on 3090, and GauGAN by $5.6\times$ on 3090 and $5.2\times$ on M1 Pro GPU. Compared to our conference version, we extend SIGE to accommodate attention layers and apply it to Stable Diffusion. Additionally, we offer support for Apple M1 Pro GPU and include more results with large and sequential edits.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源