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

Fixes -Ofast optimizations breaking model by skipping them for gelu_backward #200

Merged
merged 1 commit into from
Apr 20, 2024

Conversation

dagelf
Copy link
Contributor

@dagelf dagelf commented Apr 20, 2024

Please see #168 for details and work being done on optimizing the activation function on CPU.

This PR results in a 10-23% speedup on CPU and has been tested on msvc and gcc on x86 and fixes #19

@karpathy karpathy merged commit 48a9f2e into karpathy:master Apr 20, 2024
@karpathy
Copy link
Owner

let's try it, merged, ty!

Copy link
Contributor

@rosslwheeler rosslwheeler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dagelf - This line breaks the Windows build:

__attribute__((optimize("no-finite-math-only"))) - Can you wrap this in a conditional for GCC? train_gpt2.c line 368. Thanks!

@dagelf
Copy link
Contributor Author

dagelf commented Apr 22, 2024 via email

karpathy added a commit that referenced this pull request Apr 22, 2024
Make msvc compile by adding the ifdefs back in gelu_backward, fixes #200
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.

Error: must forward with targets before backward
3 participants