[Mlir-commits] [mlir] 3231b6d - [mlir][OpDSL] Remove unused SoftPlus2DOp operation.

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Mar 8 09:26:14 PST 2022


Author: gysit
Date: 2022-03-08T17:25:29Z
New Revision: 3231b6d3a2b18c8e12118a3a1f15362ec432c1b6

URL: https://github.com/llvm/llvm-project/commit/3231b6d3a2b18c8e12118a3a1f15362ec432c1b6
DIFF: https://github.com/llvm/llvm-project/commit/3231b6d3a2b18c8e12118a3a1f15362ec432c1b6.diff

LOG: [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

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
    mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml b/mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
index 21f28cbd84c3b..2138822b7cfee 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 39934131cb225..2e1424a932a58 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)
-
-
- at 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])))


        


More information about the Mlir-commits mailing list