From 3231b6d3a2b18c8e12118a3a1f15362ec432c1b6 Mon Sep 17 00:00:00 2001 From: gysit Date: Tue, 8 Mar 2022 17:20:01 +0000 Subject: [PATCH] [mlir][OpDSL] Remove unused SoftPlus2DOp operation. The revision removes the SoftPlus2DOp operation that previously served as a test operation. It has been replaced by the elemwise_unary operation, which is now used to test unary log and exp functions. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D120794 --- .../Linalg/IR/LinalgNamedStructuredOps.yaml | 62 ------------------- .../linalg/opdsl/ops/core_named_ops.py | 13 ---- 2 files changed, 75 deletions(-) diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml b/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml index 21f28cbd84c3..2138822b7cfe 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml @@ -3090,65 +3090,3 @@ structured_op: !LinalgStructuredOpConfig scalar_const: '2.3283063999999999E-10 : f64' - !ScalarExpression scalar_arg: min ---- !LinalgOpConfig -metadata: !LinalgOpMetadata - name: soft_plus_2d - cpp_class_name: SoftPlus2DOp - doc: |- - Implements the soft plus operator. - - Numeric casting is performed on the input operand, promoting it to the same - data type as the accumulator/output. -structured_op: !LinalgStructuredOpConfig - args: - - !LinalgOperandDefConfig - name: I - kind: input_tensor - type_var: T - shape_map: affine_map<()[s0, s1] -> (s0, s1)> - - !LinalgOperandDefConfig - name: O - kind: output_tensor - type_var: U - shape_map: affine_map<()[s0, s1] -> (s0, s1)> - indexing_maps: !LinalgIndexingMapsConfig - static_indexing_maps: - - affine_map<(d0, d1)[s0, s1] -> (d0, d1)> - - affine_map<(d0, d1)[s0, s1] -> (d0, d1)> - iterator_types: - - parallel - - parallel - assignments: - - !ScalarAssign - arg: O - value: !ScalarExpression - scalar_fn: - kind: unary - fn_name: log - operands: - - !ScalarExpression - scalar_fn: - kind: binary - fn_name: add - operands: - - !ScalarExpression - scalar_fn: - kind: type - fn_name: cast_signed - type_var: U - operands: - - !ScalarExpression - scalar_const: '1.000000e+00 : f64' - - !ScalarExpression - scalar_fn: - kind: unary - fn_name: exp - operands: - - !ScalarExpression - scalar_fn: - kind: type - fn_name: cast_signed - type_var: U - operands: - - !ScalarExpression - scalar_arg: I diff --git a/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py b/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py index 39934131cb22..2e1424a932a5 100644 --- a/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py +++ b/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py @@ -702,16 +702,3 @@ def fill_rng_2d( scaling = (max - min) * inv_range O[D.m, D.n] = TypeFn.cast_signed( T, (offset + TypeFn.cast_signed(F64, rand2)) * scaling + min) - - -@linalg_structured_op -def soft_plus_2d( - I=TensorDef(T, S.M, S.N), O=TensorDef(U, S.M, S.N, output=True)): - """Implements the soft plus operator. - - Numeric casting is performed on the input operand, promoting it to the same - data type as the accumulator/output. - """ - domain(D.m, D.n) - O[D.m, D.n] = \ - UnaryFn.log(TypeFn.cast_signed(U, const(1.0)) + UnaryFn.exp(TypeFn.cast_signed(U, I[D.m, D.n])))