Skip to content
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

Swap file size on BE platform #92810

Closed
wants to merge 2 commits into from
Closed

Swap file size on BE platform #92810

wants to merge 2 commits into from

Conversation

kiszk
Copy link
Contributor

@kiszk kiszk commented Jan 23, 2023

Fixes #92808

This PR fixes SIGSEGV on a big-endian machine when reading pickle data.

The root cause is not to convert size, which is read from a file, from little-endian to big-endian while size is used in a method. The fix is to convert size on a big-endian machine instead of nbytes.

I confirmed that the program in the issue works w/o SIGSEGV and the test passes, with this fix in master branch.

$ python test/test_autograd.py TestAutograd.test_pickle
.
----------------------------------------------------------------------
Ran 1 test in 0.010s

OK

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 23, 2023

🔗 Helpful Links

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

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

❌ 1 Failures

As of commit b1f42eb:

NEW FAILURES - The following jobs have failed:

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

Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

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

Thank you for the fix

@malfet malfet added release notes: python_frontend release notes category topic: bug fixes topic category labels Jan 23, 2023
@malfet
Copy link
Contributor

malfet commented Jan 23, 2023

@pytorchbot merge -f "ASAN is failing on master, this change only affects power"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes).

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

AlekseiNikiforovIBM pushed a commit to AlekseiNikiforovIBM/pytorch that referenced this pull request May 23, 2023
Fixes pytorch#92808

This PR fixes SIGSEGV on a big-endian machine when reading pickle data.

The root cause is not to convert `size`, which is read from a file, from little-endian to big-endian while `size` is used in a method. The fix is to convert `size` on a big-endian machine instead of `nbytes`.

I confirmed that the program in the issue works w/o SIGSEGV and the test passes, with this fix in master branch.

```
$ python test/test_autograd.py TestAutograd.test_pickle
.
----------------------------------------------------------------------
Ran 1 test in 0.010s

OK
```

Pull Request resolved: pytorch#92810
Approved by: https://github.com/malfet
AlekseiNikiforovIBM pushed a commit to AlekseiNikiforovIBM/pytorch that referenced this pull request May 23, 2023
Fixes pytorch#92808

This PR fixes SIGSEGV on a big-endian machine when reading pickle data.

The root cause is not to convert `size`, which is read from a file, from little-endian to big-endian while `size` is used in a method. The fix is to convert `size` on a big-endian machine instead of `nbytes`.

I confirmed that the program in the issue works w/o SIGSEGV and the test passes, with this fix in master branch.

```
$ python test/test_autograd.py TestAutograd.test_pickle
.
----------------------------------------------------------------------
Ran 1 test in 0.010s

OK
```

Pull Request resolved: pytorch#92810
Approved by: https://github.com/malfet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SIGSEGV on a big-endian machine when reading a model generated on a little-endian machine
4 participants