Skip to content

FIx serialization truncated - #185205

Closed
qqaatw wants to merge 1 commit into
pytorch:mainfrom
qqaatw:fix_serialization_truncated
Closed

qqaatw wants to merge 1 commit into
pytorch:mainfrom
qqaatw:fix_serialization_truncated

Conversation

@qqaatw

@qqaatw qqaatw commented May 26, 2026 •

Copy link
Copy Markdown
Collaborator

The write() system call on a linux system can at most write 2GB of data into the disk per call. This PR replaces the raw data stream with buffered data stream to automatically handle the data with size greater than 2GB.

There is a similar limit on windows so using a buffered data stream is safer for both platforms.

fixes #185098

@pytorch-bot

pytorch-bot Bot commented May 26, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/185205

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ You can merge normally! (7 Unrelated Failures), 1 Unclassified Failure

As of commit 182d8e5 with merge base 5c25c47 (image):

UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@qqaatw qqaatw added the ciflow/trunk Trigger trunk jobs on your pull request label May 26, 2026
@qqaatw
qqaatw force-pushed the fix_serialization_truncated branch from e38851e to 182d8e5 Compare May 26, 2026 16:48
@qqaatw
qqaatw marked this pull request as ready for review May 26, 2026 17:39
@qqaatw
qqaatw requested a review from mikaylagawarecki as a code owner May 26, 2026 17:39
@qqaatw
qqaatw requested a review from malfet May 26, 2026 17:58

@albanD albanD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM!

@albanD

albanD commented May 26, 2026

Copy link
Copy Markdown
Collaborator

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: This PR needs a release notes: label
If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Details for Dev Infra team Raised by workflow job

@qqaatw qqaatw added the topic: not user facing topic category label May 26, 2026
@qqaatw

qqaatw commented May 26, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-jammy-aarch64-py3.10 / test (default, 2, 5, linux.arm64.m7g.4xlarge)

Details for Dev Infra team Raised by workflow job

@qqaatw

qqaatw commented May 26, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge -i

tinglvv pushed a commit that referenced this pull request May 28, 2026
The write() system call on a linux system can at most write 2GB of data into the disk per call. This PR replaces the raw data stream with buffered data stream to automatically handle the data with size greater than 2GB.

There is a similar limit on windows so using a buffered data stream is safer for both platforms.

fixes #185098
Pull Request resolved: #185205
Approved by: https://github.com/albanD
khushi-411 pushed a commit to khushi-411/pytorch that referenced this pull request Jun 1, 2026
The write() system call on a linux system can at most write 2GB of data into the disk per call. This PR replaces the raw data stream with buffered data stream to automatically handle the data with size greater than 2GB.

There is a similar limit on windows so using a buffered data stream is safer for both platforms.

fixes pytorch#185098
Pull Request resolved: pytorch#185205
Approved by: https://github.com/albanD
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
The write() system call on a linux system can at most write 2GB of data into the disk per call. This PR replaces the raw data stream with buffered data stream to automatically handle the data with size greater than 2GB.

There is a similar limit on windows so using a buffered data stream is safer for both platforms.

fixes pytorch#185098
Pull Request resolved: pytorch#185205
Approved by: https://github.com/albanD
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
The write() system call on a linux system can at most write 2GB of data into the disk per call. This PR replaces the raw data stream with buffered data stream to automatically handle the data with size greater than 2GB.

There is a similar limit on windows so using a buffered data stream is safer for both platforms.

fixes pytorch#185098
Pull Request resolved: pytorch#185205
Approved by: https://github.com/albanD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

torch.save silently truncates files at INT_MAX bytes when the output path contains non-ASCII characters

4 participants