Files
TheRock/compiler/amd-llvm/mlir/test/Dialect/Quant/ops.mlir
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

171 lines
4.4 KiB
MLIR

// RUN: mlir-opt %s -split-input-file -verify-diagnostics
!qalias = !quant.uniform<i8:f32, 1.0>
func.func @dcast_scalar(%arg0: !qalias) {
%0 = quant.dcast %arg0 : !qalias to f32
return
}
// -----
!qalias = !quant.uniform<i8:f32, 1.0>
func.func @dcast_ranked(%arg0: tensor<2x?x4x!qalias>) {
%0 = quant.dcast %arg0 : tensor<2x?x4x!qalias> to tensor<2x?x4xf32>
return
}
// -----
!qalias = !quant.uniform<i8:f32, 1.0>
func.func @dcast_unranked(%arg0: tensor<*x!qalias>) {
%0 = quant.dcast %arg0 : tensor<*x!qalias> to tensor<*xf32>
return
}
// -----
!qalias = !quant.uniform<i8:f32:2, {1.0, 2.0, 3.0}>
func.func @dcast_per_axis_static(%arg0: tensor<1x2x3x!qalias>) {
%0 = quant.dcast %arg0 : tensor<1x2x3x!qalias> to tensor<1x2x3xf32>
return
}
// -----
!qalias = !quant.uniform<i8:f32:2, {1.0, 2.0, 3.0}>
func.func @dcast_per_axis_dynamic(%arg0: tensor<?x?x?x!qalias>) {
%0 = quant.dcast %arg0 : tensor<?x?x?x!qalias> to tensor<?x?x?xf32>
return
}
// -----
!qalias = !quant.uniform<i8:f32:2, {1.0, 2.0, 3.0}>
func.func @dcast_per_axis_unranked(%arg0: tensor<*x!qalias>) {
%0 = quant.dcast %arg0 : tensor<*x!qalias> to tensor<*xf32>
return
}
// -----
!qalias = !quant.uniform<i8:f32, 1.0>
func.func @qcast_scalar(%arg0: f32) {
%0 = quant.qcast %arg0 : f32 to !qalias
return
}
// -----
!qalias = !quant.uniform<i8:f32, 1.0>
func.func @qcast_ranked(%arg0: tensor<2x?x4xf32>) {
%0 = quant.qcast %arg0 : tensor<2x?x4xf32> to tensor<2x?x4x!qalias>
return
}
// -----
!qalias = !quant.uniform<i8:f32, 1.0>
func.func @qcast_unranked(%arg0: tensor<*xf32>) {
%0 = quant.qcast %arg0 : tensor<*xf32> to tensor<*x!qalias>
return
}
// -----
!qalias = !quant.uniform<i8:f32:2, {1.0, 2.0, 3.0}>
func.func @qcast_per_axis_static(%arg0: tensor<1x2x3xf32>) {
%0 = quant.qcast %arg0 : tensor<1x2x3xf32> to tensor<1x2x3x!qalias>
return
}
// -----
!qalias = !quant.uniform<i8:f32:2, {1.0, 2.0, 3.0}>
func.func @qcast_per_axis_dynamic(%arg0: tensor<?x?x?xf32>) {
%0 = quant.qcast %arg0 : tensor<?x?x?xf32> to tensor<?x?x?x!qalias>
return
}
// -----
!qalias = !quant.uniform<i8:f32:2, {1.0, 2.0, 3.0}>
func.func @qcast_per_axis_unranked(%arg0: tensor<*xf32>) {
%0 = quant.qcast %arg0 : tensor<*xf32> to tensor<*x!qalias>
return
}
// -----
!qalias = !quant.uniform<i8:f32, 1.0>
func.func @scast_scalar(%arg0: i8) {
%0 = quant.scast %arg0 : i8 to !qalias
%1 = quant.scast %0 : !qalias to i8
return
}
// -----
!qalias = !quant.uniform<i8:f32, 1.0>
func.func @scast_ranked(%arg0: tensor<2x?x4xi8>) {
%0 = quant.scast %arg0 : tensor<2x?x4xi8> to tensor<2x?x4x!qalias>
%1 = quant.scast %0 : tensor<2x?x4x!qalias> to tensor<2x?x4xi8>
return
}
// -----
!qalias = !quant.uniform<i8:f32, 1.0>
func.func @scast_unranked(%arg0: tensor<*xi8>) {
%0 = quant.scast %arg0 : tensor<*xi8> to tensor<*x!qalias>
%1 = quant.scast %0 : tensor<*x!qalias> to tensor<*xi8>
return
}
// -----
!qalias = !quant.uniform<i8:f32:2, {1.0, 2.0, 3.0}>
func.func @scast_per_axis_static(%arg0: tensor<1x2x3xi8>) {
%0 = quant.scast %arg0 : tensor<1x2x3xi8> to tensor<1x2x3x!qalias>
%1 = quant.scast %0 : tensor<1x2x3x!qalias> to tensor<1x2x3xi8>
return
}
// -----
!qalias = !quant.uniform<i8:f32:2, {1.0, 2.0, 3.0}>
func.func @scast_per_axis_dynamic(%arg0: tensor<?x?x?xi8>) {
%0 = quant.scast %arg0 : tensor<?x?x?xi8> to tensor<?x?x?x!qalias>
%1 = quant.scast %0 : tensor<?x?x?x!qalias> to tensor<?x?x?xi8>
return
}
// -----
!qalias = !quant.uniform<i8:f32:2, {1.0, 2.0, 3.0}>
func.func @scast_per_axis_unranked(%arg0: tensor<*xi8>) {
%0 = quant.scast %arg0 : tensor<*xi8> to tensor<*x!qalias>
%1 = quant.scast %0 : tensor<*x!qalias> to tensor<*xi8>
return
}
// -----
!qalias = !quant.uniform<u8:f32:{0:1,1:2},
{{2.000000e+02:120,9.987200e-01:127}, {2.000000e+02,9.987200e-01}}>
func.func @sub_channel_quantization(%arg0: tensor<2x4xi8>) -> tensor<2x4xi8> {
%0 = quant.scast %arg0 : tensor<2x4xi8> to tensor<2x4x!qalias>
%1 = quant.dcast %0 : tensor<2x4x!qalias> to tensor<2x4xf32>
%2 = quant.qcast %1 : tensor<2x4xf32> to tensor<2x4x!qalias>
%3 = quant.scast %2 : tensor<2x4x!qalias> to tensor<2x4xi8>
return %3 : tensor<2x4xi8>
}
// -----
!qalias = !quant.uniform<u8:f32:{0:1,1:2},
{{2.000000e+02:120,9.987200e-01:127}, {2.000000e+02,9.987200e-01}}>
func.func @sub_channel_quantization_with_unknown_dims(%arg0: tensor<2x?xf32>) {
%0 = quant.qcast %arg0 : tensor<2x?xf32> to tensor<2x?x!qalias>
return
}