Skip to content

Commit

Permalink
Disable pybind11's GIL checks (#325)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
EthanSteinberg authored and facebook-github-bot committed Jul 17, 2023
1 parent bd1c76f commit d0032e0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions multipy/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ project(MultipyRuntime)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

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


# set ABI by default to 0

Expand Down

0 comments on commit d0032e0

Please sign in to comment.