FutureXiang / Diffusion

Minimal multi-gpu implementation of Diffusion Models with Classifier-Free Guidance (CFG)
50 stars 5 forks source link

diffusion 模型需要这么大的算力? #3

Closed yc-cui closed 1 year ago

yc-cui commented 1 year ago

图像 256x256, batchsize 只能设成 1 了 😇:


+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.76       Driver Version: 515.76       CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA RTX A5000    On   | 00000000:D1:00.0 Off |                  Off |
| 30%   41C    P2   213W / 230W |  14035MiB / 24564MiB |     97%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA RTX A5000    On   | 00000000:D5:00.0 Off |                  Off |
| 30%   42C    P2   213W / 230W |  14035MiB / 24564MiB |    100%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   2  NVIDIA RTX A5000    On   | 00000000:D6:00.0 Off |                  Off |
| 30%   44C    P2   215W / 230W |  14035MiB / 24564MiB |    100%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
FutureXiang commented 1 year ago

你好, 高分辨率图像(64x64以上)如果使用Diffusion Models生成,一般使用Latent Diffusion Model(即Stable Diffusion的技术),先使用VAE/VQVAE压缩、再对隐变量使用Diffusion Models建模。也有相关工作使用Cascaded Diffusion Model通过级联生成器超分辨率至高分辨率。

一般单个Diffusion Model适用于64x64及以下分辨率的图像或隐变量。