[llvm] [mlir] [mlir][gpu] Change GPU modules to globals (PR #135478)

Christian Sigg via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 25 01:10:22 PDT 2025


chsigg wrote:

> * What would we gain from moving the code to `gpu-to-llvm`?

My motivation would be to keep the things that are tied to MLIR's runtime wrappers in one place. It feels slightly spread out at the moment with most ops being lowered to `mgpu*` calls in `gpu-to-llvm`, except for `gpu.binary` and `gpu.launch_kernel` handled during translation.

> * Is there something we can't do today that we would be able to do with that change?

Not that I'm aware of, or at least I don't have a need to change anything. I merely wanted to show that concurrent kernel execution is possible, which required loading modules ahead of time. But I don't want to leave things in a worse state than it was before. So, I'm happy to help if you would like to move things in a particular direction, but I don't have an agenda myself or feel like I have enough background to formulate one.

Migrating to LLVM offloading sounds like a clear win to me and hopefully any changes that we make now should make that migration easier. I have no idea how this is being used, but I see that there is `GenericDeviceTy::loadBinary` so maybe a separate load/unload module op would be a good fit.



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


More information about the llvm-commits mailing list