-
Notifications
You must be signed in to change notification settings - Fork 25.7k
inductor cpp wrapper: add GIL release back #123897
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/123897
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 f831a94 with merge base e3ac615 ( 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. |
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
| # release GIL to support multiple instances inference (in different threads of the same process) | ||
| self.prefix.splice("pybind11::gil_scoped_release release;") |
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.
What's the story for config.abi_compatible=True?
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.
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.
Because in the ABI-compatible mode, we aren't allowed to call dispatcher Boxed call, instead we go back to Python to call custom ops in #122554 (Note: this is only for the JIT mode). If this is really performance critical, you could gil_scoped_release by default, gil_scoped_acquire before entering the custom op call and destroy that gil_scoped_acquire after done with the custom op call.
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
Fixes #123517. This PR adds the GIL release (originally added in #111888) back. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
Fixes #123517. This PR adds the GIL release (originally added in #111888) back. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
|
@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 |
Fixes pytorch#123517. This PR adds the GIL release (originally added in pytorch#111888) back following the suggestion here: pytorch#123897 (comment). We added a default constructor and an assignment operator for the `RAIIPyObject` class (pytorch#123897 (comment)) in order to declare the `custom_op_wrapper` outside of the GIL acquisition scope. Pull Request resolved: pytorch#123897 Approved by: https://github.com/peterbell10, https://github.com/jgong5
Fixes #123517. This PR adds the GIL release (originally added in #111888) back following the suggestion here: #123897 (comment). We added a default constructor and an assignment operator for the `RAIIPyObject` class (#123897 (comment)) in order to declare the `custom_op_wrapper` outside of the GIL acquisition scope. Pull Request resolved: #123897 Approved by: https://github.com/peterbell10, https://github.com/jgong5
Stack from ghstack (oldest at bottom):
Fixes #123517.
This PR adds the GIL release (originally added in #111888) back following the suggestion here: #123897 (comment).
We added a default constructor and an assignment operator for the
RAIIPyObjectclass(#123897 (comment)) in order to declare the
custom_op_wrapperoutside of the GIL acquisition scope.cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler @amjames @desertfire @chauhang