[Mlir-commits] [mlir] [MLIR][XeGPU] Add support for cross-subgroup reduction from wg to sg (PR #170936)

Jianhui Li llvmlistbot at llvm.org
Mon Dec 15 20:32:25 PST 2025


Jianhui-Li wrote:

Agreed that we want first do sg_local reduction, and then cross-sg reuction.  But the question is how the progressive lowering work if a reduction dimension is distributed to both sg-local and across sg. 
Say we want to reduce a tensor [64, 64] to a scalar,  sg_layout = [4, 4] and sg_data =[16, 16].  We want the sg_local reduction happens first, so reduce the tensor from [64, 64] to [4, 4], and then reduce across sgs to a scalar. 
The issue is that vector.reduction can't represent partial reduction. One way of doing is to first shape_cast from [64, 64] to [4, 16, 4, 16], and then the reduce to [4, 4], [4], and then scalar. 


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


More information about the Mlir-commits mailing list