Skip to content
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

Added py::mod_gil_not_used() to PYBIND11_MODULE register_jax_dialects #23129

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion jaxlib/mlir/_mlir_libs/register_jax_dialects.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Registers MLIR dialects used by JAX.
// This module is called by mlir/__init__.py during initialization.
#include <pybind11/pybind11.h>

#include "mlir-c/Dialect/Arith.h"
#include "mlir-c/Dialect/Func.h"
Expand All @@ -14,11 +15,13 @@
#include "mlir-c/Transforms.h"
#include "mlir/Bindings/Python/PybindAdaptors.h"

namespace py = pybind11;

#define REGISTER_DIALECT(name) \
MlirDialectHandle name##_dialect = mlirGetDialectHandle__##name##__(); \
mlirDialectHandleInsertDialect(name##_dialect, registry)

PYBIND11_MODULE(register_jax_dialects, m) {
PYBIND11_MODULE(register_jax_dialects, m, py::mod_gil_not_used()) {
m.doc() = "Registers upstream MLIR dialects used by JAX.";

m.def("register_dialects", [](MlirDialectRegistry registry) {
Expand Down