EnzymeAD / EnzymeAD/Enzyme-JAX

slice(gather(x, ind)) -> gather(x, slice(ind))

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

Description

```mlir
%1078 = "stablehlo.gather"(%1077, %c_65) <{dimension_numbers = #stablehlo.gather, indices_are_sorted = false, slice_sizes = array}> : (tensor<1939xf32>, tensor<1939x1xi32>) -> tensor<1939xf32>
%1079 = stablehlo.slice %1078 [0:1] : (tensor<1939xf32>) -> tensor<1xf32>
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start from the StableHLO gather and slice example in the issue, then locate the compiler pass or rewrite machinery that handles these operations. Determine how the transformation should preserve the shown tensor shapes and gather attributes, and add or update a regression test demonstrating the rewrite from slice(gather(x, ind)) to gather(x, slice(ind)).

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
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.