-
Notifications
You must be signed in to change notification settings - Fork 60
Deleted model after export to save memory #521
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
3e2d96b to
8bca803
Compare
QEfficient/base/modeling_qeff.py
Outdated
| # self.state_dict = self.model.state_dict() | ||
|
|
||
| # Loading model if weights are in meta state from state_dict | ||
| if any(name for name, param in self.model.named_parameters() if param.is_meta): |
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.
can't we do this check without the for loop, this will loop over all the model params, we can check only one right?
or add a attribute to a model. and check based on that.
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.
I have added a variable and added an or condition in the latest code
ochougul
left a comment
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.
Changes look good to me as first PR.
The re-loading part needs to be figured out, are you planning to do this in next PR?
Please clean the code, we are good to go.
a1550f8 to
0bce273
Compare
quic-hemagnih
left a comment
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.
Looks good to me, please run the CI. We can merge this now.
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
… better to clean the model before applying onnx transform and code clean up Signed-off-by: Rishin Raj <rishinr@qti.qualcomm.com>
Signed-off-by: Rishin Raj <rishinr@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
c944a59 to
0fafed6
Compare
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
quic-hemagnih
left a comment
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
Deleting the model after export is complete and storing only necessary params required either at compile or generation. --------- Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com> Signed-off-by: Rishin Raj <rishinr@qti.qualcomm.com> Co-authored-by: Rishin Raj <rishinr@qti.qualcomm.com> Signed-off-by: Onkar Chougule <ochougul@qti.qualcomm.com>
Deleting the model after export is complete and storing only necessary params required either at compile or generation.