2023-09-19 06:20:26 +00:00
|
|
|
"""
|
2022-12-23 08:47:30 +00:00
|
|
|
torchrun --standalone --nproc_per_node=1 debug.py
|
2023-09-19 06:20:26 +00:00
|
|
|
"""
|
2022-12-23 08:47:30 +00:00
|
|
|
|
|
|
|
from diffusers import AutoencoderKL
|
|
|
|
|
|
|
|
import colossalai
|
2023-09-19 06:20:26 +00:00
|
|
|
from colossalai.zero import ColoInitContext
|
2022-12-23 08:47:30 +00:00
|
|
|
|
|
|
|
path = "/data/scratch/diffuser/stable-diffusion-v1-4"
|
|
|
|
|
|
|
|
colossalai.launch_from_torch(config={})
|
2023-09-19 06:20:26 +00:00
|
|
|
with ColoInitContext(device="cpu"):
|
2022-12-23 08:47:30 +00:00
|
|
|
vae = AutoencoderKL.from_pretrained(
|
|
|
|
path,
|
|
|
|
subfolder="vae",
|
|
|
|
revision=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
for n, p in vae.named_parameters():
|
|
|
|
print(n)
|