Skip to content

[mlir] free threading support for mlir python bindings #105522

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

Closed
vfdev-5 opened this issue Aug 21, 2024 · 2 comments
Closed

[mlir] free threading support for mlir python bindings #105522

vfdev-5 opened this issue Aug 21, 2024 · 2 comments
Labels

Comments

@vfdev-5
Copy link
Contributor

vfdev-5 commented Aug 21, 2024

Hello,

I wanted to ask whether there are plans to add free-threading support to MLIR python bindings?
Essentially, we may need to update the extensions this way (link):

- PYBIND11_MODULE(_mlirDialectsGPU, m) {
+ PYBIND11_MODULE(_mlirDialectsGPU, m, py::mod_gil_not_used()) {

I can help with providing a draft PR for that and we can iterate over if there are more updates required.
Thanks!

Context:
We are adding free-threading support to JAX: jax-ml/jax#23073.

@github-actions github-actions bot added the mlir label Aug 21, 2024
jpienaar pushed a commit that referenced this issue Jan 12, 2025
…07103)

Related to #105522

Description:

This PR is a joint work with Peter Hawkins (@hawkinsp) originally done
by myself for pybind11 and then reworked to nanobind based on Peter's
branch: https://github.com/hawkinsp/llvm-project/tree/nbdev .

- Added free-threading CPython mode support for MLIR Python bindings
- Added a test which can reveal data races when cpython and LLVM/MLIR
compiled with TSAN

Context:
- Related to jax-ml/jax#23073

Co-authored-by: Peter Hawkins <[email protected]>
github-actions bot pushed a commit to arm/arm-toolchain that referenced this issue Jan 12, 2025
…indings (#107103)

Related to llvm/llvm-project#105522

Description:

This PR is a joint work with Peter Hawkins (@hawkinsp) originally done
by myself for pybind11 and then reworked to nanobind based on Peter's
branch: https://github.com/hawkinsp/llvm-project/tree/nbdev .

- Added free-threading CPython mode support for MLIR Python bindings
- Added a test which can reveal data races when cpython and LLVM/MLIR
compiled with TSAN

Context:
- Related to jax-ml/jax#23073

Co-authored-by: Peter Hawkins <[email protected]>
@rgommers
Copy link

Is there more to do here, or can this be closed now that gh-105522 is merged?

@vfdev-5
Copy link
Contributor Author

vfdev-5 commented Feb 11, 2025

Thanks Ralf, let's close this issue as completed. PR closing this issue: #107103

@vfdev-5 vfdev-5 closed this as completed Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants