[Mlir-commits] [mlir] Added free-threading CPython mode support in MLIR Python bindings (PR #107103)
Peter Hawkins
llvmlistbot at llvm.org
Thu Dec 26 11:59:04 PST 2024
hawkinsp wrote:
I've been testing free threading in JAX and found that this something very close to this change (see my branch above) was sufficient to eliminate all the TSAN errors I saw from MLIR Python bindings, outside things that I believe are false positives or intentionally not thread-safe (e.g., IR dumping).
I'd propose we land and iterate? I don't think any of the substantive changes here are likely to be surprising or controversial, and while they may not fix all possible races they certainly fix enough to be useful. They should also have little downside if you aren't enabling free-threading, since, e.g. `nb::ft_lock_guard` expands to nothing at all if free-threading isn't enabled.
I suspect the test here may be the most interesting piece to discuss (it uses pytest, which is new, and is best run under TSAN, which you may or may not have in your CI infrastructure for MLIR Python), but if that is going to prove a matter for a long debate I'd suggest iterating on it in a separate PR.
https://github.com/llvm/llvm-project/pull/107103
More information about the Mlir-commits
mailing list