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

Christian Sigg llvmlistbot at llvm.org
Tue Apr 29 01:57:35 PDT 2025


chsigg wrote:

> At the moment, I would argue is better to not move things to `gpu-to-llvm` because we would ultimately move then out when offload comes around.

`gpu-to-llvm` is misnamed, `gpu-to-mlir-gpu-runtime-calls` would be more accurate because it's tightly coupled to the runtime wrappers. That's why I would move lowering `gpu.launch_func / gpu.binary` to mgpu calls to that pass. When offload comes around, I imagine that pass will be replaced with something else entirely.

> However, IMO a good cleanup would be merging `load`, `get_func`, `launch` into `mgpuLaunchKernel`, and handle everything inside that function. Including lazy loading the modules and unloading at program shutdown.

Lazy loading of kernels won't work for the test I added in this PR, we need some way to load kernels eagerly *before* `gpu.launch_func`.



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


More information about the Mlir-commits mailing list