diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/batch_matmul_impl.py b/example/resnet50_imagenet2012_THOR/cus_ops/batch_matmul_impl.py deleted file mode 100644 index 201d427308e70f4702176660046998f453f5f65a..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/batch_matmul_impl.py +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""batch_matmul_impl""" -from mindspore.ops.op_info_register import op_info_register - -@op_info_register("""{ - "op_name": "CusBatchMatMul", - "imply_type": "TBE", - "fusion_type": "OPAQUE", - "async_flag": false, - "binfile_name": "batchmatmul.so", - "compute_cost": 10, - "kernel_name": "CusBatchMatMul", - "partial_flag": true, - "attr": [ - ], - "inputs": [ - { - "index": 0, - "dtype": [ - "float32" - ], - "format": [ - "DefaultFormat" - ], - "name": "x1", - "need_compile": false, - "param_type": "required", - "shape": "all" - }, - { - "index": 1, - "dtype": [ - "float32" - ], - "format": [ - "DefaultFormat" - ], - "name": "x2", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ], - "outputs": [ - { - "index": 0, - "dtype": [ - "float32" - ], - "format": [ - "DefaultFormat" - ], - "name": "y", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ] -}""") -def CusBatchMatMul(input_x1, input_x2, output, transpose_a=False, transpose_b=True, kernel_name="batchmatmul"): - """CusBatchMatMul""" - return diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/cholesky_trsm.py b/example/resnet50_imagenet2012_THOR/cus_ops/cholesky_trsm.py deleted file mode 100644 index 8f09fab77daada259543edd759fa6825c6205794..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/cholesky_trsm.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusCholeskyTrsm""" -from mindspore.ops.op_info_register import op_info_register - -@op_info_register("""{ - "op_name": "CusCholeskyTrsm", - "imply_type": "TBE", - "fusion_type": "OPAQUE", - "async_flag": false, - "binfile_name": "choleskytrsm.so", - "compute_cost": 10, - "kernel_name": "CusCholeskyTrsm", - "partial_flag": true, - "attr": [ - - ], - "inputs": [ - { - "index": 0, - "dtype": [ - "float32" - ], - "format": [ - "DefaultFormat" - ], - "name": "x1", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ], - "outputs": [ - { - "index": 0, - "dtype": [ - "float32" - ], - "format": [ - "DefaultFormat" - ], - "name": "y", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ] -}""") -def CusCholeskyTrsm(input_x, output, kernel_name): - """CusCholeskyTrsm""" - return diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/cus_batch_matmul.py b/example/resnet50_imagenet2012_THOR/cus_ops/cus_batch_matmul.py deleted file mode 100644 index 1e72ed9fac184dd2cfa4e976a2921b3fcba84e7c..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/cus_batch_matmul.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusBatchMatMul""" -from mindspore.ops import prim_attr_register, PrimitiveWithInfer -from mindspore.ops.composite import multitype_ops as C - -class CusBatchMatMul(PrimitiveWithInfer): - """CusMatMulCube definition""" - - @prim_attr_register - def __init__(self): - """init CusMatMulCube""" - self.init_prim_io_names(inputs=['x1', 'x2'], outputs=['y']) - - def get_bprop(self): - def bprop(x1, x2, out, dout): - return (C.zeros_like(x1), C.zeros_like(x2)) - - return bprop - - def infer_shape(self, data1_shape, data2_shape): - return data1_shape - - def infer_dtype(self, data1_dtype, data2_dtype): - return data1_dtype diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/cus_cholesky_trsm.py b/example/resnet50_imagenet2012_THOR/cus_ops/cus_cholesky_trsm.py deleted file mode 100644 index d6ea0156223486e94c569e71cc65cdb896cff83c..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/cus_cholesky_trsm.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusCholeskyTrsm""" -from mindspore.ops import prim_attr_register, PrimitiveWithInfer - - -class CusCholeskyTrsm(PrimitiveWithInfer): - """CusCholeskyTrsm definition""" - - @prim_attr_register - def __init__(self): - """init CusCholeskyTrsm""" - self.init_prim_io_names(inputs=['x1'], outputs=['y']) - - def infer_shape(self, data1_shape): - ll = [] - m, _ = data1_shape - if m >= 128: - ll = [m // 128, 128, 128] - else: - ll = [1, 64, 64] - return ll - - def infer_dtype(self, data1_dtype): - return data1_dtype diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/cus_fused_abs_max1.py b/example/resnet50_imagenet2012_THOR/cus_ops/cus_fused_abs_max1.py deleted file mode 100644 index c49c36ddd470e8ed07cf00f67e271718f9738299..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/cus_fused_abs_max1.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusFusedAbsMax1""" -from mindspore.ops import prim_attr_register, PrimitiveWithInfer -from mindspore.ops.composite import multitype_ops as C - - -class CusFusedAbsMax1(PrimitiveWithInfer): - """CusCholeskyTrsm definition""" - - @prim_attr_register - def __init__(self, origin_shape=[-1, -1]): - """init CusCholeskyTrsm""" - self.init_prim_io_names(inputs=['x1'], outputs=['y']) - self.origin_shape = origin_shape - - def get_bprop(self): - def bprop(x, out, dout): - return (C.zeros_like(x),) - - return bprop - - def infer_shape(self, data1_shape): - ll = [] - if len(data1_shape) == 2: - ll = [1,] - else: - ll = [32, 64] - return ll - - def infer_dtype(self, data1_dtype): - return data1_dtype diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/cus_img2col.py b/example/resnet50_imagenet2012_THOR/cus_ops/cus_img2col.py deleted file mode 100644 index e1128291ddee5935262cd76e2ba9de39ea8c1fa3..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/cus_img2col.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusImg2Col""" -from mindspore.ops import prim_attr_register, PrimitiveWithInfer -from mindspore.ops.composite import multitype_ops as C - - -class CusImg2Col(PrimitiveWithInfer): - """CusImg2Col definition""" - - @prim_attr_register - def __init__(self, ksizes, strides, dilates=(1, 1, 1, 1), mode="NC1HWC0"): - """init CusImg2Col""" - self.init_prim_io_names(inputs=['x1'], outputs=['y']) - self.ksizes = ksizes - self.strides = strides - self.dilates = dilates - self.mode = mode - - def get_bprop(self): - def bprop(x, out, dout): - return (C.zeros_like(x),) - - return bprop - - def infer_shape(self, data1_shape): - bs, c, h, w = data1_shape - _, stride_h, stride_w, _ = self.strides - _, k_w, k_h, _ = self.ksizes - # assert m == n - c0 = 16 - c1 = c // 16 - if c1 == 0: - c1 = 1 - shape = [bs * int(h // stride_h) * int(w // stride_w), k_w * k_h * c1 * c0] - return shape - - def infer_dtype(self, data1_dtype): - return data1_dtype diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube.py b/example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube.py deleted file mode 100644 index e41cb6bc98bd5ee8e9dd5bbd8130d553f772f948..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube.py +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusMatMulCube""" -import mindspore as ms -from mindspore.ops import prim_attr_register, PrimitiveWithInfer -from mindspore.ops.composite import multitype_ops as C - - -# y = x^2 -class CusMatMulCube(PrimitiveWithInfer): - """CusMatMulCube definition""" - - @prim_attr_register - def __init__(self, transpose_a=False, transpose_b=False): - """init CusMatMulCube""" - self.init_prim_io_names(inputs=['x1', 'x2'], outputs=['y']) - self.transpose_a = transpose_a - self.transpose_b = transpose_b - - def get_bprop(self): - def bprop(x1, x2, out, dout): - return (C.zeros_like(x1), C.zeros_like(x2)) - - return bprop - - def infer_shape(self, data1_shape, data2_shape): - # shape = [1, data1_shape[1], data2_shape[2], 16, 16] - # return shape - if self.transpose_a: - k1, m = data1_shape - else: - m, k1 = data1_shape - if self.transpose_b: - n, k2 = data2_shape - else: - k2, n = data2_shape - assert k1 == k2 - shape = [m, n] - return shape - - def infer_dtype(self, data1_dtype, data2_dtype): - return ms.common.dtype.tensor_type(getattr(ms, "float32")) diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube_dense_left.py b/example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube_dense_left.py deleted file mode 100644 index 4228e3938a0d987a59219cd92fab8319beec5090..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube_dense_left.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusMatMulCubeDenseLeft""" -import mindspore as ms -from mindspore.ops import prim_attr_register, PrimitiveWithInfer -from mindspore.ops.composite import multitype_ops as C - - -# y = x^2 -class CusMatMulCubeDenseLeft(PrimitiveWithInfer): - """CusMatMulCube definition""" - - @prim_attr_register - def __init__(self): - """init CusMatMulCube""" - self.init_prim_io_names(inputs=['x1', 'x2'], outputs=['y']) - - def get_bprop(self): - def bprop(x1, x2, out, dout): - return (C.zeros_like(x1), C.zeros_like(x2)) - - return bprop - - def infer_shape(self, data1_shape, data2_shape): - return data2_shape - - def infer_dtype(self, data1_dtype, data2_dtype): - return ms.common.dtype.tensor_type(getattr(ms, "float16")) diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube_fracz_right_mul.py b/example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube_fracz_right_mul.py deleted file mode 100644 index a80a52797e4c44b9426e6af60c82f519bd146407..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube_fracz_right_mul.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusMatMulCubeFraczRightMul""" -import mindspore as ms -from mindspore.ops import prim_attr_register, PrimitiveWithInfer -from mindspore.ops.composite import multitype_ops as C - - -class CusMatMulCubeFraczRightMul(PrimitiveWithInfer): - """CusMatMulCubeFraczRightMul definition""" - - @prim_attr_register - def __init__(self): - """init CusMatMulCubeFraczRightMul""" - self.init_prim_io_names(inputs=['x1', 'x2', 'x3'], outputs=['y']) - - def get_bprop(self): - def bprop(x1, x2, x3, out, dout): - return (C.zeros_like(x1), C.zeros_like(x2), C.zeros_like(x3)) - - return bprop - - def infer_shape(self, data1_shape, data2_shape, data3_shape): - return data1_shape - - def infer_dtype(self, data1_dtype, data2_dtype, data3_dtype): - return ms.common.dtype.tensor_type(getattr(ms, "float32")) diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/cus_matrix_combine.py b/example/resnet50_imagenet2012_THOR/cus_ops/cus_matrix_combine.py deleted file mode 100644 index 373f149dd08ddd11d570b64e5271a26c0a0c2aa8..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/cus_matrix_combine.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusMatrixCombine""" -from mindspore.ops import prim_attr_register, PrimitiveWithInfer -from mindspore.ops.composite import multitype_ops as C - - -class CusMatrixCombine(PrimitiveWithInfer): - """CusMatMulCube definition""" - - @prim_attr_register - def __init__(self): - """init CusMatMulCube""" - self.init_prim_io_names(inputs=['x'], outputs=['y']) - - def get_bprop(self): - def bprop(x, out, dout): - return (C.zeros_like(x),) - - return bprop - - def infer_shape(self, data_shape): - a, b, c = data_shape - shape = [a * b, a * c] - - return shape - - def infer_dtype(self, data_dtype): - return data_dtype diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/cus_transpose02314.py b/example/resnet50_imagenet2012_THOR/cus_ops/cus_transpose02314.py deleted file mode 100644 index b856cf7da780d177a23095f78f0af598a378e01c..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/cus_transpose02314.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusTranspose02314""" - -from mindspore.ops import prim_attr_register, PrimitiveWithInfer -from mindspore.ops.composite import multitype_ops as C - - -class CusTranspose02314(PrimitiveWithInfer): - """CusTranspose02314 definition""" - - @prim_attr_register - def __init__(self): - """init CusTranspose02314""" - self.init_prim_io_names(inputs=['x1'], outputs=['y']) - - def get_bprop(self): - def bprop(x, out, dout): - return (C.zeros_like(x),) - - return bprop - - def infer_shape(self, data1_shape): - assert len(data1_shape) == 4 - n, c, h, w = data1_shape - c0 = 16 - c1 = c // 16 - shape = (n * h * w, c1 * c0) - return shape - - def infer_dtype(self, data1_dtype): - return data1_dtype diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/fused_abs_max1.py b/example/resnet50_imagenet2012_THOR/cus_ops/fused_abs_max1.py deleted file mode 100644 index b9a0d452738e2beb226436bc75cfe5e8d154b508..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/fused_abs_max1.py +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusFusedAbsMax1""" -from mindspore.ops.op_info_register import op_info_register - - -@op_info_register("""{ - "op_name": "CusFusedAbsMax1", - "imply_type": "TBE", - "fusion_type": "OPAQUE", - "async_flag": false, - "binfile_name": "fusedabsmax1.so", - "compute_cost": 10, - "kernel_name": "CusFusedAbsMax1", - "partial_flag": true, - "attr": [ - { - "name": "origin_shape", - "param_type": "required", - "type": "listInt", - "value": "all" - } - ], - "inputs": [ - { - "index": 0, - "dtype": [ - "float32" - ], - "format": [ - "DefaultFormat" - ], - "name": "x1", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ], - "outputs": [ - { - "index": 0, - "dtype": [ - "float32" - ], - "format": [ - "DefaultFormat" - ], - "name": "y", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ] -}""") -def CusFusedAbsMax1(input_x, output, origin_shape=None, kernel_name="fused_abs_max1"): - """CusFusedAbsMax1""" - return diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/img2col_impl.py b/example/resnet50_imagenet2012_THOR/cus_ops/img2col_impl.py deleted file mode 100644 index 5137d4d7e70949bb91f9c78c7582c65f1fe99d5c..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/img2col_impl.py +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusImg2ColNC1HWC0""" -from mindspore.ops.op_info_register import op_info_register - - -@op_info_register("""{ - "op_name": "CusImg2ColNC1HWC0", - "imply_type": "TBE", - "fusion_type": "OPAQUE", - "async_flag": false, - "binfile_name": "img2colnc1hwc0.so", - "compute_cost": 10, - "kernel_name": "CusImg2ColNC1HWC0", - "partial_flag": true, - "attr": [ - { - "name": "ksizes", - "param_type": "required", - "type": "listInt", - "value": "all" - }, - { - "name": "strides", - "param_type": "required", - "type": "listInt", - "value": "all" - }, - { - "name": "dilates", - "param_type": "required", - "type": "listInt", - "value": "all" - }, - { - "name": "padding", - "param_type": "required", - "type": "str", - "value": "all" - } - ], - "inputs": [ - { - "index": 0, - "dtype": [ - "float16" - ], - "format": [ - "NC1HWC0" - ], - "name": "x1", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ], - "outputs": [ - { - "index": 0, - "dtype": [ - "float16" - ], - "format": [ - "FRACTAL_NZ" - ], - "name": "y", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ] -}""") -def CusImg2ColNC1HWC0(input_x, output, ksizes, strides, dilates, padding, kernel_name="img2col"): - """CusImg2ColNC1HWC0""" - return diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_dense_left.py b/example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_dense_left.py deleted file mode 100644 index 91c5336aa0c6834a61216a60d0a3f2cd1adeadf9..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_dense_left.py +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env python -# -*- coding:utf-8 -*- -""" -copyright 2020 Huawei Technologies Co., Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License == distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -matmul -""" -from __future__ import absolute_import - -from mindspore.ops.op_info_register import op_info_register -from topi.cce import util - -# General limitation of the size for input shape: 2**31 -SHAPE_SIZE_LIMIT = 2147483648 -NoneType = type(None) - - -@op_info_register("""{ - "op_name": "CusMatMulCubeDenseLeft", - "imply_type": "TBE", - "fusion_type": "OPAQUE", - "async_flag": false, - "binfile_name": "matmulcubedenseleft.so", - "compute_cost": 10, - "kernel_name": "CusMatMulCubeDenseLeft", - "partial_flag": true, - "attr": [ - ], - "inputs": [ - { - "index": 0, - "dtype": [ - "float16" - ], - "format": [ - "DefaultFormat" - ], - "name": "x1", - "need_compile": false, - "param_type": "required", - "shape": "all" - }, - { - "index": 1, - "dtype": [ - "float16" - ], - "format": [ - "FRACTAL_NZ" - ], - "name": "x2", - "need_compile": false, - "param_type": "required", - "shape": "all" - }, - { - "index": 2, - "dtype": [ - "float16" - ], - "format": [ - "DefaultFormat" - ], - "name": "x3", - "need_compile": false, - "param_type": "optional", - "shape": "all" - } - ], - "outputs": [ - { - "index": 0, - "dtype": [ - "float16" - ], - "format": [ - "FRACTAL_NZ" - ], - "name": "y", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ] -}""") -@util.check_input_type(dict, dict, (dict, NoneType), dict, bool, bool, str) -def CusMatMulCubeDenseLeft(input_x1, input_x2, bias=None, output_y={}, trans_a=False, trans_b=False, - kernel_name="matmulcube"): - """CusMatMulCubeDenseLeft""" - return diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_fracz_left_cast_impl.py b/example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_fracz_left_cast_impl.py deleted file mode 100644 index de2cca10779b5de4991e03b39d1e675e98d4d411..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_fracz_left_cast_impl.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python -# -*- coding:utf-8 -*- -""" -copyright 2020 Huawei Technologies Co., Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License == distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -matmul -""" -from __future__ import absolute_import - -from mindspore.ops.op_info_register import op_info_register -from topi.cce import util - -# General limitation of the size for input shape: 2**31 -SHAPE_SIZE_LIMIT = 2147483648 -NoneType = type(None) - - -@op_info_register("""{ - "op_name": "CusMatMulCubeFraczLeftCast", - "imply_type": "TBE", - "fusion_type": "OPAQUE", - "async_flag": false, - "binfile_name": "matmulcubefraczleftcast.so", - "compute_cost": 10, - "kernel_name": "CusMatMulCubeFraczLeftCast", - "partial_flag": true, - "attr": [ - ], - "inputs": [ - { - "index": 0, - "dtype": [ - "float16" - ], - "format": [ - "DefaultFormat" - ], - "name": "x1", - "need_compile": false, - "param_type": "required", - "shape": "all" - }, - { - "index": 1, - "dtype": [ - "float32" - ], - "format": [ - "FracZ" - ], - "name": "x2", - "need_compile": false, - "param_type": "required", - "shape": "all" - }, - { - "index": 2, - "dtype": [ - "float16" - ], - "format": [ - "DefaultFormat" - ], - "name": "x3", - "need_compile": false, - "param_type": "optional", - "shape": "all" - } - ], - "outputs": [ - { - "index": 0, - "dtype": [ - "float16" - ], - "format": [ - "FracZ" - ], - "name": "y", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ] -}""") -# pylint: disable=locally-disabled,too-many-arguments, too-many-locals, too-many-statements -@util.check_input_type(dict, dict, (dict, NoneType), dict, bool, bool, str) -def CusMatMulCubeFraczLeftCast(input_x1, input_x2, bias=None, output_y={}, trans_a=False, trans_b=False, - kernel_name="CusMatMulCubeFraczLeftCast"): - """CusMatMulCubeFraczLeftCast""" - return diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_fracz_right_mul_impl.py b/example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_fracz_right_mul_impl.py deleted file mode 100644 index 7fc2ba35d164e8d637a8ae1cd8226170bf95702a..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_fracz_right_mul_impl.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env python -# -*- coding:utf-8 -*- -""" -copyright 2020 Huawei Technologies Co., Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License == distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -matmul -""" -from __future__ import absolute_import - -from mindspore.ops.op_info_register import op_info_register - -# General limitation of the size for input shape: 2**31 -SHAPE_SIZE_LIMIT = 2147483648 -NoneType = type(None) - - -@op_info_register("""{ - "op_name": "CusMatMulCubeFraczRightMul", - "imply_type": "TBE", - "fusion_type": "OPAQUE", - "async_flag": false, - "binfile_name": "matmulcubefraczrightmul.so", - "compute_cost": 10, - "kernel_name": "CusMatMulCubeFraczRightMul", - "partial_flag": true, - "attr": [ - ], - "inputs": [ - { - "index": 0, - "dtype": [ - "float16" - ], - "format": [ - "FracZ" - ], - "name": "x1", - "need_compile": false, - "param_type": "required", - "shape": "all" - }, - { - "index": 1, - "dtype": [ - "float16" - ], - "format": [ - "DefaultFormat" - ], - "name": "x2", - "need_compile": false, - "param_type": "required", - "shape": "all" - }, - { - "index": 2, - "dtype": [ - "float32" - ], - "format": [ - "DefaultFormat" - ], - "name": "x3", - "need_compile": false, - "param_type": "required", - "shape": "all" - }, - { - "index": 3, - "dtype": [ - "float16" - ], - "format": [ - "DefaultFormat" - ], - "name": "x4", - "need_compile": false, - "param_type": "optional", - "shape": "all" - } - ], - "outputs": [ - { - "index": 0, - "dtype": [ - "float32" - ], - "format": [ - "FracZ" - ], - "name": "y", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ] -}""") -def CusMatMulCubeFraczRightMul(input_x1, input_x2, input_x3, bias=None, output_y={}, trans_a=False, trans_b=False, - kernel_name="matmulcube"): - """CusMatMulCubeFraczRightMul""" - return diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_impl.py b/example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_impl.py deleted file mode 100644 index 7c2d81e1d67d0c81c2c432628725dc5190c1dbce..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_impl.py +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python -# -*- coding:utf-8 -*- -""" -copyright 2020 Huawei Technologies Co., Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License == distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -matmul -""" -from __future__ import absolute_import - -from mindspore.ops.op_info_register import op_info_register -from topi.cce import util - -# General limitation of the size for input shape: 2**31 -SHAPE_SIZE_LIMIT = 2147483648 -NoneType = type(None) - - -@op_info_register("""{ - "op_name": "CusMatMulCube", - "imply_type": "TBE", - "fusion_type": "OPAQUE", - "async_flag": false, - "binfile_name": "matmulcube.so", - "compute_cost": 10, - "kernel_name": "CusMatMulCube", - "partial_flag": true, - "attr": [ - { - "name": "transpose_a", - "param_type": "required", - "type": "bool", - "value": "all" - }, - { - "name": "transpose_b", - "param_type": "required", - "type": "bool", - "value": "all" - } - ], - "inputs": [ - { - "index": 0, - "dtype": [ - "float16" - ], - "format": [ - "FRACTAL_NZ" - ], - "name": "x1", - "need_compile": false, - "param_type": "required", - "shape": "all" - }, - { - "index": 1, - "dtype": [ - "float16" - ], - "format": [ - "FRACTAL_NZ" - ], - "name": "x2", - "need_compile": false, - "param_type": "required", - "shape": "all" - }, - { - "index": 2, - "dtype": [ - "float16" - ], - "format": [ - "DefaultFormat" - ], - "name": "x3", - "need_compile": false, - "param_type": "optional", - "shape": "all" - } - ], - "outputs": [ - { - "index": 0, - "dtype": [ - "float32" - ], - "format": [ - "FRACTAL_NZ" - ], - "name": "y", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ] -}""") -# pylint: disable=locally-disabled,too-many-arguments, too-many-locals, too-many-statements -@util.check_input_type(dict, dict, (dict, NoneType), dict, bool, bool, str) -def CusMatMulCube(input_x1, input_x2, bias=None, output_y={}, trans_a=False, trans_b=False, kernel_name="matmulcube"): - """CusMatMulCube""" - return diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/matrix_combine_impl.py b/example/resnet50_imagenet2012_THOR/cus_ops/matrix_combine_impl.py deleted file mode 100644 index 32045e7ccbd4406019dd4ac971e7c51b1877e4fd..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/matrix_combine_impl.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusMatrixCombine""" -from mindspore.ops.op_info_register import op_info_register - - -@op_info_register("""{ - "op_name": "CusMatrixCombine", - "imply_type": "TBE", - "fusion_type": "OPAQUE", - "async_flag": false, - "binfile_name": "matrixcombine.so", - "compute_cost": 10, - "kernel_name": "CusMatrixCombine", - "partial_flag": true, - "attr": [ - ], - "inputs": [ - { - "index": 0, - "dtype": [ - "float32" - ], - "format": [ - "DefaultFormat" - ], - "name": "x1", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ], - "outputs": [ - { - "index": 0, - "dtype": [ - "float32" - ], - "format": [ - "DefaultFormat" - ], - "name": "y", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ] -}""") -def CusMatrixCombine(input_x, output, kernel_name="matrix_combine"): - """CusMatrixCombine""" - return diff --git a/example/resnet50_imagenet2012_THOR/cus_ops/transpose02314_impl.py b/example/resnet50_imagenet2012_THOR/cus_ops/transpose02314_impl.py deleted file mode 100644 index c5aebe523d5199be47df10c7f5e83973c638430c..0000000000000000000000000000000000000000 --- a/example/resnet50_imagenet2012_THOR/cus_ops/transpose02314_impl.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""CusTranspose02314""" -from mindspore.ops.op_info_register import op_info_register - - -@op_info_register("""{ - "op_name": "CusTranspose02314", - "imply_type": "TBE", - "fusion_type": "OPAQUE", - "async_flag": false, - "binfile_name": "transpose02314.so", - "compute_cost": 10, - "kernel_name": "CusTranspose02314", - "partial_flag": true, - "attr": [ - ], - "inputs": [ - { - "index": 0, - "dtype": [ - "float16" - ], - "format": [ - "NC1HWC0" - ], - "name": "x1", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ], - "outputs": [ - { - "index": 0, - "dtype": [ - "float16" - ], - "format": [ - "DefaultFormat" - ], - "name": "y", - "need_compile": false, - "param_type": "required", - "shape": "all" - } - ] -}""") -def CusTranspose02314(input_x, output, kernel_name="transpose021354"): - """CusTranspose02314""" - return