-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[ONNX] A better way to safe guard 2GB model serialization #111984
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
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/111984
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit ab2f075 with merge base b01e87d ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
Depending on magic numbers is usually not reliable and might need tweaks from time to time.
Ideally, we should find out the root cause on why we get a corrupted protobuf when the try-catch doesn't raise
Is there a repro that motivated this change?
Summary - faster than previous try-catch. - more stable than previous try-catch. In some circumstances serializing models > 2GB into a single protobuf file ends up with a corrupted file without raising an exception. [ghstack-poisoned]
|
This is the most proper way. This issue was discovered by models from the torchbench. It may be repro-ed by exporting a large model such as llama2 or stable diffusion xl. However the issue only happened recently. Feel free to take a look if you have bandwidth. |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…1984) Summary - faster than previous try-catch. - more stable than previous try-catch. In some circumstances serializing models > 2GB into a single protobuf file ends up with a corrupted file without raising an exception. Pull Request resolved: pytorch#111984 Approved by: https://github.com/justinchuby
…1984) Summary - faster than previous try-catch. - more stable than previous try-catch. In some circumstances serializing models > 2GB into a single protobuf file ends up with a corrupted file without raising an exception. Pull Request resolved: pytorch#111984 Approved by: https://github.com/justinchuby
Stack from ghstack (oldest at bottom):
Summary