iree: Failing to compile TFLite MobileNetV3Small
I’m trying to port our MobileNetV3Small benchmark to compile directly from a tflite flatbuffer. Shockingly, there are issues! Currently hitting an error failing to legalize tosa.conv2d. The original TFLite flatbuffer is at https://tfhub.dev/google/lite-model/imagenet/mobilenet_v3_small_100_224/classification/5/default/1 (mirrored to https://storage.googleapis.com/iree-model-artifacts/mobilenet_v3_small_100_224.tflite). The mlir after iree-import-tflite is at https://gist.github.com/5a75b5cf8b2539c763c4bb2ba05cedf3
The error is error: failed to legalize operation 'tosa.conv2d'
for this op:
%118 = "tosa.conv2d"(%117, %97, %96) {dilation = [1, 1], pad = [0, 1, 0, 1], stride = [2, 2]} : (tensor<?x224x224x3xf32>, tensor<16x3x3x3xf32>, tensor<16xf32>) -> tensor<?x112x112x16xf32>
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (15 by maintainers)
They should represent the same computation, but how they represent it may be different (e.g. because of different python implementations or because of how the same python implementation was lowered). There’s probably no way to cover all of that so I’d just go with whatever’s easiest to maintain.
In this case the dynamic shape failure is on the TOSA end. When Tosa-To-Linalg was written we focused on statically shaped operations to simplify the compilation process. We are working on dynamic shapes more now however it is a non-trivial amount of work. I do not yet have a timeline for when we can support mobilenet models with dynamic dimensions.