Skip to content

Add support for BFloat16 Mixed Precision#3929

Merged
jph00 merged 4 commits into
fastai:masterfrom
warner-benjamin:bfloat16_amp
Aug 7, 2023
Merged

Add support for BFloat16 Mixed Precision#3929
jph00 merged 4 commits into
fastai:masterfrom
warner-benjamin:bfloat16_amp

Conversation

@warner-benjamin

Copy link
Copy Markdown
Collaborator

This PR adds support for BFloat16 Automatic Mixed Precision training to MixedPrecision and ChannelsLast.

To use BF16 AMP, pass amp_mode=AMPMode.BF16 or amp_mode='bf16' to MixedPrecision, or use the Learner.to_bf16 convenience method.

Channels Last training also supports BF16 AMP by passing amp_mode=AMPMode.BF16 or amp_mode='bf16' to Learner.to_channels_last.

@warner-benjamin warner-benjamin requested a review from jph00 as a code owner July 25, 2023 22:39
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@warner-benjamin

Copy link
Copy Markdown
Collaborator Author

#3928 resolves the unrelated CI error.

@jph00 jph00 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This all looks great, but could you please revert the formatting changes which are using extra vertical space?

@warner-benjamin

Copy link
Copy Markdown
Collaborator Author

Done. I copied from fastxtend and wasn't thinking about formatting

@jph00

jph00 commented Aug 7, 2023

Copy link
Copy Markdown
Member

Many thanks!

@jph00 jph00 merged commit 66ad0b1 into fastai:master Aug 7, 2023
@warner-benjamin warner-benjamin deleted the bfloat16_amp branch August 7, 2023 15:43
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