EnzymeAD / EnzymeAD/Enzyme-JAX

fuse `scatter(in, ind, elem_op(gather(in, ind), update))` into scatter

Open
#1,892 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

```
%2 = "stablehlo.gather"(%arg0, %c) <{dimension_numbers = #stablehlo.gather, slice_sizes = array}> : (tensor<4x4xf64>, tensor<4x2xi64>) -> tensor<4xf64>
%3 = stablehlo.add %2, %1 : tensor<4xf64>
%4 = "stablehlo.scatter"(%arg0, %c, %3) <{scatter_dimension_numbers = #stablehlo.scatter, unique_indices = true}> ({
^bb0(%arg2: tensor, %arg3: tensor):
stablehlo.return %arg3 : tensor
}) : (tensor<4x4xf64>, tensor<4x2xi64>, tensor<4xf64>) -> tensor<4x4xf64>
```

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue gives a StableHLO gather/add/scatter pattern but names no source files or tests. Search the repository for stablehlo.scatter and stablehlo.gather handling, then determine where this pattern can be recognized and verify that the resulting scatter preserves the indexed update behavior.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.