-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix torch.load()
frequently warning in PersistentDataset and GDSDataset
#8177
Conversation
… consistency in future versions of pytorch
Thanks for the contribution, this is a fix that we do need to remove that warning. I'm not sure if the fails recorded here are related to this PR rather than something else wrong with our CICD system but please run them locally to see if you have the same result. Could you also try with |
Thanks for the comment! I believe the failed checks occurred because the So, some compatibility work still needs to be done, and I’m working on it. :) As for setting |
Hi @bnbqq8, could you please help address the format issue and DCO? |
I, bnbqq8 <[email protected]>, hereby add my Signed-off-by to this commit: e03821d I, bnbqq8 <[email protected]>, hereby add my Signed-off-by to this commit: 38d5a71 I, bnbqq8 <[email protected]>, hereby add my Signed-off-by to this commit: 719e33d I, bnbqq8 <[email protected]>, hereby add my Signed-off-by to this commit: 3c2a012 I, bnbqq8 <[email protected]>, hereby add my Signed-off-by to this commit: 5ac10ff Signed-off-by: bnbqq8 <[email protected]>
@KumoLiu Of course! Thank you for the reminder! |
/build |
torch.load()
frequently warning in PersistentDataset and GDSDataset
Description
Frequently getting warning massage in a newer Pytorch version (2.4.1 in my case):
"You are using
torch.load
withweights_only=False
(the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value forweights_only
will be flipped toTrue
. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user viatorch.serialization.add_safe_globals
. We recommend you start settingweights_only=True
for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature."This pull request fixes an issue with the
torch.load()
function in thePersistentDataset
andGDSDataset
classes by addingweights_only=False
. The fix ensures that thetorch.load()
function maintains load consistency in future versions of PyTorch.Types of changes
./runtests.sh -f -u --net --coverage
../runtests.sh --quick --unittests --disttests
.make html
command in thedocs/
folder.