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.
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
Support for
safetensors
materializers #2539Support for
safetensors
materializers #2539Changes from all commits
b84974d
3698210
bd7dfa8
dd1fac7
c815a42
df476cb
c610440
1a79019
ab2a994
b99a465
22f6339
c7c13b4
ef1169c
ee8a40f
8e81f18
f141142
059c6d0
574a4d3
0c161b7
6c74334
8f9f06c
26f7188
111aab1
a0e9370
8c71c36
8615da8
66f6da5
083ad9f
e937f05
e423484
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 think you are on the right path here, however, there is an issue:
This is a pattern that I see in all of the new materializers, AFAIK, if you do
torch.save(...)
, it does not only save the model architecture but also the weights.You can see this in play in the example we mentioned above. If you check your artifacts in your local artifact store manually, there are
entire_model.safetensors
andmodel_architecture.json
present which are both roughly 100 MBs. Basically, it is saving the model twice in two different ways. We need to modify thetorch.save
andtorch.load
calls to only handle the architecture without the weights.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.
@bcdurak Here I could not find/there is no method to just store the architecture in
pytorch
. So what would you recommend here?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.
This is a tough question. But in the current case, it is really inefficient.
It feels like we need to go back to the version where you used the
save_model
andload_model
calls. And, we somehow need to figure out how to save the model type in thesave
method. If I can think of anything, I will share it here.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.
Sure @bcdurak. Let me know when I switch back to previous method.