EnzymeAD / EnzymeAD/Enzyme-JAX

dot_general reshape of non-contracting / non-batching dims

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

```mlir
module @reactant_kernel_... attributes {mhlo.num_partitions = 1 : i64, mhlo.num_replicas = 1 : i64} {
func.func @main(%arg0: tensor<2048x1024x256xf32> {enzymexla.memory_effects = [], tf.aliasing_output = 0 : i32}, %arg1: tensor<2048x2048xf32> {enzymexla.memory_effects = []}) -> tensor<2048x1024x256xf32> attributes {enzymexla.memory_effects = []} {
%0 = stablehlo.reshape %arg0 : (tensor<2048x1024x256xf32>) -> tensor<2048x262144xf32>
%1 = stablehlo.dot_general %arg1, %0, contracting_dims = [0] x [0], precision = [DEFAULT, DEFAULT] : (tensor<2048x2048xf32>, tensor<2048x262144xf32>) -> tensor<2048x262144xf32>
%2 = stablehlo.reshape %1 : (tensor<2048x262144xf32>) -> tensor<2048x1024x256xf32>
return %2 : tensor<2048x1024x256xf32>
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the supplied MLIR module containing the reshape and stablehlo.dot_general operations. Trace how non-contracting and non-batching dimensions are handled, and consider the issue resolved when this module produces the expected tensor shape without mishandling those dimensions.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.