Skip to content

Fix autograd thread crash with python-3.9#50998

Closed
malfet wants to merge 1 commit intomasterfrom
malfet/use-disarm-method-in-python-engine
Closed

Fix autograd thread crash with python-3.9#50998
malfet wants to merge 1 commit intomasterfrom
malfet/use-disarm-method-in-python-engine

Conversation

@malfet
Copy link
Copy Markdown
Contributor

@malfet malfet commented Jan 24, 2021

Update pybind repo to include gil_scoped_acquire::disarm() methods
In python_engine allocate scoped_acquire as unique_ptr and leak it if engine is finalizing for Python-3.9+

Fixes #50014 and #50893

@malfet malfet requested review from a team, albanD and ezyang January 24, 2021 00:04
@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Jan 24, 2021

💊 CI failures summary and remediations

As of commit 666d19f (more details on the Dr. CI page):


  • 2/2 failures possibly* introduced in this PR
    • 2/2 non-CircleCI failure(s)

Extra GitHub checks: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

@malfet
Copy link
Copy Markdown
Contributor Author

malfet commented Jan 24, 2021

Thanks @henryiii for updating and merging pybind PR

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

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

@malfet malfet force-pushed the malfet/use-disarm-method-in-python-engine branch from a4b25c5 to 8f9e737 Compare January 25, 2021 15:13
@malfet malfet force-pushed the malfet/use-disarm-method-in-python-engine branch from 8f9e737 to e34ff4e Compare January 26, 2021 03:37
@henryiii
Copy link
Copy Markdown
Contributor

henryiii commented Jan 26, 2021

FYI, pybind11 2.6.2 should be out tomorrow if you'd like an exact tagged version.

(No changes from current master except the version number)

@malfet
Copy link
Copy Markdown
Contributor Author

malfet commented Jan 26, 2021

TestBundledInputs.test_single_tensors failures were due to a pybind/pybind11#2701 which uncovered the following latent bug in

using ResolutionCallback = std::function<py::function(std::string)>;

(ResolutionCallback should return py::object rather than py:function

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 26, 2021

Codecov Report

Merging #50998 (e34ff4e) into master (48b6b92) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #50998      +/-   ##
==========================================
- Coverage   80.91%   80.90%   -0.01%     
==========================================
  Files        1925     1925              
  Lines      210008   210008              
==========================================
- Hits       169919   169905      -14     
- Misses      40089    40103      +14     

Update pybind repo to include `gil_scoped_acquire::disarm()` methods
In python_engine allocate scoped_acquire as unique_ptr and leak it if engine is finalizing for Python-3.9+
@malfet malfet force-pushed the malfet/use-disarm-method-in-python-engine branch from e34ff4e to 666d19f Compare January 26, 2021 17:56
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

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

@malfet
Copy link
Copy Markdown
Contributor Author

malfet commented Jan 26, 2021

FYI, pybind11 2.6.2 should be out tomorrow if you'd like an exact tagged version.

@henryiii thank you for the heads up. Will update to official 2.6.2 in the followup PR.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@malfet merged this pull request in 6f3aa58.

laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Update pybind repo to include `gil_scoped_acquire::disarm()` methods
In python_engine allocate scoped_acquire as unique_ptr and leak it if engine is finalizing for Python-3.9+

Fixes pytorch#50014 and pytorch#50893

Pull Request resolved: pytorch#50998

Reviewed By: ezyang

Differential Revision: D26038314

Pulled By: malfet

fbshipit-source-id: 035411e22825e8fdcf1348fed36da0bc33e16f60
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.

Segfault with nightly in python 3.9

5 participants