Skip to content

[vulkan] compile error on f16 matmuls. #22717

@amd-eochoalo

Description

@amd-eochoalo

What happened?

module @module {
  func.func @main(%arg0: !torch.vtensor<[64,64],f16>, %arg1: !torch.vtensor<[64,64],f16>) -> !torch.vtensor<[64,64],f16> attributes {torch.assume_strict_symbolic_shapes} {
    %0 = torch.aten.matmul %arg0, %arg1 : !torch.vtensor<[64,64],f16>, !torch.vtensor<[64,64],f16> -> !torch.vtensor<[64,64],f16>
    return %0 : !torch.vtensor<[64,64],f16>
  }
}
$ $HOME/build/iree/tools/iree-compile bug.mlir --iree-hal-target-device=vulkan
<unknown>:0: error: failed to legalize operation 'vector.bitcast'
<unknown>:0: note: see current operation: %310 = "vector.bitcast"(%309) : (vector<2xf32>) -> vector<4xf16>
bad.mlir:3:10: error: failed to run translation of source executable to target executable for backend #hal.executable.target<"vulkan-spirv", "vulkan-spirv-fb", {iree_codegen.target_info = #iree_gpu.target<arch = "vp_android_baseline_2022", features = "spirv:v1.3,cap:Shader", wgp = <compute =  fp32|int32, storage =  b32, subgroup =  none, subgroup_size_choices = [64], max_workgroup_sizes = [128, 128, 64], max_thread_count_per_workgroup = 128, max_workgroup_memory_bytes = 16384, max_workgroup_counts = [65535, 65535, 65535]>>}>
    %0 = torch.aten.matmul %arg0, %arg1 : !torch.vtensor<[64,64],f16>, !torch.vtensor<[64,64],f16> -> !torch.vtensor<[64,64],f16>
         ^

The error does not happen on hip targets, neither with f32s, neither with dynamic_shapes.

Version information

Tested on this iree commit 7aa04a4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐞Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions