Update esmfold model not to use param_buffer_assignment #1324
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?
Transformer 4.43 update includes this PR: huggingface/transformers#31771
This PR introduces utilizing _assign_to_params_buffers as a way to speed up weight loading if the dtypes of models are the same. This PR only checks though the very first key's dtype of the model parameter against state_dict and determine if this feature can be used or not. This particular model "facebook/esmfold_v1" weights/bias of the encoder layers are float16 and rest of them are float32, and the first key happen to be float32, so it determines this model can use this feature.
For gaudi2/gaudi3 - weights/biases are loaded as float16.
For gaudi1 - runtime error seen due to float16 not being supported.
Issues Fixed
Run time error on Gaudi1 due to model weights are initialized with float16.