-
Notifications
You must be signed in to change notification settings - Fork 51
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
base: main
Are you sure you want to change the base?
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
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
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 <[email protected]>
Signed-off-by: Asmita Goswami <[email protected]>
… better to clean the model before applying onnx transform and code clean up Signed-off-by: Rishin Raj <[email protected]>
Signed-off-by: Rishin Raj <[email protected]>
Signed-off-by: Asmita Goswami <[email protected]>
c944a59
to
0fafed6
Compare
Signed-off-by: Asmita Goswami <[email protected]>
Signed-off-by: Asmita Goswami <[email protected]>
Deleting the model after export is complete and storing only necessary params required either at compile or generation.