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

What GELU algorithm is used for LIBXSMM_MELTW_TYPE_UNARY_GELU? #829

Open
jgong5 opened this issue Nov 14, 2023 · 3 comments
Open

What GELU algorithm is used for LIBXSMM_MELTW_TYPE_UNARY_GELU? #829

jgong5 opened this issue Nov 14, 2023 · 3 comments

Comments

@jgong5
Copy link

jgong5 commented Nov 14, 2023

Is it tanh approximation?

@alheinecke
Copy link
Collaborator

@jgong5
Copy link
Author

jgong5 commented Nov 15, 2023

No it's a direct minmax approximation. https://github.com/libxsmm/libxsmm/blob/main/src/generator_common_x86.c#L204 https://github.com/libxsmm/libxsmm/blob/main/src/generator_common_x86.c#L714

Thanks. Will you support tanh approximation too?

@alheinecke
Copy link
Collaborator

we have no plans for this as workloads converge with the current implementation. However, I can help you with guiding/submitting a PR following the same scheme (setting up const, computing x^3 and then using the minimax for tanh).

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

No branches or pull requests

2 participants