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

Improve TriangularMultiplicativeUpdate stability in fp16 mode #295

Merged
merged 1 commit into from Apr 10, 2023

Conversation

nikitos9000
Copy link
Contributor

@nikitos9000 nikitos9000 commented Mar 16, 2023

The solution to (observed) fp16 overflow in TriangularMultiplicativeUpdate torch.matmul caused by hugh std of a*b elements. It produces the same output as it's followed by layer norm which performs equivalent std-normalization.

autocast=False mode doesn't seem to solve this in pure fp16 mode unfortunately.

by @adamlerer

@gahdritz
Copy link
Collaborator

gahdritz commented Apr 10, 2023

Thanks!

@gahdritz gahdritz merged commit 208cce6 into aqlaboratory:main Apr 10, 2023
1 of 2 checks passed
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.

None yet

2 participants