-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Core] Set weights_only=True
nicely when we use torch.load()
.
#9455
base: main
Are you sure you want to change the base?
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
@yiyixuxu WDYT? |
can we wrap the torch_load + weights_only into a function and use it everywhere? |
actually, we already have one, no?
|
That could work! Will update the PR. |
just want to bring that there some users that even though it's not recommended and risky, still want to load checkpoints with the IMO it should be the default but users should be able to change it, I don't have a strong opinion about this just bringing it up to attention. |
I think better to wait for Dhruv to come back then. |
@DN6 cc I think this is relevant. |
Hey, any update on this, fyi the BC-breaking default flip is coming in torch 2.6 https://dev-discuss.pytorch.org/t/bc-breaking-change-torch-load-is-being-flipped-to-use-weights-only-true-by-default-in-the-nightlies-after-137602/2573 want to make sure everything works smoothly Is there anything I can do to help push this along? cc @sayakpaul @DN6 @yiyixuxu |
hi @mikaylagawarecki cc @DN6 to confirm |
Hi. Yes, we flipped it because of the security issue. We don't allow setting
Users would have to either convert to safetensors or deserialise those checkpoints on their own |
What does this PR do?
See internal discussion: https://pytorch.slack.com/archives/CN963QVJB/p1722612785082449.
Can propagate this PR to
examples/
andscripts/
after I have an approval.