-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Expose option to disable CRC-32 computation during torch.save
#137735
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
Expose option to disable CRC-32 computation during torch.save
#137735
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/137735
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 8315e24 with merge base 53e356a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
[ghstack-poisoned]
torch.save
…save`" [ghstack-poisoned]
…save`" [ghstack-poisoned]
…save`" [ghstack-poisoned]
…save`" [ghstack-poisoned]
…save`" [ghstack-poisoned]
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.
Only small nits, sounds pretty good in general!
torch/serialization.py
Outdated
| return _compute_crc32 | ||
|
|
||
|
|
||
| def set_default_crc32_options(compute_crc32: bool): |
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.
nit: why set_default_crc32_options vs set_crc32_options ? There is no way to override this flag from the end user of torch.save point of view.
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.
will use set_crc32_options, the default was for consistency with the naming of other similar serialization APIs
| MZ_ZIP_FLAG_WRITE_ALLOW_READING = 0x8000, | ||
| MZ_ZIP_FLAG_ASCII_FILENAME = 0x10000 | ||
| MZ_ZIP_FLAG_ASCII_FILENAME = 0x10000, | ||
| MZ_ZIP_FLAG_DO_NOT_COMPUTE_CRC32 = 0x20000, /* don't compute the crc32 of file data that's being added. */ |
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 forgot what's the story with these changes and if they will work internally?
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.
won't work internally as internal has different build options for miniz
…save`" [ghstack-poisoned]
…save`" Option only works in open source, not internal [ghstack-poisoned]
|
@mikaylagawarecki has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
…save`" Option only works in open source, not internal Differential Revision: [D64545647](https://our.internmc.facebook.com/intern/diff/D64545647) [ghstack-poisoned]
|
@mikaylagawarecki has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
…save`" Option only works in open source, not internal Differential Revision: [D64545647](https://our.internmc.facebook.com/intern/diff/D64545647) [ghstack-poisoned]
Pull Request resolved: #137735 Option only works in open source, not internal @imported-using-ghimport Differential Revision: [D64545647](https://our.internmc.facebook.com/intern/diff/D64545647/) ghstack-source-id: 249920368
|
This pull request was exported from Phabricator. Differential Revision: D64545647 |
…save`" Option only works in open source, not internal Differential Revision: [D64545647](https://our.internmc.facebook.com/intern/diff/D64545647) [ghstack-poisoned]
Pull Request resolved: #137735 Option only works in open source, not internal @imported-using-ghimport Differential Revision: [D64545647](https://our.internmc.facebook.com/intern/diff/D64545647/) ghstack-source-id: 249959423
|
This pull request was exported from Phabricator. Differential Revision: D64545647 |
|
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
Merge failedReason: This PR has internal changes and must be landed via Phabricator! Please try reimporting/rexporting the PR! Details for Dev Infra teamRaised by workflow job |
|
@pytorchmergebot merge -f "already landed internally" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: This PR has internal changes and must be landed via Phabricator! Please try reimporting/rexporting the PR! Details for Dev Infra teamRaised by workflow job |
|
@pytorchmergebot merge -f "already landed internally" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: This PR has internal changes and must be landed via Phabricator! Please try reimporting/rexporting the PR! Details for Dev Infra teamRaised by workflow job |
|
as discussed with @mikaylagawarecki and @izaitsevfb - this has been reimported as a different PR to circumvent internal export check failures. I will close this one unmerged if that one is merged in. |
This is a cherry-pick from #137735 by @mikaylagawarecki , that cannot be merged due to a (wrongly) failing check for codev @diff-train-skip-merge Pull Request resolved: #138959 Approved by: https://github.com/mikaylagawarecki
Option only works in open source, not internal
Stack from ghstack (oldest at bottom):
torch.save#137735Differential Revision: D64545647