This is an archive of the discontinued LLVM Phabricator instance.

[mlir][gpu][spirv] Lower gpu reduction ops to spirv
ClosedPublic

Authored by Hardcode84 on Dec 22 2022, 11:53 AM.

Details

Summary

Supports only "add" and "mul" ops for now. More ops will be added later.

Diff Detail

Event Timeline

Hardcode84 created this revision.Dec 22 2022, 11:53 AM
Hardcode84 requested review of this revision.Dec 22 2022, 11:53 AM
antiagainst requested changes to this revision.Dec 29 2022, 3:22 PM

Nice! Just a few nits.

mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
434

createGroupReduceOpImpl?

451

createGroupReduceOp?

491

Nit: s/spirv/SPIR-V/ as SPIR-V is the official spelling there. :)

501

Is this check necessary? Can this missing actually?

514

Nit: s/spirv/SPIR-V/

This revision now requires changes to proceed.Dec 29 2022, 3:22 PM

rebase, review comments

Hardcode84 marked 4 inline comments as done.Dec 30 2022, 3:14 AM
Hardcode84 added inline comments.
mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
501

gpu.all_reduce can have either reduction attribute or reduction region, only attribute version is supported for now. gpu.subgroup_reduce doesn't have region version so we don't need such check there.

antiagainst accepted this revision.Dec 30 2022, 8:29 AM
This revision is now accepted and ready to land.Dec 30 2022, 8:29 AM
This revision was automatically updated to reflect the committed changes.