Skip to content

Conversation

@lorenzbaraldi
Copy link
Contributor

Secured the loss evaluation under the amp_autocast(), avoiding the loss function to operate on float16.
As mentioned in this thread, and underlined in the pytorch documentation it is not safe to let the nn.CrossEntropyLossloss function to operate in float16.

Secured the loss evaluation under the amp, avoiding function to operate on float16
@rwightman rwightman merged commit f266f84 into huggingface:main Dec 9, 2022
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.

2 participants