Adding support for float16 conversion for GPUs#273
Merged
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
regisss
approved these changes
Jul 8, 2022
Contributor
regisss
left a comment
There was a problem hiding this comment.
LGTM @philschmid !!
I just left two minor comments.
Co-authored-by: regisss <15324346+regisss@users.noreply.github.com>
echarlaix
approved these changes
Jul 8, 2022
Collaborator
echarlaix
left a comment
There was a problem hiding this comment.
LGTM, thanks for this addition @philschmid
mfuntowicz
reviewed
Jul 8, 2022
| onnx_optimized_model_output_path=optimized_model_path, | ||
| optimization_config=optimization_config, | ||
| ) | ||
| model = onnx.load(optimized_model_path.as_posix()) |
Member
There was a problem hiding this comment.
Can you add a test about the relative difference in the output? I'm not a huge fan of changing dtype for all the layers like this.
Contributor
Author
There was a problem hiding this comment.
Not really sure why since we are not applying any custom logic.
What if there is more difference? what do you expect from the test?
Contributor
Author
There was a problem hiding this comment.
Added the test but not sure what the benefit is
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds support for converting model weights from
fp32tofp16by adding a new Optimization parameter. If thefp16arg is provided in theOptimizationConfigthe weights are converted. I also added a test to make sure the model is not containing any fp32 weightsBefore submitting