[Mlir-commits] [mlir] Added free-threading CPython mode support in MLIR Python bindings (PR #107103)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Sep 23 09:06:57 PDT 2024


vfdev-5 wrote:

Thanks for the reply @stellaraccident !

Yes, we should discuss what level of threading compatibility we are targeting.

> It seems where this patch is going is ensuring that the library itself does not provide any inherent locking hazards if independent contexts are used from multiple threads.

IMO the idea behind enabling CPython free-threading mode in python extensions (like MLIR python bindings) is to make them thread-safe as they are with GIL-enabled CPython.

> I'm not aware of a consensus that has emerged on the level of safety that a library such as this should provide. Fine grained locking at the binding layer seems like it would be expensive and error prone, especially given the more relaxed stance of the underlying library.

Can you please detail this statement? I was thinking that we wanted to make python bindings thread-safe for free-threading cpython...



https://github.com/llvm/llvm-project/pull/107103


More information about the Mlir-commits mailing list