CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
82 lines
3.1 KiB
MLIR
82 lines
3.1 KiB
MLIR
// RUN: mlir-opt %s -convert-linalg-to-std --split-input-file -verify-diagnostics | FileCheck %s
|
|
|
|
func.func @dot(%arg0: memref<?xf32, strided<[1], offset: ?>>,
|
|
%arg1: memref<?xf32, strided<[1], offset: ?>>,
|
|
%arg2: memref<f32>) {
|
|
linalg.dot ins(%arg0, %arg1: memref<?xf32, strided<[1], offset: ?>>,
|
|
memref<?xf32, strided<[1], offset: ?>>)
|
|
outs(%arg2: memref<f32>)
|
|
return
|
|
}
|
|
// CHECK-LABEL: func @dot(
|
|
// CHECK-SAME: %[[arg0:[a-zA-z0-9]*]]: memref<?xf32, strided<[1], offset: ?>>,
|
|
// CHECK-SAME: %[[arg1:[a-zA-z0-9]*]]: memref<?xf32, strided<[1], offset: ?>>,
|
|
// CHECK-SAME: %[[arg2:[a-zA-z0-9]*]]: memref<f32>) {
|
|
// CHECK: %[[o0:.*]] = memref.cast %[[arg0]] :
|
|
// CHECK-SAME: memref<?xf32, strided<[1], offset: ?>> to memref<?xf32, strided<[?], offset: ?>>
|
|
// CHECK: %[[o1:.*]] = memref.cast %[[arg1]] :
|
|
// CHECK-SAME: memref<?xf32, strided<[1], offset: ?>> to memref<?xf32, strided<[?], offset: ?>>
|
|
// CHECK: %[[o2:.*]] = memref.cast %[[arg2]] :
|
|
// CHECK-SAME: memref<f32> to memref<f32, strided<[], offset: ?>>
|
|
// CHECK: call @linalg_dot_viewsxf32_viewsxf32_viewf32(
|
|
// CHECK-SAME: %[[o0]], %[[o1]], %[[o2]]) :
|
|
// CHECK-SAME: memref<?xf32, strided<[?], offset: ?>>, memref<?xf32, strided<[?], offset: ?>>, memref<f32, strided<[], offset: ?>>
|
|
|
|
// -----
|
|
|
|
#matmul_accesses = [
|
|
affine_map<(m, n, k) -> (m, k)>,
|
|
affine_map<(m, n, k) -> (k, n)>,
|
|
affine_map<(m, n, k) -> (m, n)>
|
|
]
|
|
#matmul_trait = {
|
|
iterator_types = ["parallel", "parallel", "reduction"],
|
|
indexing_maps = #matmul_accesses,
|
|
library_call = "external_outerproduct_matmul"
|
|
}
|
|
|
|
!vector_type_A = vector<4xf32>
|
|
!vector_type_B = vector<4xf32>
|
|
!vector_type_C = vector<4x4xf32>
|
|
|
|
!matrix_type_A = memref<?x?x!vector_type_A>
|
|
!matrix_type_B = memref<?x?x!vector_type_B>
|
|
!matrix_type_C = memref<?x?x!vector_type_C>
|
|
|
|
func.func @matmul_vec_impl(%A: !matrix_type_A, %B: !matrix_type_B, %C: !matrix_type_C) {
|
|
linalg.generic #matmul_trait
|
|
ins(%A, %B : !matrix_type_A, !matrix_type_B)
|
|
outs(%C : !matrix_type_C) {
|
|
^bb0(%a: !vector_type_A, %b: !vector_type_B, %c: !vector_type_C):
|
|
%d = vector.outerproduct %a, %b, %c: !vector_type_A, !vector_type_B
|
|
linalg.yield %d: !vector_type_C
|
|
}
|
|
return
|
|
}
|
|
// CHECK-LABEL: func @matmul_vec_impl(
|
|
// CHECK: call @external_outerproduct_matmul(%{{.*}}) :
|
|
|
|
// -----
|
|
|
|
#map = affine_map<(d0, d1) -> (d0, d1)>
|
|
#map1 = affine_map<(d0, d1) -> (d0)>
|
|
|
|
func.func @func(%arg0: tensor<?x?xf32>, %arg1: tensor<?xf32>) {
|
|
// expected-error @below {{failed to legalize}}
|
|
%0 = linalg.generic {
|
|
indexing_maps = [#map, #map1], iterator_types = ["parallel", "reduction"]}
|
|
ins(%arg0 : tensor<?x?xf32>) outs(%arg1 : tensor<?xf32>) {
|
|
^bb0(%in: f32, %out: f32):
|
|
linalg.yield %in : f32
|
|
} -> tensor<?xf32>
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @func(%arg0: tensor<4x8xf32>, %arg1: tensor<4x8xf32>) -> tensor<4x8xf32> {
|
|
// expected-error @below {{failed to legalize}}
|
|
%0 = linalg.copy ins(%arg0 : tensor<4x8xf32>) outs(%arg1 : tensor<4x8xf32>) -> tensor<4x8xf32>
|
|
return %0 : tensor<4x8xf32>
|
|
}
|