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

iree-test-deps fails to build on macos-14 #19664

Open
marbre opened this issue Jan 10, 2025 · 1 comment
Open

iree-test-deps fails to build on macos-14 #19664

marbre opened this issue Jan 10, 2025 · 1 comment
Labels
bug 🐞 Something isn't working platform/macos 🍎 MacOS-specific build, execution, benchmarking, and deployment

Comments

@marbre
Copy link
Member

marbre commented Jan 10, 2025

What happened?

Setting up a workflow running on macos-14 (arm64, M1) that calls build_all.sh, it was noticed that the target iree-test-deps fails to build.

Trying to build, the error

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.

even shows up for targets VMVX and SPIR-V:

  • [315/987] Generating check_regression_vmvx_reduction_broadcast_elementwise.mlir_module.vmfb from reduction_broadcast_elementwise.mlir
  • [335/987] Generating check_regression_vulkan-spirv_transpose.mlir_module.vmfb from transpose.mlir

Furthermore, several lowering fail. Some error from the action log:

cd /Users/runner/work/iree/iree/build-macos/tests/e2e/stablehlo_models && /Users/runner/work/iree/iree/build-macos/tools/iree-compile --output-format=vm-bytecode --mlir-print-op-on-diagnostic=false --iree-input-type=stablehlo --iree-hal-target-backends=llvm-cpu --iree-llvmcpu-target-cpu=generic /Users/runner/work/iree/iree/tests/e2e/stablehlo_models/mnist_fake_weights.mlir -o mnist_fake_weights_llvm_cpu_static_bytecode_test_module.vmfb --iree-hal-executable-object-search-path=\"/Users/runner/work/iree/iree/build-macos\" --iree-llvmcpu-embedded-linker-path=\"/Users/runner/work/iree/iree/build-macos/llvm-project/bin/lld\" --iree-llvmcpu-wasm-linker-path=\"/Users/runner/work/iree/iree/build-macos/llvm-project/bin/lld\" --iree-llvmcpu-link-embedded=false --iree-llvmcpu-link-static --iree-llvmcpu-static-library-output-path=mnist_fake_weights_llvm_cpu_static_bytecode_test.o
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.

/Users/runner/work/iree/iree/tests/e2e/stablehlo_models/mnist_fake_weights.mlir:24:10: error: failed to legalize operation 'stream.executable' that was explicitly marked illegal
    %8 = stablehlo.dot %7, %6 : (tensor<1x784xf32>, tensor<784x128xf32>) -> tensor<1x128xf32>
         ^
/Users/runner/work/iree/iree/tests/e2e/stablehlo_models/mnist_fake_weights.mlir:24:10: note: called from
    %8 = stablehlo.dot %7, %6 : (tensor<1x784xf32>, tensor<784x128xf32>) -> tensor<1x128xf32>
         ^
/Users/runner/work/iree/iree/tests/e2e/stablehlo_models/mnist_fake_weights.mlir:11:3: note: called from
  func.func @predict(%arg0: tensor<1x28x28x1xf32>) -> tensor<1x10xf32> attributes {iree.module.export, iree.reflection = {abi = "sip", abiv = 1 : i32, sip = "I8!S5!k0_0R3!_0"}} {
  ^
[5/987] Generating simple_mul_llvm_cpu_static_bytecode_test_module.vmfb from simple_mul.mlir
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.
[8/987] Generating mnist_fake_weights_llvm_cpu_static_c_test_emitc.h, mnist_fake_weights_llvm_cpu_static_c_test.o, mnist_fake_weights_llvm_cpu_static_c_test.h
FAILED: tests/e2e/stablehlo_models/mnist_fake_weights_llvm_cpu_static_c_test_emitc.h tests/e2e/stablehlo_models/mnist_fake_weights_llvm_cpu_static_c_test.o tests/e2e/stablehlo_models/mnist_fake_weights_llvm_cpu_static_c_test.h /Users/runner/work/iree/iree/build-macos/tests/e2e/stablehlo_models/mnist_fake_weights_llvm_cpu_static_c_test_emitc.h /Users/runner/work/iree/iree/build-macos/tests/e2e/stablehlo_models/mnist_fake_weights_llvm_cpu_static_c_test.o /Users/runner/work/iree/iree/build-macos/tests/e2e/stablehlo_models/mnist_fake_weights_llvm_cpu_static_c_test.h 
cd /Users/runner/work/iree/iree/build-macos/tests/e2e/stablehlo_models && /Users/runner/work/iree/iree/build-macos/tools/iree-compile --output-format=vm-c --iree-input-type=stablehlo --iree-vm-target-index-bits=32 --iree-hal-target-backends=llvm-cpu --iree-llvmcpu-target-cpu=generic /Users/runner/work/iree/iree/tests/e2e/stablehlo_models/mnist_fake_weights.mlir -o mnist_fake_weights_llvm_cpu_static_c_test_emitc.h --iree-llvmcpu-link-embedded=false --iree-llvmcpu-link-static --iree-llvmcpu-static-library-output-path=mnist_fake_weights_llvm_cpu_static_c_test.o
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.

/Users/runner/work/iree/iree/tests/e2e/stablehlo_models/mnist_fake_weights.mlir:24:10: error: failed to legalize operation 'stream.executable' that was explicitly marked illegal
    %8 = stablehlo.dot %7, %6 : (tensor<1x784xf32>, tensor<784x128xf32>) -> tensor<1x128xf32>
         ^
/Users/runner/work/iree/iree/tests/e2e/stablehlo_models/mnist_fake_weights.mlir:24:10: note: called from
    %8 = stablehlo.dot %7, %6 : (tensor<1x784xf32>, tensor<784x128xf32>) -> tensor<1x128xf32>
         ^
/Users/runner/work/iree/iree/tests/e2e/stablehlo_models/mnist_fake_weights.mlir:11:3: note: called from
  func.func @predict(%arg0: tensor<1x28x28x1xf32>) -> tensor<1x10xf32> attributes {iree.module.export, iree.reflection = {abi = "sip", abiv = 1 : i32, sip = "I8!S5!k0_0R3!_0"}} {
  ^
/Users/runner/work/iree/iree/tests/e2e/stablehlo_models/mnist_fake_weights.mlir:24:10: note: see current operation: 
"stream.executable"() <{sym_name = "jit_eval_dispatch_0", sym_visibility = "private"}> ({
  "stream.executable.export"() <{function_ref = @jit_eval_dispatch_0_pack_f32, sym_name = "jit_eval_dispatch_0_pack_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_pack_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<784x128xf32>>
      %2 = "stream.binding.subspan"(%arg1, %0) : (!stream.binding, index) -> !flow.dispatch.tensor<writeonly:tensor<16x784x8x1xf32>>
      %3 = "flow.dispatch.tensor.load"(%1) <{operandSegmentSizes = array<i32: 1, 0, 0, 0, 0>, static_offsets = array<i64: 0, 0>, static_sizes = array<i64: 784, 128>, static_strides = array<i64: 1, 1>}> : (!flow.dispatch.tensor<readonly:tensor<784x128xf32>>) -> tensor<784x128xf32>
      %4 = "tensor.empty"() : () -> tensor<16x784x8x1xf32>
      %5 = "tensor.pack"(%3, %4) <{inner_dims_pos = array<i64: 1, 0>, operandSegmentSizes = array<i32: 1, 1, 0, 0>, outer_dims_perm = array<i64: 1, 0>, static_inner_tiles = array<i64: 8, 1>}> : (tensor<784x128xf32>, tensor<16x784x8x1xf32>) -> tensor<16x784x8x1xf32>
      "flow.dispatch.tensor.store"(%5, %2) <{operandSegmentSizes = array<i32: 1, 1, 0, 0, 0, 0>, static_offsets = array<i64: 0, 0, 0, 0>, static_sizes = array<i64: 16, 784, 8, 1>, static_strides = array<i64: 1, 1, 1, 1>}> : (tensor<16x784x8x1xf32>, !flow.dispatch.tensor<writeonly:tensor<16x784x8x1xf32>>) -> ()
      "func.return"() : () -> ()
    }) : () -> ()
  }) : () -> ()
  "stream.executable.end"() : () -> ()
}) : () -> ()
    %8 = stablehlo.dot %7, %6 : (tensor<1x784xf32>, tensor<784x128xf32>) -> tensor<1x128xf32>
         ^
[292/987] Generating check_regression_llvm-cpu_i1_inlined_constant.mlir_module.vmfb from i1_inlined_constant.mlir
FAILED: tests/e2e/regression/check_regression_llvm-cpu_i1_inlined_constant.mlir_module.vmfb /Users/runner/work/iree/iree/build-macos/tests/e2e/regression/check_regression_llvm-cpu_i1_inlined_constant.mlir_module.vmfb 
cd /Users/runner/work/iree/iree/build-macos/tests/e2e/regression && /Users/runner/work/iree/iree/build-macos/tools/iree-compile --output-format=vm-bytecode --mlir-print-op-on-diagnostic=false --iree-hal-target-backends=llvm-cpu --iree-input-type=stablehlo --iree-llvmcpu-target-cpu=generic /Users/runner/work/iree/iree/tests/e2e/regression/i1_inlined_constant.mlir -o check_regression_llvm-cpu_i1_inlined_constant.mlir_module.vmfb --iree-hal-executable-object-search-path=\"/Users/runner/work/iree/iree/build-macos\" --iree-llvmcpu-embedded-linker-path=\"/Users/runner/work/iree/iree/build-macos/llvm-project/bin/lld\" --iree-llvmcpu-wasm-linker-path=\"/Users/runner/work/iree/iree/build-macos/llvm-project/bin/lld\"
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.

/Users/runner/work/iree/iree/tests/e2e/regression/i1_inlined_constant.mlir:6:8: error: failed to legalize operation 'stream.executable' that was explicitly marked illegal
  %c = linalg.generic {
       ^
/Users/runner/work/iree/iree/tests/e2e/regression/i1_inlined_constant.mlir:6:8: note: called from
  %c = linalg.generic {
       ^
[298/987] Generating check_regression_llvm-cpu_scalar_computation.mlir_module.vmfb from scalar_computation.mlir
FAILED: tests/e2e/regression/check_regression_llvm-cpu_scalar_computation.mlir_module.vmfb /Users/runner/work/iree/iree/build-macos/tests/e2e/regression/check_regression_llvm-cpu_scalar_computation.mlir_module.vmfb 
cd /Users/runner/work/iree/iree/build-macos/tests/e2e/regression && /Users/runner/work/iree/iree/build-macos/tools/iree-compile --output-format=vm-bytecode --mlir-print-op-on-diagnostic=false --iree-hal-target-backends=llvm-cpu --iree-input-type=stablehlo --iree-llvmcpu-target-cpu=generic /Users/runner/work/iree/iree/tests/e2e/regression/scalar_computation.mlir -o check_regression_llvm-cpu_scalar_computation.mlir_module.vmfb --iree-hal-executable-object-search-path=\"/Users/runner/work/iree/iree/build-macos\" --iree-llvmcpu-embedded-linker-path=\"/Users/runner/work/iree/iree/build-macos/llvm-project/bin/lld\" --iree-llvmcpu-wasm-linker-path=\"/Users/runner/work/iree/iree/build-macos/llvm-project/bin/lld\"
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.

/Users/runner/work/iree/iree/tests/e2e/regression/scalar_computation.mlir:8:8: error: failed to legalize operation 'stream.executable' that was explicitly marked illegal
  %1 = linalg.generic {indexing_maps = [#map, #map, #map], iterator_types = []}
       ^
/Users/runner/work/iree/iree/tests/e2e/regression/scalar_computation.mlir:8:8: note: called from
  %1 = linalg.generic {indexing_maps = [#map, #map, #map], iterator_types = []}
       ^
[299/987] Generating check_regression_llvm-cpu_strided_slice.mlir_module.vmfb from strided_slice.mlir
FAILED: tests/e2e/regression/check_regression_llvm-cpu_strided_slice.mlir_module.vmfb /Users/runner/work/iree/iree/build-macos/tests/e2e/regression/check_regression_llvm-cpu_strided_slice.mlir_module.vmfb 
cd /Users/runner/work/iree/iree/build-macos/tests/e2e/regression && /Users/runner/work/iree/iree/build-macos/tools/iree-compile --output-format=vm-bytecode --mlir-print-op-on-diagnostic=false --iree-hal-target-backends=llvm-cpu --iree-input-type=stablehlo --iree-llvmcpu-target-cpu=generic /Users/runner/work/iree/iree/tests/e2e/regression/strided_slice.mlir -o check_regression_llvm-cpu_strided_slice.mlir_module.vmfb --iree-hal-executable-object-search-path=\"/Users/runner/work/iree/iree/build-macos\" --iree-llvmcpu-embedded-linker-path=\"/Users/runner/work/iree/iree/build-macos/llvm-project/bin/lld\" --iree-llvmcpu-wasm-linker-path=\"/Users/runner/work/iree/iree/build-macos/llvm-project/bin/lld\"
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.

/Users/runner/work/iree/iree/tests/e2e/regression/strided_slice.mlir:83:9: error: failed to legalize operation 'stream.executable' that was explicitly marked illegal
  %16 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%13 : tensor<?xf32>) outs(%14 : tensor<?xf32>) {
        ^
/Users/runner/work/iree/iree/tests/e2e/regression/strided_slice.mlir:83:9: note: called from
  %16 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%13 : tensor<?xf32>) outs(%14 : tensor<?xf32>) {
        ^
[313/987] Generating check_regression_vmvx_i1_inlined_constant.mlir_module.vmfb from i1_inlined_constant.mlir
FAILED: tests/e2e/regression/check_regression_vmvx_i1_inlined_constant.mlir_module.vmfb /Users/runner/work/iree/iree/build-macos/tests/e2e/regression/check_regression_vmvx_i1_inlined_constant.mlir_module.vmfb 
cd /Users/runner/work/iree/iree/build-macos/tests/e2e/regression && /Users/runner/work/iree/iree/build-macos/tools/iree-compile --output-format=vm-bytecode --mlir-print-op-on-diagnostic=false --iree-hal-target-backends=vmvx --iree-input-type=stablehlo /Users/runner/work/iree/iree/tests/e2e/regression/i1_inlined_constant.mlir -o check_regression_vmvx_i1_inlined_constant.mlir_module.vmfb --iree-hal-executable-object-search-path=\"/Users/runner/work/iree/iree/build-macos\"
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.

/Users/runner/work/iree/iree/tests/e2e/regression/i1_inlined_constant.mlir:6:8: error: failed to legalize operation 'stream.executable' that was explicitly marked illegal
  %c = linalg.generic {
       ^
/Users/runner/work/iree/iree/tests/e2e/regression/i1_inlined_constant.mlir:6:8: note: called from
  %c = linalg.generic {
       ^
[317/987] Generating check_regression_vmvx_scalar_computation.mlir_module.vmfb from scalar_computation.mlir
FAILED: tests/e2e/regression/check_regression_vmvx_scalar_computation.mlir_module.vmfb /Users/runner/work/iree/iree/build-macos/tests/e2e/regression/check_regression_vmvx_scalar_computation.mlir_module.vmfb 
cd /Users/runner/work/iree/iree/build-macos/tests/e2e/regression && /Users/runner/work/iree/iree/build-macos/tools/iree-compile --output-format=vm-bytecode --mlir-print-op-on-diagnostic=false --iree-hal-target-backends=vmvx --iree-input-type=stablehlo /Users/runner/work/iree/iree/tests/e2e/regression/scalar_computation.mlir -o check_regression_vmvx_scalar_computation.mlir_module.vmfb --iree-hal-executable-object-search-path=\"/Users/runner/work/iree/iree/build-macos\"
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.

/Users/runner/work/iree/iree/tests/e2e/regression/scalar_computation.mlir:8:8: error: failed to legalize operation 'stream.executable' that was explicitly marked illegal
  %1 = linalg.generic {indexing_maps = [#map, #map, #map], iterator_types = []}
       ^
/Users/runner/work/iree/iree/tests/e2e/regression/scalar_computation.mlir:8:8: note: called from
  %1 = linalg.generic {indexing_maps = [#map, #map, #map], iterator_types = []}
       ^
[318/987] Generating check_regression_vmvx_strided_slice.mlir_module.vmfb from strided_slice.mlir
FAILED: tests/e2e/regression/check_regression_vmvx_strided_slice.mlir_module.vmfb /Users/runner/work/iree/iree/build-macos/tests/e2e/regression/check_regression_vmvx_strided_slice.mlir_module.vmfb 
cd /Users/runner/work/iree/iree/build-macos/tests/e2e/regression && /Users/runner/work/iree/iree/build-macos/tools/iree-compile --output-format=vm-bytecode --mlir-print-op-on-diagnostic=false --iree-hal-target-backends=vmvx --iree-input-type=stablehlo /Users/runner/work/iree/iree/tests/e2e/regression/strided_slice.mlir -o check_regression_vmvx_strided_slice.mlir_module.vmfb --iree-hal-executable-object-search-path=\"/Users/runner/work/iree/iree/build-macos\"
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.

/Users/runner/work/iree/iree/tests/e2e/regression/strided_slice.mlir:83:9: error: failed to legalize operation 'stream.executable' that was explicitly marked illegal
  %16 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%13 : tensor<?xf32>) outs(%14 : tensor<?xf32>) {
        ^
/Users/runner/work/iree/iree/tests/e2e/regression/strided_slice.mlir:83:9: note: called from
  %16 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%13 : tensor<?xf32>) outs(%14 : tensor<?xf32>) {
        ^
[329/987] Generating check_regression_vulkan-spirv_i1_inlined_constant.mlir_module.vmfb from i1_inlined_constant.mlir
FAILED: tests/e2e/regression/check_regression_vulkan-spirv_i1_inlined_constant.mlir_module.vmfb /Users/runner/work/iree/iree/build-macos/tests/e2e/regression/check_regression_vulkan-spirv_i1_inlined_constant.mlir_module.vmfb 
cd /Users/runner/work/iree/iree/build-macos/tests/e2e/regression && /Users/runner/work/iree/iree/build-macos/tools/iree-compile --output-format=vm-bytecode --mlir-print-op-on-diagnostic=false --iree-hal-target-backends=vulkan-spirv --iree-input-type=stablehlo /Users/runner/work/iree/iree/tests/e2e/regression/i1_inlined_constant.mlir -o check_regression_vulkan-spirv_i1_inlined_constant.mlir_module.vmfb --iree-hal-executable-object-search-path=\"/Users/runner/work/iree/iree/build-macos\"
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.

/Users/runner/work/iree/iree/tests/e2e/regression/i1_inlined_constant.mlir:6:8: error: failed to legalize operation 'stream.executable' that was explicitly marked illegal
  %c = linalg.generic {
       ^
/Users/runner/work/iree/iree/tests/e2e/regression/i1_inlined_constant.mlir:6:8: note: called from
  %c = linalg.generic {
       ^

Steps to reproduce your issue

Set IREE_BUILD_TEST_DEPS to 1 in .github/workflows/ci_macos_arm64_clang.yml as soon as the PR adding the workflow is landed.

What component(s) does this issue relate to?

No response

Version information

No response

Additional context

No response

@marbre marbre added bug 🐞 Something isn't working platform/macos 🍎 MacOS-specific build, execution, benchmarking, and deployment labels Jan 10, 2025
@benvanik
Copy link
Collaborator

that's probably the aggressive check for defaults - since it should only be used to generate a warning we should silence it if it can't do its thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working platform/macos 🍎 MacOS-specific build, execution, benchmarking, and deployment
Projects
None yet
Development

No branches or pull requests

2 participants