)]}'
{
  "commit": "4d33c692e97dec54556e7d008cd5ec49ce0afaeb",
  "tree": "7046e316533ff240b8c16c444b9079ff44bb57e5",
  "parents": [
    "1ef7d351e34c3ec8182dee73b2b9a7f1fc273b15"
  ],
  "author": {
    "name": "Jared Hoberock",
    "email": "jaredhoberock@gmail.com",
    "time": "Wed Apr 29 04:33:22 2026 -0500"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Apr 29 11:33:22 2026 +0200"
  },
  "message": "[MLIR][GPU] Add cooperative launch support to gpu.launch_func (#190639)\n\nAdd a `cooperative` UnitAttr to `gpu.launch_func` that enables\ncooperative kernel launch semantics. Cooperative launches guarantee that\nall thread blocks in the grid are co-resident on the GPU simultaneously,\nenabling grid-wide synchronization patterns.\n\n## Implementation\n\nWhen `cooperative` is set (with or without cluster sizes), the lowering\nemits a call to the new `mgpuLaunchKernelCooperative` runtime function,\nwhich uses `cuLaunchKernelEx` with a `CUlaunchConfig` and\n`CU_LAUNCH_ATTRIBUTE_COOPERATIVE`. This API is guarded behind\n`CUDA_VERSION \u003e\u003d 12000`. The HIP path funnels through\n`hipModuleLaunchCooperativeKernel`.\n\n## Changes\n\n- **GPUOps.td**: add `cooperative` UnitAttr and assembly format keyword\n- **SelectObjectAttr.cpp**: add `getKernelLaunchExFn()`, route\ncooperative and/or cluster launches through `mgpuLaunchKernelEx`\n- **CudaRuntimeWrappers.cpp**: implement `mgpuLaunchKernelCooperative`\nvia `cuLaunchKernelEx` or `hipModuleLaunchCooperativeKernel`, depending\non platform\n- **GPUToLLVMConversion.cpp**: propagate cooperative attribute through\nthe legalization pattern\n- **test/Dialect/GPU/ops.mlir**: round-trip tests for cooperative\nkeyword with and without clusters\n\n## Context\n\nMLIR currently has no support for cooperative kernel launches. Flang\nworks around this with a CUF-specific attribute (PRs #124325, #124362),\nbut there is no first-class support in the GPU dialect. This patch adds\nit at the `gpu.launch_func` level so all frontends can use it.\n\nAssisted-by: Claude (Anthropic)",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "16c3ffd2c85873fa36b6d849c5f8070964414ecc",
      "old_mode": 33188,
      "old_path": "mlir/include/mlir/Dialect/GPU/IR/GPUOps.td",
      "new_id": "a5525580fb32073fe1cbf67e1f60300eb7d4b307",
      "new_mode": 33188,
      "new_path": "mlir/include/mlir/Dialect/GPU/IR/GPUOps.td"
    },
    {
      "type": "modify",
      "old_id": "2b321ee846d36bfe6dd7a6d2f54860b0902e76ca",
      "old_mode": 33188,
      "old_path": "mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp",
      "new_id": "21301110cbd422194fba25e54fde4344138b6b41",
      "new_mode": 33188,
      "new_path": "mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp"
    },
    {
      "type": "modify",
      "old_id": "aa68f02f46b99e9a2d8f9e55041530dfa065f704",
      "old_mode": 33188,
      "old_path": "mlir/lib/Dialect/GPU/IR/GPUDialect.cpp",
      "new_id": "d3fb6df2010d2c874bb613e7b4e9deadd9e47e48",
      "new_mode": 33188,
      "new_path": "mlir/lib/Dialect/GPU/IR/GPUDialect.cpp"
    },
    {
      "type": "modify",
      "old_id": "d2e74dce230781bed7f18563275e381b2736f71d",
      "old_mode": 33188,
      "old_path": "mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp",
      "new_id": "1c05dd4416abadf0dd8363f386a9a427a242d290",
      "new_mode": 33188,
      "new_path": "mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp"
    },
    {
      "type": "modify",
      "old_id": "f60db7b760aa675431e6bcd990258fe3beb5d93f",
      "old_mode": 33188,
      "old_path": "mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp",
      "new_id": "2a7641f2df445b613c4bd3b052c4e3268b43bae8",
      "new_mode": 33188,
      "new_path": "mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp"
    },
    {
      "type": "modify",
      "old_id": "e729e4f9fca9d394fa9c38e3138578a88b426116",
      "old_mode": 33188,
      "old_path": "mlir/lib/ExecutionEngine/RocmRuntimeWrappers.cpp",
      "new_id": "251245106c56ea39043d94401568eeaef4e0b1e4",
      "new_mode": 33188,
      "new_path": "mlir/lib/ExecutionEngine/RocmRuntimeWrappers.cpp"
    },
    {
      "type": "modify",
      "old_id": "c25e9a3c369730655ebad04c56cab7549a513c1e",
      "old_mode": 33188,
      "old_path": "mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp",
      "new_id": "016159391c33fc09d9ab4c2f1b99c540dc42615c",
      "new_mode": 33188,
      "new_path": "mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp"
    },
    {
      "type": "modify",
      "old_id": "cbafc376fb89a0103cde571c3ff0f7a6c81de53e",
      "old_mode": 33188,
      "old_path": "mlir/test/Dialect/GPU/ops.mlir",
      "new_id": "11cea6f82d7b51e44339867ba8c39c49b1c528c6",
      "new_mode": 33188,
      "new_path": "mlir/test/Dialect/GPU/ops.mlir"
    },
    {
      "type": "modify",
      "old_id": "25220dff7a5bb5f00798184e0cc0e0aa6e523090",
      "old_mode": 33188,
      "old_path": "mlir/test/Dialect/GPU/outlining.mlir",
      "new_id": "f708561bc2f019735240ef5926f7715dec98a16b",
      "new_mode": 33188,
      "new_path": "mlir/test/Dialect/GPU/outlining.mlir"
    },
    {
      "type": "modify",
      "old_id": "0d29a95b12266ab2422c04b11fe7ef58d073851b",
      "old_mode": 33188,
      "old_path": "mlir/test/Target/LLVMIR/gpu.mlir",
      "new_id": "da816bf24f63a303fa9e717c4adaf68e64afdb8c",
      "new_mode": 33188,
      "new_path": "mlir/test/Target/LLVMIR/gpu.mlir"
    }
  ]
}
