-
Notifications
You must be signed in to change notification settings - Fork 51
Cleaned and Rebased PR for (#481) to change the hash creation module … #537
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed please prepare the inclusion list instead of exclusion list. This approach will have full control on the set of parameters which are included in hash computation. Exclusion list may lead to surprises.
…ule for all models in Qefficient. This PR contains changes made to the modelling_qeff, modeling_auto to allow usage of certain export parameters and kwargs passed during model creation. The hashing module is now made independant of the calling class and the test scripts are updated accordingly to test for this functionality. Added functionality to have an overarching parent directory in cache to contain all different exported model configs belonging to the same architecture. In case the architecture isn't present in the config of the model, we instead proceed with self.model_name based parent directory creation. Hash is now created during export, so as to incorporate all the additional params needed for unique hash creation thus, the test scripts have been modified to test hashing functionalities accordingly. We maintain an Exclusion list of params for kwargs to be discarded during hashing parameter selection. We'll need to look into the alternate approach of maintaining an Inclusion list instead. There was a comment to use MetaClasses to handle raising a warning whenever someone loads a model without using 'from_pretrained' method but the current class architecture of VLMs and SpeechSeq2Seq models don't allow for this, this use case will be handled in a different PR. Signed-off-by: Dhiraj Kumar Sah <[email protected]>
Moved the export path and hash creation functionality as well as json dumping functionality to a wrapper function of export. Created a Kwargs_Inclusion_list and we perform the list check during base_model initialization itself instead of doing it during export. Moved all the hash related functionalities to hash_utils file. Added try catch exceptions for json object dumping as well as creation. patched for the case where a Peft model config is sometimes returned as LoraConfig and sometimes as dict. Modified dummy model testing scripts to monkeypatch QEFF_HOME in the updated script instead of modelling_qeff Signed-off-by: Dhiraj Kumar Sah <[email protected]>
faec153
to
ca2b81c
Compare
…m onnx loading Signed-off-by: Dhiraj Kumar Sah <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go now, Lets run the CI and merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the follow up PR for meta class move make_serializable method to hash_utils.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…for all models in Qefficient.
This PR contains changes made to the modelling_qeff, modeling_auto to allow usage of certain export parameters and kwargs passed during model creation. The hashing module is now made independant of the calling class and the test scripts are updated accordingly to test for this functionality. Added functionality to have an overarching parent directory in cache to contain all different exported model configs belonging to the same architecture. In case the architecture isn't present in the config of the model, we instead proceed with self.model_name based parent directory creation. Hash is now created during export, so as to incorporate all the additional params needed for unique hash creation thus, the test scripts have been modified to test hashing functionalities accordingly. We maintain an Exclusion list of params for kwargs to be discarded during hashing parameter selection. We'll need to look into the alternate approach of maintaining an Inclusion list instead. There was a comment to use MetaClasses to handle raising a warning whenever someone loads a model without using 'from_pretrained' method but the current class architecture of VLMs and SpeechSeq2Seq models don't allow for this, this use case will be handled in a different PR.