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

Add --iree-flow-demote-i64-to-i32 and --iree-flow-demote-f64-to-f32 #53

Closed
powderluv opened this issue May 24, 2022 · 2 comments
Closed
Assignees

Comments

@powderluv
Copy link
Contributor

Add --iree-flow-demote-i64-to-i32 (default false) and --iree-flow-demote-f64-to-f32 to compile MiniLM via Torch-mlir and run on IREE.

@powderluv
Copy link
Contributor Author

See upstream issue iree-org/iree#9087 (comment)

@pashu123
Copy link
Collaborator

<stdin>:295:11: error: failed to materialize conversion for result #0 of operation 'hal.interface.binding.subspan' that remained live after conversion
    %55 = tensor.expand_shape %54 [[0], [1, 2, 3]] : tensor<1x?xf32> into tensor<1x1x1x?xf32>
          ^
<stdin>:23:3: note: called from
  func.func @forward(%arg0: tensor<1x128xi64>) -> tensor<1x2xf32> {
  ^
<stdin>:315:11: note: see existing live user here: %19 = memref.subview %13[0, 0, 0, %18] [1, 1, 1, %5] [1, 1, 1, 1] : memref<1x1x1x?xf32> to memref<?xf32, affine_map<(d0)[s0] -> (d0 + s0)>> loc(callsite("<stdin>":315:11 at "<stdin>":23:3))
    %75 = tensor.extract_slice %55[0, 0, 0, %64] [1, 1, 1, %74] [1, 1, 1, 1] : tensor<1x1x1x?xf32> to tensor<1x1x1x?xf32>
          ^
<stdin>:325:11: error: failed to run translation of source executable to target executable for backend #hal.executable.target<"vulkan", "vulkan-spirv-fb", {spv.target_env = #spv.target_env<#spv.vce<v1.3, [Shader, GroupNonUniform, GroupNonUniformVote, GroupNonUniformArithmetic, GroupNonUniformBallot, GroupNonUniformShuffle, GroupNonUniformShuffleRelative], [SPV_KHR_storage_buffer_storage_class]>, SwiftShader:CPU, {cooperative_matrix_properties_nv = [], max_compute_shared_memory_size = 16384 : i32, max_compute_workgroup_invocations = 128 : i32, max_compute_workgroup_size = dense<[128, 128, 64]> : vector<3xi32>, subgroup_size = 4 : i32}>}>
    %78 = linalg.generic {indexing_maps = [#map3, #map5, #map4], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%77, %cst_6 : tensor<1x1x1x?xf32>, tensor<f64>) outs(%76 : tensor<1x1x1x?xf32>) {
          ^
<stdin>:23:3: note: called from
  func.func @forward(%arg0: tensor<1x128xi64>) -> tensor<1x2xf32> {
  ^
<stdin>:325:11: error: failed to serialize executables
    %78 = linalg.generic {indexing_maps = [#map3, #map5, #map4], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%77, %cst_6 : tensor<1x1x1x?xf32>, tensor<f64>) outs(%76 : tensor<1x1x1x?xf32>) {
          ^
<stdin>:23:3: note: called from
  func.func @forward(%arg0: tensor<1x128xi64>) -> tensor<1x2xf32> {
  ^
compilation from source to vm failed


Invoked with:
 iree-compile /home/prashant/SHARK/shark.venv/lib/python3.9/site-packages/iree/compiler/tools/../_mlir_libs/iree-compile - --iree-input-type=none --iree-vm-bytecode-module-output-format=flatbuffer-binary --iree-hal-target-backends=vulkan --iree-mlir-to-vm-bytecode-module --iree-llvm-embedded-linker-path=/home/prashant/SHARK/shark.venv/lib/python3.9/site-packages/iree/compiler/tools/../_mlir_libs/iree-lld --mlir-print-debuginfo --mlir-print-op-on-diagnostic=false --iree-llvm-target-cpu-features=host --iree-flow-demote-i64-to-i32 --iree-flow-demote-f64-to-f32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants