-
Notifications
You must be signed in to change notification settings - Fork 13
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
Performance on Apple M1 Max #11
Comments
With
So |
Both Python and this crate are using the past key values. The main "optimization" is using a single kernel for the gelu (which you can optimize easily by wrapping the However, this crate is still faster, CPU overhead is a real thing. |
I am using the latest main (409c640) plus the following patch that make both PyTorch and
fast_gpt2
run exactly the same model, and text (20 tokens), no Cuda in either:Here is what I got for
fast_gpt2
:And PyTorch (installed from conda-forge):
So
fast_gpt2
runs in 2.2s, and PyTorch in 0.8s.In order to speedup
fast_gpt2
, we can use the fast matrix matrix multiply from the Accelerate library, as shown in #10 (comment).The text was updated successfully, but these errors were encountered: