Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error when compiling Movenet's singlepose thunder tensorflow lite model on IREE 3 #19568

Open
RechieKho opened this issue Dec 29, 2024 · 2 comments
Labels
bug 🐞 Something isn't working

Comments

@RechieKho
Copy link
Contributor

What happened?

I'm attempting to compile Movenet's singlepose thunder as I'm updating my IREE runtime to IREE 3.0.0. I'm left with these error after importing it with iree-import-tflite.

Internal error while creating host target: Resolution of CPU to CPU-features is not implemented on this target architecture. Pass explicit CPU-features, or implement the missing mapping.

<unknown>:0: error: loc(callsite(callsite("center_net_mobile_net_v2fpn_feature_extractor/model_1/model/Conv1_relu/Relu6;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/bn_Conv1/FusedBatchNormV3;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/expanded_conv_depthwise_BN/FusedBatchNormV3;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/expanded_conv_depthwise/depthwise;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/block_5_project/Conv2D;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/Conv1/Conv2D" at "main") at callsite("center_net_mobile_net_v2fpn_feature_extractor/model_1/model/Conv1_relu/Relu6;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/bn_Conv1/FusedBatchNormV3;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/expanded_conv_depthwise_BN/FusedBatchNormV3;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/expanded_conv_depthwise/depthwise;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/block_5_project/Conv2D;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/Conv1/Conv2D" at "main"))): failed to legalize operation 'stream.executable' that was explicitly marked illegal
<unknown>:0: note: loc(callsite("center_net_mobile_net_v2fpn_feature_extractor/model_1/model/Conv1_relu/Relu6;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/bn_Conv1/FusedBatchNormV3;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/expanded_conv_depthwise_BN/FusedBatchNormV3;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/expanded_conv_depthwise/depthwise;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/block_5_project/Conv2D;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/Conv1/Conv2D" at "main")): called from
<unknown>:0: note: loc("main"): called from
<unknown>:0: note: loc(callsite(callsite("center_net_mobile_net_v2fpn_feature_extractor/model_1/model/Conv1_relu/Relu6;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/bn_Conv1/FusedBatchNormV3;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/expanded_conv_depthwise_BN/FusedBatchNormV3;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/expanded_conv_depthwise/depthwise;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/block_5_project/Conv2D;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/Conv1/Conv2D" at "main") at callsite("center_net_mobile_net_v2fpn_feature_extractor/model_1/model/Conv1_relu/Relu6;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/bn_Conv1/FusedBatchNormV3;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/expanded_conv_depthwise_BN/FusedBatchNormV3;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/expanded_conv_depthwise/depthwise;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/block_5_project/Conv2D;center_net_mobile_net_v2fpn_feature_extractor/model_1/model/Conv1/Conv2D" at "main"))): see current operation: 
"stream.executable"() <{sym_name = "jit_eval_dispatch_0", sym_visibility = "private"}> ({
  "stream.executable.export"() <{function_ref = @jit_eval_dispatch_0_transpose_56x27_f32, sym_name = "jit_eval_dispatch_0_transpose_56x27_f32"}> ({
    %6:3 = "flow.dispatch.workgroup_count_from_slice"() : () -> (index, index, index)
    "stream.return"(%6#0, %6#1, %6#2) : (index, index, index) -> ()
  }) : () -> ()
  "builtin.module"() ({
    "func.func"() <{arg_attrs = [{stream.alignment = 64 : index}, {stream.alignment = 64 : index}], function_type = (!stream.binding, !stream.binding) -> (), sym_name = "jit_eval_dispatch_0_transpose_56x27_f32"}> ({
    ^bb0(%arg0: !stream.binding, %arg1: !stream.binding):
      %0 = "arith.constant"() <{value = 0 : index}> : () -> index
      %1 = "stream.binding.subspan"(%arg0, %0) : (!stream.binding, index) -> !flow.dispatch.tensor<readonly:tensor<56x27xf32>>
      %2 = "stream.binding.subspan"(%arg1, %0) : (!stream.binding, index) -> !flow.dispatch.tensor<writeonly:tensor<27x56xf32>>
      %3 = "flow.dispatch.tensor.load"(%1) <{operandSegmentSizes = array<i32: 1, 0, 0, 0, 0>, static_offsets = array<i64: 0, 0>, static_sizes = array<i64: 56, 27>, static_strides = array<i64: 1, 1>}> : (!flow.dispatch.tensor<readonly:tensor<56x27xf32>>) -> tensor<56x27xf32>
      %4 = "tensor.empty"() : () -> tensor<27x56xf32>
      %5 = "linalg.generic"(%3, %4) <{indexing_maps = [affine_map<(d0, d1) -> (d0, d1)>, affine_map<(d0, d1) -> (d1, d0)>], iterator_types = [#linalg.iterator_type<parallel>, #linalg.iterator_type<parallel>], operandSegmentSizes = array<i32: 1, 1>}> ({
      ^bb0(%arg2: f32, %arg3: f32):
        "linalg.yield"(%arg2) : (f32) -> ()
      }) : (tensor<56x27xf32>, tensor<27x56xf32>) -> tensor<27x56xf32>
      "flow.dispatch.tensor.store"(%5, %2) <{operandSegmentSizes = array<i32: 1, 1, 0, 0, 0, 0>, static_offsets = array<i64: 0, 0>, static_sizes = array<i64: 27, 56>, static_strides = array<i64: 1, 1>}> : (tensor<27x56xf32>, !flow.dispatch.tensor<writeonly:tensor<27x56xf32>>) -> ()
      "func.return"() : () -> ()
    }) : () -> ()
  }) : () -> ()
  "stream.executable.end"() : () -> ()
}) : () -> ()

Steps to reproduce your issue

  1. Download Movenet's singlepose thunder tensorflow lite model.
  2. Import the model with iree-import-tflite singlepose_thunder.tflite -o singlepose_thunder.mlir.
  3. Compile the model with iree-compile --iree-input-type=tosa --iree-hal-target-backends=vulkan-spirv singlepose_thunder.mlir -o singlepose_thunder.vulkan.vmfb.
  4. Error.

What component(s) does this issue relate to?

Compiler

Version information

IREE (https://iree.dev):
IREE compiler version 3.1.0rc20241225 @ 1f19761
LLVM version 20.0.0git
Optimized build

Additional context

This doesn't happen before 3.0.0. I've tried to compile it with the stable version of compiler from iree-base-compiler and it outputs the same error.

@RechieKho RechieKho added the bug 🐞 Something isn't working label Dec 29, 2024
@ScottTodd
Copy link
Member

Tagging iree-org/iree-test-suites#5 on this so I/we remember to add test coverage. Should have most of the groundwork done for adding test cases in iree-org/iree-test-suites#59.

@fire
Copy link

fire commented Jan 18, 2025

Is iree 3.1.0 expected to help this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants