iree-org / iree

A retargetable MLIR-based machine learning compiler and runtime toolkit.
http://iree.dev/
Apache License 2.0
2.84k stars 614 forks source link

[gpu] Cleanup: Use gpu.subgroup_reduce rather than building shuffles manually #18516

Open andfau-amd opened 2 months ago

andfau-amd commented 2 months ago

The upstream MLIR gpu.subgroup_reduce operation is quite powerful, especially following the work in https://github.com/iree-org/iree/issues/18142. There are still places in IREE that manually build a series of shuffles that could be replaced with gpu.subgroup_reduce. One example is emitGPUReduction (WIP patch to clean it up: https://github.com/iree-org/iree/compare/main...andfau-amd:18142-use-subgroup_reduce-for-emitGPUGroupReduction).

dan-garvey commented 3 weeks ago

is this solved by https://github.com/andfau-amd/iree/commit/4b984f1d56ead80cd7921b01937bfbb1640c01df

andfau-amd commented 3 weeks ago

@dan-garvey I think the point of this ticket was to do the same kind of improvement in more places than was done in that commit.