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

Save model data in half precision (bf16) and load back to the full precision f32 #202

Closed
antimora opened this issue Mar 6, 2023 · 0 comments · Fixed by #247
Closed

Save model data in half precision (bf16) and load back to the full precision f32 #202

antimora opened this issue Mar 6, 2023 · 0 comments · Fixed by #247

Comments

@antimora
Copy link
Collaborator

antimora commented Mar 6, 2023

Feature description

A user should be able to specify if the model data should be saved in half precision, and tell if the data should be loaded back to the full precision

Feature motivation

Often the performance of model inference does not degrade much if f32 precision is truncated in half but it may matter during training. To reduce the size of the exported model, it would be beneficial to save in bf16 (truncated version of f32) and later to load back in f32 (If the target architecture supports only f32 and up).

(Optional) Suggest a Solution

Use half library to convert f32 to bf16. half also supports serde for (de)serialization. User should be able to specify target data (f32).

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 a pull request may close this issue.

1 participant