iree-org / iree

A retargetable MLIR-based machine learning compiler and runtime toolkit.
http://iree.dev/
Apache License 2.0
2.8k stars 605 forks source link

[TFL] `tfl.svdf` needs a stateful decomposition to other TFLite operations #8212

Open rsuderman opened 2 years ago

rsuderman commented 2 years ago

Sample IR of an SVDF. We can't lower to TOSA. We could use a decomposition from TFLite to TFLite that handles this decomposition.

func @main(%arg0) : (tensor<1x3xf32>) -> tensor<1x3xf32> {
  %0 = arith.constant dense<0xDEADBEEF> : tensor<2x3xf32>
  %1 = arith.constant dense<0xDEADBEEF> : tensor<2x1xf32>
  %2 = arith.constant dense<0xDEADBEEF> : tensor<2xf32>
  %3 = arith.constant dense<0xDEADBEEF> : tensor<1x4xf32>
  %4 = arith.constant dense<0xDEADBEEF> : tensor<1x4xf32>
  %5 = "tfl.svdf"(%0, %1, %2, %3, %4) : (tensor<1x3xf32>, tensor<2x3xf32>, tensor<2x1xf32>, tensor<2xf32>, tensor<1x4xf32>, tensor<1x4xf32>) -> tensor<1x3xf32>
  return %5 : tensor<1x3xf32>
}
allieculp commented 2 years ago

@rsuderman Bumping this up as a stale P1. Please update or deprioritize as needed!

allieculp commented 1 year ago

@rsuderman Still open? Still P1?