-
-
Notifications
You must be signed in to change notification settings - Fork 11.8k
[torchao] fix safetensors for sharding #28169
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
[torchao] fix safetensors for sharding #28169
Conversation
1189efe to
91a71f1
Compare
|
|
||
|
|
||
| @pytest.mark.skipif(not TORCHAO_AVAILABLE, reason="torchao is not available") | ||
| @pytest.mark.skip( |
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.
do we need to skip now that torch2.9 is released?
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 we still need to skip since this test depends on changes in torchao main cc @jerryzh168
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.
yeah we need a separate update to upgrade the torchao version used in testing in vllm:
Line 616 in da786e3
| - uv pip install --system torchao==0.13.0 |
and make sure the tests are passing
a27f7af to
428de94
Compare
heheda12345
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!
Head branch was pushed to by a user without write access
3de2e14 to
ffcf29c
Compare
ffcf29c to
458a632
Compare
|
@heheda12345 can you pls merge? thanks! |
458a632 to
97726c0
Compare
|
Of course! I'm retrying failed test. |
Head branch was pushed to by a user without write access
97726c0 to
fda63f2
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
fda63f2 to
c181744
Compare
Signed-off-by: Angel Li <liangel@meta.com>
Signed-off-by: Angel Li <liangel@meta.com>
c181744 to
a0c7cff
Compare
|
@heheda12345 a rebase seems to have fixed ci, can u help me merge ty! |
|
Merged. Thanks! |
Signed-off-by: Angel Li <liangel@meta.com>
Signed-off-by: Angel Li <liangel@meta.com> Signed-off-by: LuminolT <lumischen01@gmail.com>
Signed-off-by: Angel Li <liangel@meta.com> Signed-off-by: Runkai Tao <rt572@physics.rutgers.edu>
Signed-off-by: Angel Li <liangel@meta.com> Signed-off-by: jiang1.li <jiang1.li@intel.com>
Signed-off-by: Angel Li <liangel@meta.com>
Signed-off-by: Angel Li <liangel@meta.com>
Signed-off-by: Angel Li <liangel@meta.com>
Signed-off-by: Angel Li <liangel@meta.com> Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
Summary
Previously, our safetensors implementation for tensor subclasses didn't consider the possibility of different tensor attributes for one instance of a tensor subclass (ie
qdataorscaleforFloat8Tensor) being sharded to different files.This PR handles that case by:
unflatten_tensor_state_dict, we delete the corresponding tensor attributes (ieqdata,scale) from the original state dict passed inTesting
pytest tests/quantization/test_torchao.py::test_safetensors_model_loading_with_params -s