debug.py 449 Bytes
Newer Older
1
"""
2
torchrun --standalone --nproc_per_node=1 debug.py
3
"""
4
5
6
7

from diffusers import AutoencoderKL

import colossalai
8
from colossalai.zero import ColoInitContext
9
10
11
12

path = "/data/scratch/diffuser/stable-diffusion-v1-4"

colossalai.launch_from_torch(config={})
13
with ColoInitContext(device="cpu"):
14
15
16
17
18
19
20
21
    vae = AutoencoderKL.from_pretrained(
        path,
        subfolder="vae",
        revision=None,
    )

for n, p in vae.named_parameters():
    print(n)