pull/2711/head
Fazzie-Maqianli 2023-02-15 09:55:53 +08:00 committed by GitHub
parent 0b2a738393
commit d03f4429c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 0 deletions

View File

@ -92,6 +92,12 @@ cd ColossalAI
CUDA_EXT=1 pip install .
```
#### Step 3:Accelerate with flash attention by xformers(Optional)
```
pip install xformers
```
### Option #2: Use Docker
To use the stable diffusion Docker image, you can either build using the provided the [Dockerfile](./docker/Dockerfile) or pull a Docker image from our Docker hub.

View File

@ -539,6 +539,8 @@ if __name__ == "__main__":
raise ValueError("-n/--name and -r/--resume cannot be specified both."
"If you want to resume training in a new log folder, "
"use -n/--name in combination with --resume_from_checkpoint")
ckpt = None
if opt.resume:
rank_zero_info("Resuming from {}".format(opt.resume))
if not os.path.exists(opt.resume):

17
examples/images/diffusion/test_ci.sh Normal file → Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
set -euxo pipefail
conda env create -f environment.yaml
conda activate ldm
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch
pip install transformers diffusers invisible-watermark
CUDA_EXT=1 pip install colossalai
pip install pytorch-lightning
wget https://huggingface.co/stabilityai/stable-diffusion-2-base/resolve/main/512-base-ema.ckpt
python main.py --logdir /tmp --train --base configs/Teyvat/train_colossalai_teyvat.yaml --ckpt 512-base-ema.ckpt