[all-commits] [llvm/llvm-project] 72003a: [mlir][gpu] Allow subgroup reductions over 1-d vec...

Jakub Kuderski via All-commits all-commits at lists.llvm.org
Thu Dec 21 08:55:56 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 72003adf6bd44e91778c22e42e94a28c28be2339
      https://github.com/llvm/llvm-project/commit/72003adf6bd44e91778c22e42e94a28c28be2339
  Author: Jakub Kuderski <jakub at nod-labs.com>
  Date:   2023-12-21 (Thu, 21 Dec 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
    M mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/test/Conversion/GPUToSPIRV/reductions.mlir
    M mlir/test/Dialect/GPU/invalid.mlir
    M mlir/test/Dialect/GPU/ops.mlir

  Log Message:
  -----------
  [mlir][gpu] Allow subgroup reductions over 1-d vector types (#76015)

Each vector element is reduced independently, which is a form of
multi-reduction.

The plan is to allow for gradual lowering of multi-reduction that
results in fewer `gpu.shuffle` ops at the end:
1d `vector.multi_reduction` --> 1d `gpu.subgroup_reduce` --> smaller 1d
`gpu.subgroup_reduce` --> packed `gpu.shuffle` over i32

For example we can perform 2 independent f16 reductions with a series of
`gpu.shuffles` over i32, reducing the final number of `gpu.shuffles` by 2x.




More information about the All-commits mailing list