Skip to content

Allow bypasses for Precompile when guards, etc. cannot be serialized#160902

Closed
jamesjwu wants to merge 5 commits intogh/jamesjwu/185/basefrom
gh/jamesjwu/185/head
Closed

Allow bypasses for Precompile when guards, etc. cannot be serialized#160902
jamesjwu wants to merge 5 commits intogh/jamesjwu/185/basefrom
gh/jamesjwu/185/head

Conversation

@jamesjwu
Copy link
Contributor

@jamesjwu jamesjwu commented Aug 18, 2025

Stack from ghstack (oldest at bottom):

This adds a new function bypass_package and CompilePackage.bypass_current_entry(). This allows us to safely bypass if there are models with unserializable or incompatible parts. When we encounter something incompatible, we'll raise a bypass and ignore that particular code in DynamoCodeEntry.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames @Lucaskabela

Differential Revision: D80725139

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Aug 18, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit ee17c50 with merge base 5ee464d (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

jamesjwu added a commit that referenced this pull request Aug 18, 2025
ghstack-source-id: 8727f80
Pull-Request: #160902
[ghstack-poisoned]
jamesjwu added a commit that referenced this pull request Aug 18, 2025
ghstack-source-id: 385853b
Pull-Request: #160902
@jamesjwu jamesjwu added topic: not user facing topic category ciflow/trunk Trigger trunk jobs on your pull request labels Aug 18, 2025
[ghstack-poisoned]
jamesjwu added a commit that referenced this pull request Aug 19, 2025
ghstack-source-id: 354f0dc
Pull-Request: #160902
[ghstack-poisoned]
jamesjwu added a commit that referenced this pull request Aug 19, 2025
ghstack-source-id: 351d616
Pull-Request: #160902
@jamesjwu jamesjwu marked this pull request as ready for review August 19, 2025 20:50
@jamesjwu jamesjwu requested a review from zhxchen17 August 19, 2025 20:50
@jamesjwu jamesjwu changed the title Precompile bypassing feature Allow bypasses for Precompile when guards, etc. cannot be serialized Aug 19, 2025
@jamesjwu
Copy link
Contributor Author

@pytorchbot merge -b main

@pytorch-bot
Copy link

pytorch-bot bot commented Aug 20, 2025

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: unrecognized arguments: -b main

usage: @pytorchbot [-h] {merge,revert,rebase,label,drci,cherry-pick} ...

Try @pytorchbot --help for more info.

@jamesjwu
Copy link
Contributor Author

@pytorchbot rebase -b main

@pytorchmergebot
Copy link
Collaborator

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

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Successfully rebased gh/jamesjwu/185/orig onto refs/remotes/origin/main, please pull locally before adding more changes (for example, via ghstack checkout https://github.com/pytorch/pytorch/pull/160902)

pytorchmergebot pushed a commit that referenced this pull request Aug 20, 2025
ghstack-source-id: 360b860
Pull-Request: #160902
@jamesjwu jamesjwu requested a review from oulgen August 21, 2025 18:10
@jamesjwu
Copy link
Contributor Author

@pytorchbot merge

@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

@jamesjwu
Copy link
Contributor Author

@jamesjwu has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…ytorch#160902)

This adds a new function `bypass_package` and `CompilePackage.bypass_current_entry()`. This allows us to safely bypass if there are models with unserializable or incompatible parts. When we encounter something incompatible, we'll raise a bypass and ignore that particular code in DynamoCodeEntry.

Pull Request resolved: pytorch#160902
Approved by: https://github.com/zhxchen17
@github-actions github-actions bot deleted the gh/jamesjwu/185/head branch September 21, 2025 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants