Commit 891e048
authored
Fix stablehlo constant folding bugs through patch (#401)
This PR provides a patch to fix two issues in StableHlo
upstream,
- If some op is constant folded and op users are certain
stablehlo ops (which don't allow different type for operand
and result) OR ops with different dialect, `tensor.cast`
should be inserted.
MLIR-TensorRT constant folding pass does this but upstream
stablehlo pass doesn't do this, causing error. Some
logic from MLIR-TRT is patched into upstream.
- Upstream `ReshapeOpCanon` pattern to simplify
`stablehlo.reshape` op failed if input to reshape
is `DenseResourceElementsAttr`. This is fixed.
- Many patterns where replacing op with a new op,
without giving consideration to casting. This is
fixed.
Solves: #3781 parent c8ee99f commit 891e048
File tree
2 files changed
+657
-1
lines changed- mlir-tensorrt
- build_tools
2 files changed
+657
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
| |||
0 commit comments