Skip to main content
QUICK REVIEW

[论文解读] Hybrid SD: Edge-Cloud Collaborative Inference for Stable Diffusion Models

Chenqian Yan, Songwei Liu|arXiv (Cornell University)|Aug 13, 2024
Complex Network Analysis Techniques被引用 4
一句话总结

该论文提出 Hybrid SD,一种无需训练的边缘-云协同推理框架,用于稳定扩散模型(Stable Diffusion Models),通过将早期去噪步骤卸载至基于云的大规模模型以保证语义准确性,同时将后期优化任务交由轻量级边缘模型处理以提升效率。通过 U-Net 的结构化剪枝和轻量级 VAE 的设计,该框架在边缘设备上实现了 225.8M 参数的最先进参数效率,并取得具有竞争力的 FID(12.22),同时将云成本降低 66%。

ABSTRACT

Stable Diffusion Models (SDMs) have shown remarkable proficiency in image synthesis. However, their broad application is impeded by their large model sizes and intensive computational requirements, which typically require expensive cloud servers for deployment. On the flip side, while there are many compact models tailored for edge devices that can reduce these demands, they often compromise on semantic integrity and visual quality when compared to full-sized SDMs. To bridge this gap, we introduce Hybrid SD, an innovative, training-free SDMs inference framework designed for edge-cloud collaborative inference. Hybrid SD distributes the early steps of the diffusion process to the large models deployed on cloud servers, enhancing semantic planning. Furthermore, small efficient models deployed on edge devices can be integrated for refining visual details in the later stages. Acknowledging the diversity of edge devices with differing computational and storage capacities, we employ structural pruning to the SDMs U-Net and train a lightweight VAE. Empirical evaluations demonstrate that our compressed models achieve state-of-the-art parameter efficiency (225.8M) on edge devices with competitive image quality. Additionally, Hybrid SD reduces the cloud cost by 66% with edge-cloud collaborative inference.

研究动机与目标

  • 解决在云服务器上部署大型稳定扩散模型(SDMs)所带来的高计算成本和隐私风险问题。
  • 克服现有轻量化边缘模型存在的性能差距,这些模型通常以牺牲语义保真度和视觉质量为代价。
  • 设计一种无需训练的协同推理框架,充分发挥边缘设备与云资源的优势。
  • 在不牺牲生成质量的前提下,实现在边缘设备上的最先进参数效率。
  • 确保与加速技术(如 LCM)的兼容性,以支持实际部署。

提出的方法

  • 分配去噪过程:早期去噪步骤由基于云的大规模 SDM 执行以实现语义规划,后期步骤则由轻量化边缘模型处理以完成细节优化。
  • 对 SDM 的 U-Net 应用结构化剪枝,以减小模型尺寸,同时保持性能,从而实现在资源受限边缘设备上的部署。
  • 为边缘部署专门训练轻量化 VAE 解码器,显著降低整体模型体积,且不造成明显质量损失。
  • 将压缩后的模型集成至混合推理流水线,平衡云与边缘计算负载,最小化数据传输与云成本。
  • 扩展框架以支持如 LCM(潜在一致性模型)等加速采样方法,实现仅需少量步骤的快速推理。
  • 优化系统,通过将计算任务转移至边缘设备,使云端 FLOPs 减少 66%,从而降低延迟与成本。
Figure 1: Comparisons of FLOPs, model size (#Params) and FID score on MS-COCO 2014 30K dataset (Lin et al. 2014 ) . We report FLOPs and parameters of the U-Net and VAE decoder for each model. Our proposed Hybrid SD is highlighted in red font, where $k$ indicates the number of steps running on cloud
Figure 1: Comparisons of FLOPs, model size (#Params) and FID score on MS-COCO 2014 30K dataset (Lin et al. 2014 ) . We report FLOPs and parameters of the U-Net and VAE decoder for each model. Our proposed Hybrid SD is highlighted in red font, where $k$ indicates the number of steps running on cloud

实验结果

研究问题

  • RQ1在无需模型微调的前提下,边缘-云协同是否能提升稳定扩散模型推理的效率与成本效益?
  • RQ2在边缘设备上使用轻量化模型时,如何保持语义完整性和视觉质量?
  • RQ3结构化剪枝与轻量化 VAE 在多大程度上可减小模型尺寸,同时维持具有竞争力的 FID 分数?
  • RQ4如何在最小化云成本的同时保持低延迟,实现云与边缘之间计算负载的最优分配?
  • RQ5该混合推理框架与现有加速技术(如 LCM)的兼容性如何?

主要发现

  • Hybrid SD 通过将 2.7 万亿 FLOPs 的计算任务卸载至边缘设备,使云端推理成本降低 66%,云端计算量从全云推理的 15.8T 降至 5.4T FLOPs。
  • 压缩后的边缘模型仅含 225.8M 参数(原始 SD-v1.4 为 909.0M),同时保持了 12.22 的竞争力 FID 分数,优于原始模型的 13.75。
  • 边缘-云协同推理使云端延迟降低 42%(1010.5 ms vs. 1733.6 ms),FLOPs 减少 49%,相比全云推理。
  • 与独立运行的边缘模型相比,该框架在语义对齐方面表现更优,后者常因提示词理解偏差而生成错误属性(如将 'kitchen' 误为 'kichen',或遗漏提示中的 'two sheep')。
  • 轻量化 VAE 使边缘侧 FLOPs 减少 42%,显著提升效率,且未降低图像质量。
  • 该混合框架与 LCM 加速技术完全兼容,支持 8 步采样,性能损失极小,进一步提升推理速度与效率。
Figure 2: The overview of Hybrid SD. We distribute the inference tasks to cloud servers and edge devices. The red line denotes text-to-image tasks while the blue line denotes image-to-image tasks.
Figure 2: The overview of Hybrid SD. We distribute the inference tasks to cloud servers and edge devices. The red line denotes text-to-image tasks while the blue line denotes image-to-image tasks.

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。