Skip to content

Commit d0032e0

Browse files
EthanSteinbergfacebook-github-bot
authored andcommitted
Disable pybind11's GIL checks (#325)
Summary: pybind11 recently added a feature to assert that the GIL is held during reference counting operations pybind/pybind11#4246 This feature has already uncovered several instances of undefined behavior in several Python extensions. However, this code does not seem to pass these checks, which is preventing us from upgrading PyTorch to the latest pybind11. See pytorch/pytorch#105245 This PR disables those checks, which will in turn allow PyTorch to upgrade. Note that this code already has known potential GIL issues: https://github.com/pytorch/multipy/blob/bd1c76f294335695db8bfa66250781c1627f4eb7/multipy/runtime/deploy.cpp#L59 Pull Request resolved: #325 Reviewed By: PaliC Differential Revision: D47518187 Pulled By: albanD fbshipit-source-id: 5bf14d3633afe67fe0aa8fd74610403e0c494ea5
1 parent bd1c76f commit d0032e0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

multipy/runtime/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ project(MultipyRuntime)
99
set(CMAKE_CXX_STANDARD 17)
1010
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1111

12+
# multipy currently does not pass pybind11's GIL checks.
13+
#
14+
# This usually indicates undefined behavior or bugs within extensions, but we don't have the resources to debug
15+
# this package right now.
16+
#
17+
# In the future, someone should find out why this code fails to work when these checks are enabled.
18+
add_definitions(-DPYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF)
19+
1220

1321
# set ABI by default to 0
1422

0 commit comments

Comments
 (0)