-
Notifications
You must be signed in to change notification settings - Fork 11.9k
ggml : add ggml_gelu_erf() #13667
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
ggml : add ggml_gelu_erf() #13667
Conversation
|
I retried the ultravox and it is now giving the correct result on both metal and cpu Also just to note that, the original whisper impl from openai seem to use this type of gelu (with |
Here is the GGML output (conv + transformer + post layer norm):
And python output:
|
* ggml : add ggml_gelu_na (not approximated) * fix naming order * rename na --> erf * apply review suggesions * revert naming order
I couldn't add it as a param because
ggml_gelu
is an unary op and I'm not quite sure how to add a new param to unary op (Please tell me if I should still add it as a param instead)Despite the name "not approximated", I'm actually using an approximation (more accurate than
tanh
) in Metal impl because there is noerf()
function build-in on Metal. The built-in GNU impl also seems to base on a complicated approx, so I think all systems are now using some short of approx, it's just more complicated thantanh
so it gives a better result.So, maybe
ggml_gelu_na
is not the best name.I haven't tested this with ultravox, will report back the result a bit later.