[all-commits] [llvm/llvm-project] 7851b1: [mlir][gpu] Change GPU modules to globals (#135478)

Christian Sigg via All-commits all-commits at lists.llvm.org
Tue Apr 22 04:50:19 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7851b1bcf1f0966883d5598268f95d355718f9f5
      https://github.com/llvm/llvm-project/commit/7851b1bcf1f0966883d5598268f95d355718f9f5
  Author: Christian Sigg <csigg at google.com>
  Date:   2025-04-22 (Tue, 22 Apr 2025)

  Changed paths:
    M mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
    M mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp
    A mlir/test/Integration/GPU/CUDA/concurrent-kernels.mlir
    M mlir/test/Target/LLVMIR/gpu.mlir
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

  Log Message:
  -----------
  [mlir][gpu] Change GPU modules to globals (#135478)

Load/unload GPU modules in global ctors/dtors instead of each time when
launching a kernel.

Loading GPU modules is a heavy-weight operation and synchronizes the GPU
context. Now that the modules are loaded ahead of time, asynchronously
launched kernels can run concurrently, see
https://discourse.llvm.org/t/how-to-lower-the-combination-of-async-gpu-ops-in-gpu-dialect.

The implementations of `embedBinary()` and `launchKernel()` use slightly
different mechanics at the moment but I prefer to not change the latter
more than necessary as part of this PR. I will prepare a follow-up NFC
for `launchKernel()` to align them again.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list