Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize perfermance of fused GEGLU #74

Merged
merged 4 commits into from
Dec 12, 2023
Merged

optimize perfermance of fused GEGLU #74

merged 4 commits into from
Dec 12, 2023

Conversation

chengzeyi
Copy link
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
33 checks passed
@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