Skip to content

optimize perfermance of fused GEGLU#74

Merged
chengzeyi merged 4 commits intomainfrom
dev
Dec 12, 2023
Merged

optimize perfermance of fused GEGLU#74
chengzeyi merged 4 commits intomainfrom
dev

Conversation

@chengzeyi
Copy link
Copy Markdown
Owner

@chengzeyi chengzeyi commented Dec 12, 2023

During benchmarking SDXL model on A10, I found nearly 25% of the time is spent on computing fused GEGLU. Although the fused GEGLU kernel in stable-fast is already faster than unfused implementations, it might still have room to improve.

So I optimize the kernel ThreadBlockSize and implement a faster GELU function.

Before optimizing, on A10, speed is less than 4 it/s with 1024x1024. After optimizing, it is now 4.2 it/s.

python3 examples/optimize_stable_diffusion_pipeline.py --model stabilityai/stable-diffusion-xl-base-1.0 --height 1024 --width 1024 --seed 0

@chengzeyi chengzeyi merged commit a3ff7b3 into main Dec 12, 2023
@chengzeyi chengzeyi deleted the dev branch December 12, 2023 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant