-
Notifications
You must be signed in to change notification settings - Fork 369
modify unflatten for vllm #3297
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3297
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 1 PendingAs of commit f179ca5 with merge base e2aab90 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
0e290bb to
cdc5ca2
Compare
jerryzh168
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.
I think current impl is a bit hacky, what we can do is:
unflatten_tensor_state_dict with incomplete state_dict:
return a tuple of (unflattened_state_dict, unused part of incomplete_state_dict)
next call: combine the new state_dict input, with the previous unconsumed part
ae774e7 to
cea5523
Compare
cea5523 to
21875a1
Compare
ab10de6 to
e1202bc
Compare
jerryzh168
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, thanks!
e1202bc to
a684afa
Compare
a684afa to
f179ca5
Compare
Summary
We keep track of what has been processed by deleting processed keys from the original state dict. This is for the case when not all tensor attributes are available to us when loading, so we reconstruct the tensor subclasses with missing attributes in a later call.
We expect the state dict to be empty after loading is complete
Test
python test/prototype/safetensors/test_safetensors_support.py