EnzymeAD / EnzymeAD/Enzyme-JAX

reduce_window fusions

Open
#1,859 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
MLIR
Stars
131
Forks
53
Avg merge
1d 10h
Merged PRs (30d)
193

Description

```
%7 = stablehlo.slice %6 [0:511, 1:511] : (tensor<512x512xf32>) -> tensor<511x510xf32>
%8 = "stablehlo.reduce_window"(%7, %cst) <{window_dimensions = array}> ({
^bb0(%arg2: tensor, %arg3: tensor):
%26 = stablehlo.add %arg2, %arg3 : tensor
stablehlo.return %26 : tensor
}) : (tensor<511x510xf32>, tensor) -> tensor<510x510xf32>
%9 = stablehlo.slice %6 [2:512, 1:511] : (tensor<512x512xf32>) -> tensor<510x510xf32>
%10 = stablehlo.add %8, %9 {enzymexla.symmetric_matrix = [#enzymexla]} : tensor<510x510xf32>
```

reduce and elementwise fusions already handle chains nicely. we should be fusing these ops into a larger reduce window

Contributor guide

No contributing guide indexed for this repository

Research direction

Start from the StableHLO reduce_window example and compare it with the existing reduce and elementwise fusion handling described in the issue. Determine how the shown reduce_window and add chain should become a larger reduce-window fusion, then verify that the displayed pattern is fused as intended.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.