KEMBAR78
Reduce random reads for offset metadata when calling torch.load under FakeTensorMode by mikaylagawarecki · Pull Request #157931 · pytorch/pytorch · GitHub
Skip to content

Conversation

@mikaylagawarecki
Copy link
Contributor

@mikaylagawarecki mikaylagawarecki commented Jul 9, 2025

We already test the _get_offset functionality with that TORCH_SERIALIZATION_DEBUG flag that is set in CI, so I didn't add more testing specifically for FakeTensor

Stack from ghstack (oldest at bottom):

@pytorch-bot
Copy link

pytorch-bot bot commented Jul 9, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit ae48fda with merge base d9426a8 (image):
💚 Looks good so far! There are no failures yet. 💚

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

mikaylagawarecki added a commit that referenced this pull request Jul 9, 2025
… FakeTensorMode

ghstack-source-id: c926b8d
Pull Request resolved: #157931
@mikaylagawarecki mikaylagawarecki requested a review from albanD July 9, 2025 15:44
@mikaylagawarecki mikaylagawarecki added release notes: python_frontend python frontend release notes category topic: improvements topic category labels Jul 9, 2025
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

Change sounds good.
It would be good to see if some one off benchmarking shows the improvement from this.

@mikaylagawarecki
Copy link
Contributor Author

After confirming with @teja-rao + some microbenchmarking I did, this did not seem to be that useful as most of cost seems to come from FakeTensor overhead / opening the file, but still landing the PR on his request

@mikaylagawarecki mikaylagawarecki marked this pull request as ready for review July 17, 2025 19:04
@mikaylagawarecki
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 17, 2025
@mikaylagawarecki
Copy link
Contributor Author

@pytorchbot merge -r

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request Jul 17, 2025
… FakeTensorMode

ghstack-source-id: 1b6585c
Pull Request resolved: #157931
@pytorchmergebot
Copy link
Collaborator

Successfully rebased gh/mikaylagawarecki/318/orig onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via ghstack checkout https://github.com/pytorch/pytorch/pull/157931)

@pytorchmergebot
Copy link
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

@github-actions github-actions bot deleted the gh/mikaylagawarecki/318/head branch August 17, 2025 02:20
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 release notes: python_frontend python frontend release notes category topic: improvements topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants