EnzymeAD / EnzymeAD/Enzyme-JAX

Broadcast transpose reshape fixup

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

Description

@avik-pal

```
%843 = stablehlo.slice %841 [0:1, 0:6128, 12271:12272] : (tensor<1x6128x12272xf64>) -> tensor<1x6128x1xf64> loc(#loc431)
%849 = stablehlo.reshape %843 : (tensor<1x6128x1xf64>) -> tensor<1x6128xf64> loc(#loc293)

%844 = stablehlo.transpose %841, dims = [0, 2, 1] : (tensor<1x6128x12272xf64>) -> tensor<1x12272x6128xf64> loc(#loc436)
%845 = stablehlo.reshape %844 : (tensor<1x12272x6128xf64>) -> tensor<12272x6128xf64> loc(#loc436)

%850 = stablehlo.slice %845 [0:12271, 0:6128] : (tensor<12272x6128xf64>) -> tensor<12271x6128xf64> loc(#loc293)
%851 = stablehlo.concatenate %849, %850, dim = 0 : (tensor<1x6128xf64>, tensor<12271x6128xf64>) -> tensor<12272x6128xf64> loc(#loc293)

%852 = stablehlo.subtract %848, %851 : tensor<12272x6128xf64> loc(#loc287)
%853 = stablehlo.multiply %852, %23 : tensor<12272x6128xf64> loc(#loc264)
%854 = stablehlo.multiply %cst_28, %853 : tensor<12272x6128xf64> loc(#loc257)
%855 = stablehlo.broadcast_in_dim %854, dims = [2, 1] : (tensor<12272x6128xf64>) -> tensor<1x6128x12272xf64> loc(#loc404)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue provides only a StableHLO operation snippet and does not mention a source file, test, entry point, or expected corrected output. Start by locating the pass or transformation that produces this broadcast/transpose/reshape sequence; the issue is done when the incorrect sequence is fixed and a regression test demonstrates the intended result.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.