Commit ce243b2
committed
Acquire the GIL in lazy init_extension
Bindings declared with call_guard<gil_scoped_release> (e.g. fp8_transpose)
can be the first transformer_engine_torch call in a process. init_extension()
then runs py::module_::import without holding the GIL and segfaults inside
PyImport_ImportModule. Reacquire the GIL inside the one-time initializer.
Signed-off-by: zhihaow6 <zhihaow6@illinois.edu>1 parent ea41e08 commit ce243b2
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| |||
0 commit comments