已合并
算子插件迁移 #8474
welt_lester创建于 8月10日
算子插件迁移 #8474
已合并
共 13 个文件变更+750-750
| @@ -1,44 +1,44 @@ | |||
| 1 | -/** | 1 | +/** |
| 2 | - * Copyright (c) 2025 Huawei Technologies Co., Ltd. | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | - */ | 9 | + */ |
| 10 | - | 10 | + |
| 11 | -#include "onnx_common.h" | 11 | +#include "onnx_common.h" |
| 12 | - | 12 | + |
| 13 | -namespace domi { | 13 | +namespace domi { |
| 14 | -using NodeProto = ge::onnx::NodeProto; | 14 | +using NodeProto = ge::onnx::NodeProto; |
| 15 | -static Status ParseParamsCelu(const Message* op_src, ge::Operator& op_dest) | 15 | +static Status ParseParamsCelu(const Message* op_src, ge::Operator& op_dest) |
| 16 | -{ | 16 | +{ |
| 17 | - const NodeProto* node = reinterpret_cast<const NodeProto*>(op_src); | 17 | + const NodeProto* node = reinterpret_cast<const NodeProto*>(op_src); |
| 18 | - if (node == nullptr) { | 18 | + if (node == nullptr) { |
| 19 | - OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); | 19 | + OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); |
| 20 | - return FAILED; | 20 | + return FAILED; |
| 21 | - } | 21 | + } |
| 22 | - float alpha_value = 1.0; | 22 | + float alpha_value = 1.0; |
| 23 | - op_dest.SetAttr("alpha", alpha_value); | 23 | + op_dest.SetAttr("alpha", alpha_value); |
| 24 | - for (const auto& attr : node->attribute()) { | 24 | + for (const auto& attr : node->attribute()) { |
| 25 | - if (attr.name() == "alpha" && attr.type() == ge::onnx::AttributeProto::FLOAT) { | 25 | + if (attr.name() == "alpha" && attr.type() == ge::onnx::AttributeProto::FLOAT) { |
| 26 | - alpha_value = attr.f(); | 26 | + alpha_value = attr.f(); |
| 27 | - op_dest.SetAttr("alpha1", alpha_value); | 27 | + op_dest.SetAttr("alpha1", alpha_value); |
| 28 | - op_dest.SetAttr("alpha2", alpha_value); | 28 | + op_dest.SetAttr("alpha2", alpha_value); |
| 29 | - } | 29 | + } |
| 30 | - } | 30 | + } |
| 31 | - return SUCCESS; | 31 | + return SUCCESS; |
| 32 | -} | 32 | +} |
| 33 | -// register Celu op info to GE | 33 | +// register Celu op info to GE |
| 34 | -REGISTER_CUSTOM_OP("Celu") | 34 | +REGISTER_CUSTOM_OP("Celu") |
| 35 | - .FrameworkType(ONNX) | 35 | + .FrameworkType(ONNX) |
| 36 | - .OriginOpType({ge::AscendString("ai.onnx::8::Celu"), ge::AscendString("ai.onnx::9::Celu"), | 36 | + .OriginOpType({ge::AscendString("ai.onnx::8::Celu"), ge::AscendString("ai.onnx::9::Celu"), |
| 37 | - ge::AscendString("ai.onnx::10::Celu"), ge::AscendString("ai.onnx::11::Celu"), | 37 | + ge::AscendString("ai.onnx::10::Celu"), ge::AscendString("ai.onnx::11::Celu"), |
| 38 | - ge::AscendString("ai.onnx::12::Celu"), ge::AscendString("ai.onnx::13::Celu"), | 38 | + ge::AscendString("ai.onnx::12::Celu"), ge::AscendString("ai.onnx::13::Celu"), |
| 39 | - ge::AscendString("ai.onnx::14::Celu"), ge::AscendString("ai.onnx::15::Celu"), | 39 | + ge::AscendString("ai.onnx::14::Celu"), ge::AscendString("ai.onnx::15::Celu"), |
| 40 | - ge::AscendString("ai.onnx::16::Celu"), ge::AscendString("ai.onnx::17::Celu"), | 40 | + ge::AscendString("ai.onnx::16::Celu"), ge::AscendString("ai.onnx::17::Celu"), |
| 41 | - ge::AscendString("ai.onnx::18::Celu")}) | 41 | + ge::AscendString("ai.onnx::18::Celu")}) |
| 42 | - .ParseParamsFn(ParseParamsCelu) | 42 | + .ParseParamsFn(ParseParamsCelu) |
| 43 | - .ImplyType(ImplyType::TVM); | 43 | + .ImplyType(ImplyType::TVM); |
| 44 | -} // namespace domi | 44 | +} // namespace domi |
Rcommon/src/framework/logsoftmax_onnx_plugin.cpp→activation/log_softmax_v2/framework/logsoftmax_onnx_plugin.cpp+44-44
| @@ -1,44 +1,44 @@ | |||
| 1 | -/** | 1 | +/** |
| 2 | - * Copyright (c) 2025 Huawei Technologies Co., Ltd. | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | - */ | 9 | + */ |
| 10 | - | 10 | + |
| 11 | -#include "onnx_common.h" | 11 | +#include "onnx_common.h" |
| 12 | - | 12 | + |
| 13 | -namespace domi { | 13 | +namespace domi { |
| 14 | -using NodeProto = ge::onnx::NodeProto; | 14 | +using NodeProto = ge::onnx::NodeProto; |
| 15 | -using OpDesc = std::shared_ptr<ge::OpDesc>; | 15 | +using OpDesc = std::shared_ptr<ge::OpDesc>; |
| 16 | -static Status ParseParamsLogSoftmax(const Message* op_src, ge::Operator& op_dest) | 16 | +static Status ParseParamsLogSoftmax(const Message* op_src, ge::Operator& op_dest) |
| 17 | -{ | 17 | +{ |
| 18 | - const NodeProto* node = dynamic_cast<const NodeProto*>(op_src); | 18 | + const NodeProto* node = dynamic_cast<const NodeProto*>(op_src); |
| 19 | - if (node == nullptr) { | 19 | + if (node == nullptr) { |
| 20 | - OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); | 20 | + OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); |
| 21 | - return FAILED; | 21 | + return FAILED; |
| 22 | - } | 22 | + } |
| 23 | - int axis = -1; | 23 | + int axis = -1; |
| 24 | - for (auto attr : node->attribute()) { | 24 | + for (auto attr : node->attribute()) { |
| 25 | - if (attr.name() == "axis" && attr.type() == ge::onnx::AttributeProto::INT) { | 25 | + if (attr.name() == "axis" && attr.type() == ge::onnx::AttributeProto::INT) { |
| 26 | - axis = attr.i(); | 26 | + axis = attr.i(); |
| 27 | - } | 27 | + } |
| 28 | - } | 28 | + } |
| 29 | - std::vector<int> axes(1, axis); | 29 | + std::vector<int> axes(1, axis); |
| 30 | - op_dest.SetAttr("axes", axes); | 30 | + op_dest.SetAttr("axes", axes); |
| 31 | - return SUCCESS; | 31 | + return SUCCESS; |
| 32 | -} | 32 | +} |
| 33 | - | 33 | + |
| 34 | -REGISTER_CUSTOM_OP("LogSoftmaxV2") | 34 | +REGISTER_CUSTOM_OP("LogSoftmaxV2") |
| 35 | - .FrameworkType(ONNX) | 35 | + .FrameworkType(ONNX) |
| 36 | - .OriginOpType({ge::AscendString("ai.onnx::8::LogSoftmax"), ge::AscendString("ai.onnx::9::LogSoftmax"), | 36 | + .OriginOpType({ge::AscendString("ai.onnx::8::LogSoftmax"), ge::AscendString("ai.onnx::9::LogSoftmax"), |
| 37 | - ge::AscendString("ai.onnx::10::LogSoftmax"), ge::AscendString("ai.onnx::11::LogSoftmax"), | 37 | + ge::AscendString("ai.onnx::10::LogSoftmax"), ge::AscendString("ai.onnx::11::LogSoftmax"), |
| 38 | - ge::AscendString("ai.onnx::12::LogSoftmax"), ge::AscendString("ai.onnx::13::LogSoftmax"), | 38 | + ge::AscendString("ai.onnx::12::LogSoftmax"), ge::AscendString("ai.onnx::13::LogSoftmax"), |
| 39 | - ge::AscendString("ai.onnx::14::LogSoftmax"), ge::AscendString("ai.onnx::15::LogSoftmax"), | 39 | + ge::AscendString("ai.onnx::14::LogSoftmax"), ge::AscendString("ai.onnx::15::LogSoftmax"), |
| 40 | - ge::AscendString("ai.onnx::16::LogSoftmax"), ge::AscendString("ai.onnx::17::LogSoftmax"), | 40 | + ge::AscendString("ai.onnx::16::LogSoftmax"), ge::AscendString("ai.onnx::17::LogSoftmax"), |
| 41 | - ge::AscendString("ai.onnx::18::LogSoftmax")}) | 41 | + ge::AscendString("ai.onnx::18::LogSoftmax")}) |
| 42 | - .ParseParamsFn(ParseParamsLogSoftmax) | 42 | + .ParseParamsFn(ParseParamsLogSoftmax) |
| 43 | - .ImplyType(ImplyType::TVM); | 43 | + .ImplyType(ImplyType::TVM); |
| 44 | -} // namespace domi | 44 | +} // namespace domi |
Rcommon/src/framework/unique_onnx_plugin.cpp→index/unique_with_counts_and_sorting/framework/unique_onnx_plugin.cpp+0-0
文件重命名但无更改。
Rcommon/src/framework/batch_matmul_onnx_plugin.cpp→matmul/batch_mat_mul_v3/framework/batch_matmul_onnx_plugin.cpp+37-37
| @@ -1,37 +1,37 @@ | |||
| 1 | -/** | 1 | +/** |
| 2 | - * Copyright (c) 2025 Huawei Technologies Co., Ltd. | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | - */ | 9 | + */ |
| 10 | - | 10 | + |
| 11 | -#include "onnx_common.h" | 11 | +#include "onnx_common.h" |
| 12 | - | 12 | + |
| 13 | -namespace domi { | 13 | +namespace domi { |
| 14 | -using NodeProto = ge::onnx::NodeProto; | 14 | +using NodeProto = ge::onnx::NodeProto; |
| 15 | -static Status ParseParamsBatchMatMul(const Message* opSrc, ge::Operator& opDst) | 15 | +static Status ParseParamsBatchMatMul(const Message* opSrc, ge::Operator& opDst) |
| 16 | -{ | 16 | +{ |
| 17 | - const NodeProto* node = reinterpret_cast<const NodeProto*>(opSrc); | 17 | + const NodeProto* node = reinterpret_cast<const NodeProto*>(opSrc); |
| 18 | - if (node == nullptr) { | 18 | + if (node == nullptr) { |
| 19 | - OP_LOGE(GetOpName(opDst).c_str(), "Dynamic cast opSrc to NodeProto failed."); | 19 | + OP_LOGE(GetOpName(opDst).c_str(), "Dynamic cast opSrc to NodeProto failed."); |
| 20 | - return FAILED; | 20 | + return FAILED; |
| 21 | - } | 21 | + } |
| 22 | - // onnx doesn't have transpose attr | 22 | + // onnx doesn't have transpose attr |
| 23 | - opDst.SetAttr("adj_x1", false); | 23 | + opDst.SetAttr("adj_x1", false); |
| 24 | - opDst.SetAttr("adj_x2", false); | 24 | + opDst.SetAttr("adj_x2", false); |
| 25 | - return SUCCESS; | 25 | + return SUCCESS; |
| 26 | -} | 26 | +} |
| 27 | - | 27 | + |
| 28 | -REGISTER_CUSTOM_OP("BatchMatMul") | 28 | +REGISTER_CUSTOM_OP("BatchMatMul") |
| 29 | - .FrameworkType(ONNX) | 29 | + .FrameworkType(ONNX) |
| 30 | - .OriginOpType({ge::AscendString("ai.onnx::8::BatchMatMul"), ge::AscendString("ai.onnx::9::BatchMatMul"), | 30 | + .OriginOpType({ge::AscendString("ai.onnx::8::BatchMatMul"), ge::AscendString("ai.onnx::9::BatchMatMul"), |
| 31 | - ge::AscendString("ai.onnx::10::BatchMatMul"), ge::AscendString("ai.onnx::11::BatchMatMul"), | 31 | + ge::AscendString("ai.onnx::10::BatchMatMul"), ge::AscendString("ai.onnx::11::BatchMatMul"), |
| 32 | - ge::AscendString("ai.onnx::12::BatchMatMul"), ge::AscendString("ai.onnx::13::BatchMatMul"), | 32 | + ge::AscendString("ai.onnx::12::BatchMatMul"), ge::AscendString("ai.onnx::13::BatchMatMul"), |
| 33 | - ge::AscendString("ai.onnx::14::BatchMatMul"), ge::AscendString("ai.onnx::15::BatchMatMul"), | 33 | + ge::AscendString("ai.onnx::14::BatchMatMul"), ge::AscendString("ai.onnx::15::BatchMatMul"), |
| 34 | - ge::AscendString("ai.onnx::16::BatchMatMul")}) | 34 | + ge::AscendString("ai.onnx::16::BatchMatMul")}) |
| 35 | - .ParseParamsFn(ParseParamsBatchMatMul) | 35 | + .ParseParamsFn(ParseParamsBatchMatMul) |
| 36 | - .ImplyType(ImplyType::TVM); | 36 | + .ImplyType(ImplyType::TVM); |
| 37 | -} // namespace domi | 37 | +} // namespace domi |
Rcommon/src/framework/matmul_onnx_plugin.cpp→matmul/mat_mul_v3/framework/matmul_onnx_plugin.cpp+67-67
| @@ -1,67 +1,67 @@ | |||
| 1 | -/** | 1 | +/** |
| 2 | - * Copyright (c) 2025 Huawei Technologies Co., Ltd. | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | - */ | 9 | + */ |
| 10 | - | 10 | + |
| 11 | -#include "onnx_common.h" | 11 | +#include "onnx_common.h" |
| 12 | - | 12 | + |
| 13 | -namespace domi { | 13 | +namespace domi { |
| 14 | -using NodeProto = ge::onnx::NodeProto; | 14 | +using NodeProto = ge::onnx::NodeProto; |
| 15 | -static Status ParseParamsMatMul(const Message* op_src, ge::Operator& op_dest) | 15 | +static Status ParseParamsMatMul(const Message* op_src, ge::Operator& op_dest) |
| 16 | -{ | 16 | +{ |
| 17 | - ge::AscendString op_name; | 17 | + ge::AscendString op_name; |
| 18 | - if (op_dest.GetName(op_name) != ge::GRAPH_SUCCESS) { | 18 | + if (op_dest.GetName(op_name) != ge::GRAPH_SUCCESS) { |
| 19 | - OP_LOGE("", "failed to get op_name"); | 19 | + OP_LOGE("", "failed to get op_name"); |
| 20 | - return FAILED; | 20 | + return FAILED; |
| 21 | - } | 21 | + } |
| 22 | - const NodeProto* node = dynamic_cast<const NodeProto*>(op_src); | 22 | + const NodeProto* node = dynamic_cast<const NodeProto*>(op_src); |
| 23 | - if (node == nullptr) { | 23 | + if (node == nullptr) { |
| 24 | - OP_LOGE(op_name.GetString(), "Dynamic cast op_src to NodeProto failed."); | 24 | + OP_LOGE(op_name.GetString(), "Dynamic cast op_src to NodeProto failed."); |
| 25 | - return FAILED; | 25 | + return FAILED; |
| 26 | - } | 26 | + } |
| 27 | - // add the attr to support the custom matmul transpose fusion | 27 | + // add the attr to support the custom matmul transpose fusion |
| 28 | - bool trans_a = false; | 28 | + bool trans_a = false; |
| 29 | - bool trans_b = false; | 29 | + bool trans_b = false; |
| 30 | - int64_t fixed_shift_value = 42; | 30 | + int64_t fixed_shift_value = 42; |
| 31 | - for (const auto& attr : node->attribute()) { | 31 | + for (const auto& attr : node->attribute()) { |
| 32 | - if (attr.name() == "transA" && attr.i() != 0) { | 32 | + if (attr.name() == "transA" && attr.i() != 0) { |
| 33 | - trans_a = true; | 33 | + trans_a = true; |
| 34 | - } | 34 | + } |
| 35 | - if (attr.name() == "transB" && attr.i() != 0) { | 35 | + if (attr.name() == "transB" && attr.i() != 0) { |
| 36 | - trans_b = true; | 36 | + trans_b = true; |
| 37 | - } | 37 | + } |
| 38 | - if (attr.name() == "fixed_shift_value" && attr.i() != 0) { | 38 | + if (attr.name() == "fixed_shift_value" && attr.i() != 0) { |
| 39 | - fixed_shift_value = attr.i(); | 39 | + fixed_shift_value = attr.i(); |
| 40 | - } | 40 | + } |
| 41 | - } | 41 | + } |
| 42 | - | 42 | + |
| 43 | - int64_t enable_uncache = GetEnableUncacheFromNode(node); | 43 | + int64_t enable_uncache = GetEnableUncacheFromNode(node); |
| 44 | - | 44 | + |
| 45 | - op_dest.SetAttr("enable_uncache", enable_uncache); | 45 | + op_dest.SetAttr("enable_uncache", enable_uncache); |
| 46 | - op_dest.SetAttr("adj_x1", trans_a); | 46 | + op_dest.SetAttr("adj_x1", trans_a); |
| 47 | - op_dest.SetAttr("adj_x2", trans_b); | 47 | + op_dest.SetAttr("adj_x2", trans_b); |
| 48 | - op_dest.SetAttr("fixed_shift_value", fixed_shift_value); | 48 | + op_dest.SetAttr("fixed_shift_value", fixed_shift_value); |
| 49 | - if (ChangeFormatFromOnnx(op_dest, 0, ge::FORMAT_NCHW, false) != SUCCESS) { | 49 | + if (ChangeFormatFromOnnx(op_dest, 0, ge::FORMAT_NCHW, false) != SUCCESS) { |
| 50 | - OP_LOGE(op_name.GetString(), "failed to change format."); | 50 | + OP_LOGE(op_name.GetString(), "failed to change format."); |
| 51 | - return FAILED; | 51 | + return FAILED; |
| 52 | - } | 52 | + } |
| 53 | - return SUCCESS; | 53 | + return SUCCESS; |
| 54 | -} | 54 | +} |
| 55 | - | 55 | + |
| 56 | -// register MatMul op info to GE | 56 | +// register MatMul op info to GE |
| 57 | -REGISTER_CUSTOM_OP("BatchMatMulV2") | 57 | +REGISTER_CUSTOM_OP("BatchMatMulV2") |
| 58 | - .FrameworkType(ONNX) | 58 | + .FrameworkType(ONNX) |
| 59 | - .OriginOpType({ge::AscendString("ai.onnx::8::MatMul"), ge::AscendString("ai.onnx::9::MatMul"), | 59 | + .OriginOpType({ge::AscendString("ai.onnx::8::MatMul"), ge::AscendString("ai.onnx::9::MatMul"), |
| 60 | - ge::AscendString("ai.onnx::10::MatMul"), ge::AscendString("ai.onnx::11::MatMul"), | 60 | + ge::AscendString("ai.onnx::10::MatMul"), ge::AscendString("ai.onnx::11::MatMul"), |
| 61 | - ge::AscendString("ai.onnx::12::MatMul"), ge::AscendString("ai.onnx::13::MatMul"), | 61 | + ge::AscendString("ai.onnx::12::MatMul"), ge::AscendString("ai.onnx::13::MatMul"), |
| 62 | - ge::AscendString("ai.onnx::14::MatMul"), ge::AscendString("ai.onnx::15::MatMul"), | 62 | + ge::AscendString("ai.onnx::14::MatMul"), ge::AscendString("ai.onnx::15::MatMul"), |
| 63 | - ge::AscendString("ai.onnx::16::MatMul"), ge::AscendString("ai.onnx::17::MatMul"), | 63 | + ge::AscendString("ai.onnx::16::MatMul"), ge::AscendString("ai.onnx::17::MatMul"), |
| 64 | - ge::AscendString("ai.onnx::18::MatMul")}) | 64 | + ge::AscendString("ai.onnx::18::MatMul")}) |
| 65 | - .ParseParamsFn(ParseParamsMatMul) | 65 | + .ParseParamsFn(ParseParamsMatMul) |
| 66 | - .ImplyType(ImplyType::TVM); | 66 | + .ImplyType(ImplyType::TVM); |
| 67 | -} // namespace domi | 67 | +} // namespace domi |
Rcommon/src/framework/batch_normalization_onnx_plugin.cpp→norm/batch_norm/framework/batch_normalization_onnx_plugin.cpp+64-64
| @@ -1,64 +1,64 @@ | |||
| 1 | -/** | 1 | +/** |
| 2 | - * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd. | 2 | + * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | - */ | 9 | + */ |
| 10 | - | 10 | + |
| 11 | -/*! | 11 | +/*! |
| 12 | - * \file batch_normalization_plugin.cpp | 12 | + * \file batch_normalization_plugin.cpp |
| 13 | - * \brief | 13 | + * \brief |
| 14 | - */ | 14 | + */ |
| 15 | -#include "onnx_common.h" | 15 | +#include "onnx_common.h" |
| 16 | - | 16 | + |
| 17 | -namespace domi { | 17 | +namespace domi { |
| 18 | - | 18 | + |
| 19 | -static Status ParseParamsBatchNorm(const Message* op_src, ge::Operator& op_dest) | 19 | +static Status ParseParamsBatchNorm(const Message* op_src, ge::Operator& op_dest) |
| 20 | -{ | 20 | +{ |
| 21 | - const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); | 21 | + const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); |
| 22 | - if (node == nullptr) { | 22 | + if (node == nullptr) { |
| 23 | - OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); | 23 | + OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); |
| 24 | - return FAILED; | 24 | + return FAILED; |
| 25 | - } | 25 | + } |
| 26 | - | 26 | + |
| 27 | - float epsilon = 0.00001; | 27 | + float epsilon = 0.00001; |
| 28 | - for (const auto& attr : node->attribute()) { | 28 | + for (const auto& attr : node->attribute()) { |
| 29 | - if (attr.name() == "epsilon" && attr.type() == ge::onnx::AttributeProto::FLOAT) { | 29 | + if (attr.name() == "epsilon" && attr.type() == ge::onnx::AttributeProto::FLOAT) { |
| 30 | - epsilon = attr.f(); | 30 | + epsilon = attr.f(); |
| 31 | - break; | 31 | + break; |
| 32 | - } | 32 | + } |
| 33 | - } | 33 | + } |
| 34 | - op_dest.SetAttr("epsilon", epsilon); | 34 | + op_dest.SetAttr("epsilon", epsilon); |
| 35 | - | 35 | + |
| 36 | - const std::string data_format = "NCHW"; | 36 | + const std::string data_format = "NCHW"; |
| 37 | - op_dest.SetAttr("data_format", data_format); | 37 | + op_dest.SetAttr("data_format", data_format); |
| 38 | - | 38 | + |
| 39 | - int64_t training_mode = 0; | 39 | + int64_t training_mode = 0; |
| 40 | - for (const auto& attr : node->attribute()) { | 40 | + for (const auto& attr : node->attribute()) { |
| 41 | - if (attr.name() == "training_mode" && attr.type() == ge::onnx::AttributeProto::INT) { | 41 | + if (attr.name() == "training_mode" && attr.type() == ge::onnx::AttributeProto::INT) { |
| 42 | - training_mode = attr.i(); | 42 | + training_mode = attr.i(); |
| 43 | - break; | 43 | + break; |
| 44 | - } | 44 | + } |
| 45 | - } | 45 | + } |
| 46 | - bool is_training = training_mode == 1; | 46 | + bool is_training = training_mode == 1; |
| 47 | - op_dest.SetAttr("is_training", is_training); | 47 | + op_dest.SetAttr("is_training", is_training); |
| 48 | - op_dest.SetAttr("onnx", "onnx"); | 48 | + op_dest.SetAttr("onnx", "onnx"); |
| 49 | - return SUCCESS; | 49 | + return SUCCESS; |
| 50 | -} | 50 | +} |
| 51 | - | 51 | + |
| 52 | -// register ReduceMean op info to GE | 52 | +// register ReduceMean op info to GE |
| 53 | -REGISTER_CUSTOM_OP("BatchNorm") | 53 | +REGISTER_CUSTOM_OP("BatchNorm") |
| 54 | - .FrameworkType(ONNX) | 54 | + .FrameworkType(ONNX) |
| 55 | - .OriginOpType( | 55 | + .OriginOpType( |
| 56 | - {ge::AscendString("ai.onnx::8::BatchNormalization"), ge::AscendString("ai.onnx::9::BatchNormalization"), | 56 | + {ge::AscendString("ai.onnx::8::BatchNormalization"), ge::AscendString("ai.onnx::9::BatchNormalization"), |
| 57 | - ge::AscendString("ai.onnx::10::BatchNormalization"), ge::AscendString("ai.onnx::11::BatchNormalization"), | 57 | + ge::AscendString("ai.onnx::10::BatchNormalization"), ge::AscendString("ai.onnx::11::BatchNormalization"), |
| 58 | - ge::AscendString("ai.onnx::12::BatchNormalization"), ge::AscendString("ai.onnx::13::BatchNormalization"), | 58 | + ge::AscendString("ai.onnx::12::BatchNormalization"), ge::AscendString("ai.onnx::13::BatchNormalization"), |
| 59 | - ge::AscendString("ai.onnx::14::BatchNormalization"), ge::AscendString("ai.onnx::15::BatchNormalization"), | 59 | + ge::AscendString("ai.onnx::14::BatchNormalization"), ge::AscendString("ai.onnx::15::BatchNormalization"), |
| 60 | - ge::AscendString("ai.onnx::16::BatchNormalization"), ge::AscendString("ai.onnx::17::BatchNormalization"), | 60 | + ge::AscendString("ai.onnx::16::BatchNormalization"), ge::AscendString("ai.onnx::17::BatchNormalization"), |
| 61 | - ge::AscendString("ai.onnx::18::BatchNormalization")}) | 61 | + ge::AscendString("ai.onnx::18::BatchNormalization")}) |
| 62 | - .ParseParamsFn(ParseParamsBatchNorm) | 62 | + .ParseParamsFn(ParseParamsBatchNorm) |
| 63 | - .ImplyType(ImplyType::TVM); | 63 | + .ImplyType(ImplyType::TVM); |
| 64 | -} // namespace domi | 64 | +} // namespace domi |
Rcommon/src/framework/instancenormalization_onnx_plugin.cpp→norm/instance_norm_v3/framework/instancenormalization_onnx_plugin.cpp+47-47
| @@ -1,48 +1,48 @@ | |||
| 1 | -/** | 1 | +/** |
| 2 | - * Copyright (c) 2025 Huawei Technologies Co., Ltd. | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | - */ | 9 | + */ |
| 10 | - | 10 | + |
| 11 | -#include "onnx_common.h" | 11 | +#include "onnx_common.h" |
| 12 | - | 12 | + |
| 13 | -namespace domi { | 13 | +namespace domi { |
| 14 | -static const float EPSILON_DEFAULT = 1e-05; | 14 | +static const float EPSILON_DEFAULT = 1e-05; |
| 15 | - | 15 | + |
| 16 | -static Status ParseParamsInstanceNormalization(const Message* op_src, ge::Operator& op_dest) | 16 | +static Status ParseParamsInstanceNormalization(const Message* op_src, ge::Operator& op_dest) |
| 17 | -{ | 17 | +{ |
| 18 | - const ge::onnx::NodeProto* node = reinterpret_cast<const ge::onnx::NodeProto*>(op_src); | 18 | + const ge::onnx::NodeProto* node = reinterpret_cast<const ge::onnx::NodeProto*>(op_src); |
| 19 | - if (node == nullptr) { | 19 | + if (node == nullptr) { |
| 20 | - OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); | 20 | + OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); |
| 21 | - return FAILED; | 21 | + return FAILED; |
| 22 | - } | 22 | + } |
| 23 | - | 23 | + |
| 24 | - float epsilon = EPSILON_DEFAULT; | 24 | + float epsilon = EPSILON_DEFAULT; |
| 25 | - | 25 | + |
| 26 | - for (const auto& attr : node->attribute()) { | 26 | + for (const auto& attr : node->attribute()) { |
| 27 | - if (attr.name() == "epsilon" && attr.type() == ge::onnx::AttributeProto::FLOAT) { | 27 | + if (attr.name() == "epsilon" && attr.type() == ge::onnx::AttributeProto::FLOAT) { |
| 28 | - epsilon = attr.f(); | 28 | + epsilon = attr.f(); |
| 29 | - } | 29 | + } |
| 30 | - } | 30 | + } |
| 31 | - op_dest.SetAttr("epsilon", epsilon); | 31 | + op_dest.SetAttr("epsilon", epsilon); |
| 32 | - op_dest.SetAttr("data_format", "NCHW"); | 32 | + op_dest.SetAttr("data_format", "NCHW"); |
| 33 | - | 33 | + |
| 34 | - return SUCCESS; | 34 | + return SUCCESS; |
| 35 | -} | 35 | +} |
| 36 | -// register Add op info to GE | 36 | +// register Add op info to GE |
| 37 | -REGISTER_CUSTOM_OP("InstanceNorm") | 37 | +REGISTER_CUSTOM_OP("InstanceNorm") |
| 38 | - .FrameworkType(ONNX) | 38 | + .FrameworkType(ONNX) |
| 39 | - .OriginOpType( | 39 | + .OriginOpType( |
| 40 | - {ge::AscendString("ai.onnx::8::InstanceNormalization"), ge::AscendString("ai.onnx::9::InstanceNormalization"), | 40 | + {ge::AscendString("ai.onnx::8::InstanceNormalization"), ge::AscendString("ai.onnx::9::InstanceNormalization"), |
| 41 | - ge::AscendString("ai.onnx::10::InstanceNormalization"), ge::AscendString("ai.onnx::11::InstanceNormalization"), | 41 | + ge::AscendString("ai.onnx::10::InstanceNormalization"), ge::AscendString("ai.onnx::11::InstanceNormalization"), |
| 42 | - ge::AscendString("ai.onnx::12::InstanceNormalization"), ge::AscendString("ai.onnx::13::InstanceNormalization"), | 42 | + ge::AscendString("ai.onnx::12::InstanceNormalization"), ge::AscendString("ai.onnx::13::InstanceNormalization"), |
| 43 | - ge::AscendString("ai.onnx::14::InstanceNormalization"), ge::AscendString("ai.onnx::15::InstanceNormalization"), | 43 | + ge::AscendString("ai.onnx::14::InstanceNormalization"), ge::AscendString("ai.onnx::15::InstanceNormalization"), |
| 44 | - ge::AscendString("ai.onnx::16::InstanceNormalization"), ge::AscendString("ai.onnx::17::InstanceNormalization"), | 44 | + ge::AscendString("ai.onnx::16::InstanceNormalization"), ge::AscendString("ai.onnx::17::InstanceNormalization"), |
| 45 | - ge::AscendString("ai.onnx::18::InstanceNormalization")}) | 45 | + ge::AscendString("ai.onnx::18::InstanceNormalization")}) |
| 46 | - .ParseParamsFn(ParseParamsInstanceNormalization) | 46 | + .ParseParamsFn(ParseParamsInstanceNormalization) |
| 47 | - .ImplyType(ImplyType::TVM); | 47 | + .ImplyType(ImplyType::TVM); |
| 48 | } // namespace domi | 48 | } // namespace domi |
Rcommon/src/framework/adaptive_average_pool2d_onnx_plugin.cpp→pooling/adaptive_avg_pool2d/framework/adaptive_average_pool2d_onnx_plugin.cpp+62-62
| @@ -1,62 +1,62 @@ | |||
| 1 | -/** | 1 | +/** |
| 2 | - * Copyright (c) 2025 Huawei Technologies Co., Ltd. | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | - */ | 9 | + */ |
| 10 | - | 10 | + |
| 11 | -/*! | 11 | +/*! |
| 12 | - * \file adaptive_average_pool2d_plugin.cc | 12 | + * \file adaptive_average_pool2d_plugin.cc |
| 13 | - * \brief | 13 | + * \brief |
| 14 | - */ | 14 | + */ |
| 15 | -#include "onnx_common.h" | 15 | +#include "onnx_common.h" |
| 16 | - | 16 | + |
| 17 | -namespace domi { | 17 | +namespace domi { |
| 18 | -static const uint32_t ATTR_LOOP_SIZE = 2; | 18 | +static const uint32_t ATTR_LOOP_SIZE = 2; |
| 19 | - | 19 | + |
| 20 | -static Status ParseParamsAdaptiveAvgPool2d(const Message* op_src, ge::Operator& op_dest) | 20 | +static Status ParseParamsAdaptiveAvgPool2d(const Message* op_src, ge::Operator& op_dest) |
| 21 | -{ | 21 | +{ |
| 22 | - const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); | 22 | + const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); |
| 23 | - if (node == nullptr) { | 23 | + if (node == nullptr) { |
| 24 | - OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); | 24 | + OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); |
| 25 | - return FAILED; | 25 | + return FAILED; |
| 26 | - } | 26 | + } |
| 27 | - std::vector<int> v_output_size = {}; | 27 | + std::vector<int> v_output_size = {}; |
| 28 | - bool set_output_size_flag = false; | 28 | + bool set_output_size_flag = false; |
| 29 | - | 29 | + |
| 30 | - for (const auto& attr : node->attribute()) { | 30 | + for (const auto& attr : node->attribute()) { |
| 31 | - if (attr.name() == "output_size" && attr.type() == ge::onnx::AttributeProto::INTS) { | 31 | + if (attr.name() == "output_size" && attr.type() == ge::onnx::AttributeProto::INTS) { |
| 32 | - if (attr.ints_size() == ATTR_LOOP_SIZE) { | 32 | + if (attr.ints_size() == ATTR_LOOP_SIZE) { |
| 33 | - for (int i = 0; i < attr.ints_size(); i++) { | 33 | + for (int i = 0; i < attr.ints_size(); i++) { |
| 34 | - v_output_size.push_back(attr.ints(i)); | 34 | + v_output_size.push_back(attr.ints(i)); |
| 35 | - } | 35 | + } |
| 36 | - } else { | 36 | + } else { |
| 37 | - OP_LOGE(GetOpName(op_dest).c_str(), "length of output_size must be 2."); | 37 | + OP_LOGE(GetOpName(op_dest).c_str(), "length of output_size must be 2."); |
| 38 | - } | 38 | + } |
| 39 | - set_output_size_flag = true; | 39 | + set_output_size_flag = true; |
| 40 | - } | 40 | + } |
| 41 | - } | 41 | + } |
| 42 | - | 42 | + |
| 43 | - if (set_output_size_flag) { | 43 | + if (set_output_size_flag) { |
| 44 | - op_dest.SetAttr("output_size", v_output_size); | 44 | + op_dest.SetAttr("output_size", v_output_size); |
| 45 | - } else { | 45 | + } else { |
| 46 | - OP_LOGE(GetOpName(op_dest).c_str(), "onnx AdaptiveAvgPool2d op has no output_size attr."); | 46 | + OP_LOGE(GetOpName(op_dest).c_str(), "onnx AdaptiveAvgPool2d op has no output_size attr."); |
| 47 | - } | 47 | + } |
| 48 | - return SUCCESS; | 48 | + return SUCCESS; |
| 49 | -} | 49 | +} |
| 50 | - | 50 | + |
| 51 | -// register AdaptiveMaxPool2d op info to GE | 51 | +// register AdaptiveMaxPool2d op info to GE |
| 52 | -REGISTER_CUSTOM_OP("AdaptiveAvgPool2d") | 52 | +REGISTER_CUSTOM_OP("AdaptiveAvgPool2d") |
| 53 | - .FrameworkType(ONNX) | 53 | + .FrameworkType(ONNX) |
| 54 | - .OriginOpType( | 54 | + .OriginOpType( |
| 55 | - {ge::AscendString("ai.onnx::8::AdaptiveAvgPool2d"), ge::AscendString("ai.onnx::9::AdaptiveAvgPool2d"), | 55 | + {ge::AscendString("ai.onnx::8::AdaptiveAvgPool2d"), ge::AscendString("ai.onnx::9::AdaptiveAvgPool2d"), |
| 56 | - ge::AscendString("ai.onnx::10::AdaptiveAvgPool2d"), ge::AscendString("ai.onnx::11::AdaptiveAvgPool2d"), | 56 | + ge::AscendString("ai.onnx::10::AdaptiveAvgPool2d"), ge::AscendString("ai.onnx::11::AdaptiveAvgPool2d"), |
| 57 | - ge::AscendString("ai.onnx::12::AdaptiveAvgPool2d"), ge::AscendString("ai.onnx::13::AdaptiveAvgPool2d"), | 57 | + ge::AscendString("ai.onnx::12::AdaptiveAvgPool2d"), ge::AscendString("ai.onnx::13::AdaptiveAvgPool2d"), |
| 58 | - ge::AscendString("ai.onnx::14::AdaptiveAvgPool2d"), ge::AscendString("ai.onnx::15::AdaptiveAvgPool2d"), | 58 | + ge::AscendString("ai.onnx::14::AdaptiveAvgPool2d"), ge::AscendString("ai.onnx::15::AdaptiveAvgPool2d"), |
| 59 | - ge::AscendString("ai.onnx::16::AdaptiveAvgPool2d")}) | 59 | + ge::AscendString("ai.onnx::16::AdaptiveAvgPool2d")}) |
| 60 | - .ParseParamsFn(ParseParamsAdaptiveAvgPool2d) | 60 | + .ParseParamsFn(ParseParamsAdaptiveAvgPool2d) |
| 61 | - .ImplyType(ImplyType::TVM); | 61 | + .ImplyType(ImplyType::TVM); |
| 62 | -} // namespace domi | 62 | +} // namespace domi |
Rcommon/src/framework/adaptive_max_pool2d_onnx_plugin.cpp→pooling/adaptive_max_pool2d/framework/adaptive_max_pool2d_onnx_plugin.cpp+62-62
| @@ -1,62 +1,62 @@ | |||
| 1 | -/** | 1 | +/** |
| 2 | - * Copyright (c) 2025 Huawei Technologies Co., Ltd. | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | - */ | 9 | + */ |
| 10 | - | 10 | + |
| 11 | -/*! | 11 | +/*! |
| 12 | - * \file adaptive_max_pool2d__plugin.cpp | 12 | + * \file adaptive_max_pool2d__plugin.cpp |
| 13 | - * \brief | 13 | + * \brief |
| 14 | - */ | 14 | + */ |
| 15 | -#include "onnx_common.h" | 15 | +#include "onnx_common.h" |
| 16 | - | 16 | + |
| 17 | -namespace domi { | 17 | +namespace domi { |
| 18 | -static const uint32_t ATTR_LOOP_SIZE = 2; | 18 | +static const uint32_t ATTR_LOOP_SIZE = 2; |
| 19 | - | 19 | + |
| 20 | -static Status ParseParamsAdaptiveMaxPool2d(const Message* op_src, ge::Operator& op_dest) | 20 | +static Status ParseParamsAdaptiveMaxPool2d(const Message* op_src, ge::Operator& op_dest) |
| 21 | -{ | 21 | +{ |
| 22 | - const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); | 22 | + const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); |
| 23 | - if (node == nullptr) { | 23 | + if (node == nullptr) { |
| 24 | - OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); | 24 | + OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); |
| 25 | - return FAILED; | 25 | + return FAILED; |
| 26 | - } | 26 | + } |
| 27 | - std::vector<int> v_output_size = {}; | 27 | + std::vector<int> v_output_size = {}; |
| 28 | - bool set_output_size_flag = false; | 28 | + bool set_output_size_flag = false; |
| 29 | - | 29 | + |
| 30 | - for (const auto& attr : node->attribute()) { | 30 | + for (const auto& attr : node->attribute()) { |
| 31 | - if (attr.name() == "output_size" && attr.type() == ge::onnx::AttributeProto::INTS) { | 31 | + if (attr.name() == "output_size" && attr.type() == ge::onnx::AttributeProto::INTS) { |
| 32 | - if (attr.ints_size() == ATTR_LOOP_SIZE) { | 32 | + if (attr.ints_size() == ATTR_LOOP_SIZE) { |
| 33 | - for (int i = 0; i < attr.ints_size(); i++) { | 33 | + for (int i = 0; i < attr.ints_size(); i++) { |
| 34 | - v_output_size.push_back(attr.ints(i)); | 34 | + v_output_size.push_back(attr.ints(i)); |
| 35 | - } | 35 | + } |
| 36 | - } else { | 36 | + } else { |
| 37 | - OP_LOGE(GetOpName(op_dest).c_str(), "length of output_size must be 2."); | 37 | + OP_LOGE(GetOpName(op_dest).c_str(), "length of output_size must be 2."); |
| 38 | - } | 38 | + } |
| 39 | - set_output_size_flag = true; | 39 | + set_output_size_flag = true; |
| 40 | - } | 40 | + } |
| 41 | - } | 41 | + } |
| 42 | - | 42 | + |
| 43 | - if (set_output_size_flag) { | 43 | + if (set_output_size_flag) { |
| 44 | - op_dest.SetAttr("output_size", v_output_size); | 44 | + op_dest.SetAttr("output_size", v_output_size); |
| 45 | - } else { | 45 | + } else { |
| 46 | - OP_LOGE(GetOpName(op_dest).c_str(), "onnx AdaptiveMaxPool2d op has no output_size attr."); | 46 | + OP_LOGE(GetOpName(op_dest).c_str(), "onnx AdaptiveMaxPool2d op has no output_size attr."); |
| 47 | - } | 47 | + } |
| 48 | - return SUCCESS; | 48 | + return SUCCESS; |
| 49 | -} | 49 | +} |
| 50 | - | 50 | + |
| 51 | -// register AdaptiveMaxPool2d op info to GE | 51 | +// register AdaptiveMaxPool2d op info to GE |
| 52 | -REGISTER_CUSTOM_OP("AdaptiveMaxPool2d") | 52 | +REGISTER_CUSTOM_OP("AdaptiveMaxPool2d") |
| 53 | - .FrameworkType(ONNX) | 53 | + .FrameworkType(ONNX) |
| 54 | - .OriginOpType( | 54 | + .OriginOpType( |
| 55 | - {ge::AscendString("aten::adaptive_max_pool2d"), ge::AscendString("ai.onnx::8::AdaptiveMaxPool2d"), | 55 | + {ge::AscendString("aten::adaptive_max_pool2d"), ge::AscendString("ai.onnx::8::AdaptiveMaxPool2d"), |
| 56 | - ge::AscendString("ai.onnx::9::AdaptiveMaxPool2d"), ge::AscendString("ai.onnx::10::AdaptiveMaxPool2d"), | 56 | + ge::AscendString("ai.onnx::9::AdaptiveMaxPool2d"), ge::AscendString("ai.onnx::10::AdaptiveMaxPool2d"), |
| 57 | - ge::AscendString("ai.onnx::11::AdaptiveMaxPool2d"), ge::AscendString("ai.onnx::12::AdaptiveMaxPool2d"), | 57 | + ge::AscendString("ai.onnx::11::AdaptiveMaxPool2d"), ge::AscendString("ai.onnx::12::AdaptiveMaxPool2d"), |
| 58 | - ge::AscendString("ai.onnx::13::AdaptiveMaxPool2d"), ge::AscendString("ai.onnx::14::AdaptiveMaxPool2d"), | 58 | + ge::AscendString("ai.onnx::13::AdaptiveMaxPool2d"), ge::AscendString("ai.onnx::14::AdaptiveMaxPool2d"), |
| 59 | - ge::AscendString("ai.onnx::15::AdaptiveMaxPool2d"), ge::AscendString("ai.onnx::16::AdaptiveMaxPool2d")}) | 59 | + ge::AscendString("ai.onnx::15::AdaptiveMaxPool2d"), ge::AscendString("ai.onnx::16::AdaptiveMaxPool2d")}) |
| 60 | - .ParseParamsFn(ParseParamsAdaptiveMaxPool2d) | 60 | + .ParseParamsFn(ParseParamsAdaptiveMaxPool2d) |
| 61 | - .ImplyType(ImplyType::TVM); | 61 | + .ImplyType(ImplyType::TVM); |
| 62 | -} // namespace domi | 62 | +} // namespace domi |
Rcommon/src/framework/ascend_anti_quant_onnx_plugin.cpp→quant/ascend_anti_quant/framework/ascend_anti_quant_onnx_plugin.cpp+76-76
| @@ -1,77 +1,77 @@ | |||
| 1 | -/** | 1 | +/** |
| 2 | - * Copyright (c) 2025 Huawei Technologies Co., Ltd. | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | - */ | 9 | + */ |
| 10 | - | 10 | + |
| 11 | -#include "onnx_common.h" | 11 | +#include "onnx_common.h" |
| 12 | - | 12 | + |
| 13 | -namespace domi { | 13 | +namespace domi { |
| 14 | - | 14 | + |
| 15 | -static Status ParseParamsAscendAntiQuant(const Message* op_src, ge::Operator& op_dest) | 15 | +static Status ParseParamsAscendAntiQuant(const Message* op_src, ge::Operator& op_dest) |
| 16 | -{ | 16 | +{ |
| 17 | - const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); | 17 | + const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); |
| 18 | - if (node == nullptr) { | 18 | + if (node == nullptr) { |
| 19 | - OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); | 19 | + OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); |
| 20 | - return FAILED; | 20 | + return FAILED; |
| 21 | - } | 21 | + } |
| 22 | - | 22 | + |
| 23 | - float scale = 0.0; | 23 | + float scale = 0.0; |
| 24 | - for (const auto& attr : node->attribute()) { | 24 | + for (const auto& attr : node->attribute()) { |
| 25 | - if (attr.name() == "scale" && attr.type() == ge::onnx::AttributeProto::FLOAT) { | 25 | + if (attr.name() == "scale" && attr.type() == ge::onnx::AttributeProto::FLOAT) { |
| 26 | - scale = attr.f(); | 26 | + scale = attr.f(); |
| 27 | - break; | 27 | + break; |
| 28 | - } | 28 | + } |
| 29 | - } | 29 | + } |
| 30 | - | 30 | + |
| 31 | - float offset = 0.0; | 31 | + float offset = 0.0; |
| 32 | - for (const auto& attr : node->attribute()) { | 32 | + for (const auto& attr : node->attribute()) { |
| 33 | - if (attr.name() == "offset" && attr.type() == ge::onnx::AttributeProto::FLOAT) { | 33 | + if (attr.name() == "offset" && attr.type() == ge::onnx::AttributeProto::FLOAT) { |
| 34 | - offset = attr.f() * (-1); | 34 | + offset = attr.f() * (-1); |
| 35 | - break; | 35 | + break; |
| 36 | - } | 36 | + } |
| 37 | - } | 37 | + } |
| 38 | - | 38 | + |
| 39 | - op_dest.SetAttr("scale", scale); | 39 | + op_dest.SetAttr("scale", scale); |
| 40 | - op_dest.SetAttr("offset", offset); | 40 | + op_dest.SetAttr("offset", offset); |
| 41 | - | 41 | + |
| 42 | - int dtype = 0; // DT_FLOAT | 42 | + int dtype = 0; // DT_FLOAT |
| 43 | - for (const auto& attr : node->attribute()) { | 43 | + for (const auto& attr : node->attribute()) { |
| 44 | - if (attr.name() == "dtype" && attr.type() == ge::onnx::AttributeProto::INT) { | 44 | + if (attr.name() == "dtype" && attr.type() == ge::onnx::AttributeProto::INT) { |
| 45 | - dtype = attr.i(); | 45 | + dtype = attr.i(); |
| 46 | - break; | 46 | + break; |
| 47 | - } | 47 | + } |
| 48 | - } | 48 | + } |
| 49 | - | 49 | + |
| 50 | - bool sqrt_mode = false; | 50 | + bool sqrt_mode = false; |
| 51 | - for (const auto& attr : node->attribute()) { | 51 | + for (const auto& attr : node->attribute()) { |
| 52 | - if (attr.name() == "sqrt_mode" && attr.i() != 0) { | 52 | + if (attr.name() == "sqrt_mode" && attr.i() != 0) { |
| 53 | - sqrt_mode = true; | 53 | + sqrt_mode = true; |
| 54 | - break; | 54 | + break; |
| 55 | - } | 55 | + } |
| 56 | - } | 56 | + } |
| 57 | - | 57 | + |
| 58 | - op_dest.SetAttr("dtype", dtype); | 58 | + op_dest.SetAttr("dtype", dtype); |
| 59 | - op_dest.SetAttr("sqrt_mode", sqrt_mode); | 59 | + op_dest.SetAttr("sqrt_mode", sqrt_mode); |
| 60 | - | 60 | + |
| 61 | - return SUCCESS; | 61 | + return SUCCESS; |
| 62 | -} | 62 | +} |
| 63 | - | 63 | + |
| 64 | -// register AscendAntiQuant op info to GE | 64 | +// register AscendAntiQuant op info to GE |
| 65 | -REGISTER_CUSTOM_OP("AscendAntiQuant") | 65 | +REGISTER_CUSTOM_OP("AscendAntiQuant") |
| 66 | - .FrameworkType(ONNX) | 66 | + .FrameworkType(ONNX) |
| 67 | - .OriginOpType({ge::AscendString("ai.onnx::8::AscendAntiQuant"), ge::AscendString("ai.onnx::9::AscendAntiQuant"), | 67 | + .OriginOpType({ge::AscendString("ai.onnx::8::AscendAntiQuant"), ge::AscendString("ai.onnx::9::AscendAntiQuant"), |
| 68 | - ge::AscendString("ai.onnx::10::AscendAntiQuant"), ge::AscendString("ai.onnx::11::AscendAntiQuant"), | 68 | + ge::AscendString("ai.onnx::10::AscendAntiQuant"), ge::AscendString("ai.onnx::11::AscendAntiQuant"), |
| 69 | - ge::AscendString("ai.onnx::12::AscendAntiQuant"), ge::AscendString("ai.onnx::13::AscendAntiQuant"), | 69 | + ge::AscendString("ai.onnx::12::AscendAntiQuant"), ge::AscendString("ai.onnx::13::AscendAntiQuant"), |
| 70 | - ge::AscendString("ai.onnx::14::AscendAntiQuant"), ge::AscendString("ai.onnx::15::AscendAntiQuant"), | 70 | + ge::AscendString("ai.onnx::14::AscendAntiQuant"), ge::AscendString("ai.onnx::15::AscendAntiQuant"), |
| 71 | - ge::AscendString("ai.onnx::16::AscendAntiQuant"), ge::AscendString("ai.onnx::17::AscendAntiQuant"), | 71 | + ge::AscendString("ai.onnx::16::AscendAntiQuant"), ge::AscendString("ai.onnx::17::AscendAntiQuant"), |
| 72 | - ge::AscendString("ai.onnx::18::AscendAntiQuant"), ge::AscendString("ai.onnx::19::AscendAntiQuant"), | 72 | + ge::AscendString("ai.onnx::18::AscendAntiQuant"), ge::AscendString("ai.onnx::19::AscendAntiQuant"), |
| 73 | - ge::AscendString("ai.onnx::20::AscendAntiQuant"), ge::AscendString("ai.onnx::21::AscendAntiQuant"), | 73 | + ge::AscendString("ai.onnx::20::AscendAntiQuant"), ge::AscendString("ai.onnx::21::AscendAntiQuant"), |
| 74 | - ge::AscendString("ai.onnx::22::AscendAntiQuant")}) | 74 | + ge::AscendString("ai.onnx::22::AscendAntiQuant")}) |
| 75 | - .ParseParamsFn(ParseParamsAscendAntiQuant) | 75 | + .ParseParamsFn(ParseParamsAscendAntiQuant) |
| 76 | - .ImplyType(ImplyType::TVM); | 76 | + .ImplyType(ImplyType::TVM); |
| 77 | } // namespace domi | 77 | } // namespace domi |
Rcommon/src/framework/ascend_dequant_onnx_plugin.cpp→quant/ascend_dequant/framework/ascend_dequant_onnx_plugin.cpp+76-76
| @@ -1,76 +1,76 @@ | |||
| 1 | -/** | 1 | +/** |
| 2 | - * Copyright (c) 2025 Huawei Technologies Co., Ltd. | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | - */ | 9 | + */ |
| 10 | - | 10 | + |
| 11 | -#include "onnx_common.h" | 11 | +#include "onnx_common.h" |
| 12 | - | 12 | + |
| 13 | -namespace domi { | 13 | +namespace domi { |
| 14 | - | 14 | + |
| 15 | -static Status ParseParamsAscendDequant(const Message* op_src, ge::Operator& op_dest) | 15 | +static Status ParseParamsAscendDequant(const Message* op_src, ge::Operator& op_dest) |
| 16 | -{ | 16 | +{ |
| 17 | - const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); | 17 | + const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); |
| 18 | - if (node == nullptr) { | 18 | + if (node == nullptr) { |
| 19 | - OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); | 19 | + OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); |
| 20 | - return FAILED; | 20 | + return FAILED; |
| 21 | - } | 21 | + } |
| 22 | - | 22 | + |
| 23 | - int dtype = 0; // DT_FLOAT | 23 | + int dtype = 0; // DT_FLOAT |
| 24 | - bool sqrt_mode = false; | 24 | + bool sqrt_mode = false; |
| 25 | - bool relu_flag = false; | 25 | + bool relu_flag = false; |
| 26 | - for (const auto& attr : node->attribute()) { | 26 | + for (const auto& attr : node->attribute()) { |
| 27 | - if (attr.name() == "dtype" && attr.type() == ge::onnx::AttributeProto::INT) { | 27 | + if (attr.name() == "dtype" && attr.type() == ge::onnx::AttributeProto::INT) { |
| 28 | - dtype = attr.i(); | 28 | + dtype = attr.i(); |
| 29 | - } else if (attr.name() == "sqrt_mode" && attr.i() != 0) { | 29 | + } else if (attr.name() == "sqrt_mode" && attr.i() != 0) { |
| 30 | - sqrt_mode = true; | 30 | + sqrt_mode = true; |
| 31 | - } else if (attr.name() == "relu_flag" && attr.i() != 0) { | 31 | + } else if (attr.name() == "relu_flag" && attr.i() != 0) { |
| 32 | - relu_flag = true; | 32 | + relu_flag = true; |
| 33 | - } | 33 | + } |
| 34 | - } | 34 | + } |
| 35 | - | 35 | + |
| 36 | - op_dest.SetAttr("dtype", dtype); | 36 | + op_dest.SetAttr("dtype", dtype); |
| 37 | - op_dest.SetAttr("sqrt_mode", sqrt_mode); | 37 | + op_dest.SetAttr("sqrt_mode", sqrt_mode); |
| 38 | - op_dest.SetAttr("relu_flag", relu_flag); | 38 | + op_dest.SetAttr("relu_flag", relu_flag); |
| 39 | - | 39 | + |
| 40 | - for (size_t i = 0; i < op_dest.GetInputsSize(); i++) { | 40 | + for (size_t i = 0; i < op_dest.GetInputsSize(); i++) { |
| 41 | - auto tensor = op_dest.GetInputDesc(i); | 41 | + auto tensor = op_dest.GetInputDesc(i); |
| 42 | - tensor.SetOriginFormat(ge::FORMAT_NCHW); | 42 | + tensor.SetOriginFormat(ge::FORMAT_NCHW); |
| 43 | - tensor.SetFormat(ge::FORMAT_NCHW); | 43 | + tensor.SetFormat(ge::FORMAT_NCHW); |
| 44 | - auto ret_x = op_dest.UpdateInputDesc(i, tensor); | 44 | + auto ret_x = op_dest.UpdateInputDesc(i, tensor); |
| 45 | - if (ret_x != ge::GRAPH_SUCCESS) { | 45 | + if (ret_x != ge::GRAPH_SUCCESS) { |
| 46 | - OP_LOGE("Dequant", "update input format failed."); | 46 | + OP_LOGE("Dequant", "update input format failed."); |
| 47 | - return FAILED; | 47 | + return FAILED; |
| 48 | - } | 48 | + } |
| 49 | - } | 49 | + } |
| 50 | - for (size_t i = 0; i < op_dest.GetOutputsSize(); i++) { | 50 | + for (size_t i = 0; i < op_dest.GetOutputsSize(); i++) { |
| 51 | - auto tensor = op_dest.GetOutputDesc(i); | 51 | + auto tensor = op_dest.GetOutputDesc(i); |
| 52 | - tensor.SetOriginFormat(ge::FORMAT_NCHW); | 52 | + tensor.SetOriginFormat(ge::FORMAT_NCHW); |
| 53 | - tensor.SetFormat(ge::FORMAT_NCHW); | 53 | + tensor.SetFormat(ge::FORMAT_NCHW); |
| 54 | - auto ret_y = op_dest.UpdateOutputDesc(i, tensor); | 54 | + auto ret_y = op_dest.UpdateOutputDesc(i, tensor); |
| 55 | - if (ret_y != ge::GRAPH_SUCCESS) { | 55 | + if (ret_y != ge::GRAPH_SUCCESS) { |
| 56 | - OP_LOGE("Dequant", "update output format failed."); | 56 | + OP_LOGE("Dequant", "update output format failed."); |
| 57 | - return FAILED; | 57 | + return FAILED; |
| 58 | - } | 58 | + } |
| 59 | - } | 59 | + } |
| 60 | - return SUCCESS; | 60 | + return SUCCESS; |
| 61 | -} | 61 | +} |
| 62 | - | 62 | + |
| 63 | -// register AscendDequant op info to GE | 63 | +// register AscendDequant op info to GE |
| 64 | -REGISTER_CUSTOM_OP("AscendDequant") | 64 | +REGISTER_CUSTOM_OP("AscendDequant") |
| 65 | - .FrameworkType(ONNX) | 65 | + .FrameworkType(ONNX) |
| 66 | - .OriginOpType({ge::AscendString("ai.onnx::8::AscendDequant"), ge::AscendString("ai.onnx::9::AscendDequant"), | 66 | + .OriginOpType({ge::AscendString("ai.onnx::8::AscendDequant"), ge::AscendString("ai.onnx::9::AscendDequant"), |
| 67 | - ge::AscendString("ai.onnx::10::AscendDequant"), ge::AscendString("ai.onnx::11::AscendDequant"), | 67 | + ge::AscendString("ai.onnx::10::AscendDequant"), ge::AscendString("ai.onnx::11::AscendDequant"), |
| 68 | - ge::AscendString("ai.onnx::12::AscendDequant"), ge::AscendString("ai.onnx::13::AscendDequant"), | 68 | + ge::AscendString("ai.onnx::12::AscendDequant"), ge::AscendString("ai.onnx::13::AscendDequant"), |
| 69 | - ge::AscendString("ai.onnx::14::AscendDequant"), ge::AscendString("ai.onnx::15::AscendDequant"), | 69 | + ge::AscendString("ai.onnx::14::AscendDequant"), ge::AscendString("ai.onnx::15::AscendDequant"), |
| 70 | - ge::AscendString("ai.onnx::16::AscendDequant"), ge::AscendString("ai.onnx::17::AscendDequant"), | 70 | + ge::AscendString("ai.onnx::16::AscendDequant"), ge::AscendString("ai.onnx::17::AscendDequant"), |
| 71 | - ge::AscendString("ai.onnx::18::AscendDequant"), ge::AscendString("ai.onnx::19::AscendDequant"), | 71 | + ge::AscendString("ai.onnx::18::AscendDequant"), ge::AscendString("ai.onnx::19::AscendDequant"), |
| 72 | - ge::AscendString("ai.onnx::20::AscendDequant"), ge::AscendString("ai.onnx::21::AscendDequant"), | 72 | + ge::AscendString("ai.onnx::20::AscendDequant"), ge::AscendString("ai.onnx::21::AscendDequant"), |
| 73 | - ge::AscendString("ai.onnx::22::AscendDequant")}) | 73 | + ge::AscendString("ai.onnx::22::AscendDequant")}) |
| 74 | - .ParseParamsFn(ParseParamsAscendDequant) | 74 | + .ParseParamsFn(ParseParamsAscendDequant) |
| 75 | - .ImplyType(ImplyType::TVM); | 75 | + .ImplyType(ImplyType::TVM); |
| 76 | -} // namespace domi | 76 | +} // namespace domi |
Rcommon/src/framework/ascend_quant_onnx_plugin.cpp→quant/ascend_quant/framework/ascend_quant_onnx_plugin.cpp+98-98
| @@ -1,98 +1,98 @@ | |||
| 1 | -/** | 1 | +/** |
| 2 | - * Copyright (c) 2025 Huawei Technologies Co., Ltd. | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | - */ | 9 | + */ |
| 10 | - | 10 | + |
| 11 | -#include "onnx_common.h" | 11 | +#include "onnx_common.h" |
| 12 | - | 12 | + |
| 13 | -namespace domi { | 13 | +namespace domi { |
| 14 | -using NodeProto = ge::onnx::NodeProto; | 14 | +using NodeProto = ge::onnx::NodeProto; |
| 15 | - | 15 | + |
| 16 | -static void SetAttrFun(const NodeProto* node, ge::Operator& op_dest) | 16 | +static void SetAttrFun(const NodeProto* node, ge::Operator& op_dest) |
| 17 | -{ | 17 | +{ |
| 18 | - float scale = 0.0; | 18 | + float scale = 0.0; |
| 19 | - float offset = 0.0; | 19 | + float offset = 0.0; |
| 20 | - bool sqrtmode = false; | 20 | + bool sqrtmode = false; |
| 21 | - int dtype = ge::DT_INT8; | 21 | + int dtype = ge::DT_INT8; |
| 22 | - std::string round_mode = "Round"; | 22 | + std::string round_mode = "Round"; |
| 23 | - for (const auto& attr : node->attribute()) { | 23 | + for (const auto& attr : node->attribute()) { |
| 24 | - if (attr.name() == "scale" && attr.type() == ge::onnx::AttributeProto::FLOAT) { | 24 | + if (attr.name() == "scale" && attr.type() == ge::onnx::AttributeProto::FLOAT) { |
| 25 | - scale = attr.f(); | 25 | + scale = attr.f(); |
| 26 | - } else if (attr.name() == "offset" && attr.type() == ge::onnx::AttributeProto::FLOAT) { | 26 | + } else if (attr.name() == "offset" && attr.type() == ge::onnx::AttributeProto::FLOAT) { |
| 27 | - offset = attr.f(); | 27 | + offset = attr.f(); |
| 28 | - } else if (attr.name() == "round_mode" && attr.type() == ge::onnx::AttributeProto::STRING) { | 28 | + } else if (attr.name() == "round_mode" && attr.type() == ge::onnx::AttributeProto::STRING) { |
| 29 | - round_mode = attr.s(); | 29 | + round_mode = attr.s(); |
| 30 | - } else if (attr.name() == "sqrt_mode" && attr.i() != 0) { | 30 | + } else if (attr.name() == "sqrt_mode" && attr.i() != 0) { |
| 31 | - sqrtmode = true; | 31 | + sqrtmode = true; |
| 32 | - } else if (attr.name() == "dst_type") { | 32 | + } else if (attr.name() == "dst_type") { |
| 33 | - std::string str_dst_type = attr.s(); | 33 | + std::string str_dst_type = attr.s(); |
| 34 | - int pos = str_dst_type.find_last_not_of(' '); | 34 | + int pos = str_dst_type.find_last_not_of(' '); |
| 35 | - if (pos != 0) { | 35 | + if (pos != 0) { |
| 36 | - str_dst_type.erase(pos + 1); | 36 | + str_dst_type.erase(pos + 1); |
| 37 | - } | 37 | + } |
| 38 | - if (str_dst_type == "INT16") { | 38 | + if (str_dst_type == "INT16") { |
| 39 | - dtype = ge::DT_INT16; | 39 | + dtype = ge::DT_INT16; |
| 40 | - } else if (str_dst_type == "INT4") { | 40 | + } else if (str_dst_type == "INT4") { |
| 41 | - dtype = ge::DT_INT4; | 41 | + dtype = ge::DT_INT4; |
| 42 | - } | 42 | + } |
| 43 | - } | 43 | + } |
| 44 | - } | 44 | + } |
| 45 | - op_dest.SetAttr("dst_type", dtype); | 45 | + op_dest.SetAttr("dst_type", dtype); |
| 46 | - op_dest.SetAttr("scale", scale); | 46 | + op_dest.SetAttr("scale", scale); |
| 47 | - op_dest.SetAttr("offset", offset); | 47 | + op_dest.SetAttr("offset", offset); |
| 48 | - op_dest.SetAttr("sqrt_mode", sqrtmode); | 48 | + op_dest.SetAttr("sqrt_mode", sqrtmode); |
| 49 | - op_dest.SetAttr("round_mode", round_mode); | 49 | + op_dest.SetAttr("round_mode", round_mode); |
| 50 | -} | 50 | +} |
| 51 | - | 51 | + |
| 52 | -static Status ParseParamsAscendQuant(const Message* op_src, ge::Operator& op_dest) | 52 | +static Status ParseParamsAscendQuant(const Message* op_src, ge::Operator& op_dest) |
| 53 | -{ | 53 | +{ |
| 54 | - const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); | 54 | + const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); |
| 55 | - if (node == nullptr) { | 55 | + if (node == nullptr) { |
| 56 | - OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); | 56 | + OP_LOGE(GetOpName(op_dest).c_str(), "Dynamic cast op_src to NodeProto failed."); |
| 57 | - return FAILED; | 57 | + return FAILED; |
| 58 | - } | 58 | + } |
| 59 | - SetAttrFun(node, op_dest); | 59 | + SetAttrFun(node, op_dest); |
| 60 | - | 60 | + |
| 61 | - for (size_t i = 0; i < op_dest.GetInputsSize(); i++) { | 61 | + for (size_t i = 0; i < op_dest.GetInputsSize(); i++) { |
| 62 | - auto tensor = op_dest.GetInputDesc(i); | 62 | + auto tensor = op_dest.GetInputDesc(i); |
| 63 | - tensor.SetOriginFormat(ge::FORMAT_NCHW); | 63 | + tensor.SetOriginFormat(ge::FORMAT_NCHW); |
| 64 | - tensor.SetFormat(ge::FORMAT_NCHW); | 64 | + tensor.SetFormat(ge::FORMAT_NCHW); |
| 65 | - auto ret_x = op_dest.UpdateInputDesc(i, tensor); | 65 | + auto ret_x = op_dest.UpdateInputDesc(i, tensor); |
| 66 | - if (ret_x != ge::GRAPH_SUCCESS) { | 66 | + if (ret_x != ge::GRAPH_SUCCESS) { |
| 67 | - OP_LOGE("Quant", "update input format failed."); | 67 | + OP_LOGE("Quant", "update input format failed."); |
| 68 | - return FAILED; | 68 | + return FAILED; |
| 69 | - } | 69 | + } |
| 70 | - } | 70 | + } |
| 71 | - for (size_t i = 0; i < op_dest.GetOutputsSize(); i++) { | 71 | + for (size_t i = 0; i < op_dest.GetOutputsSize(); i++) { |
| 72 | - auto tensor = op_dest.GetOutputDesc(i); | 72 | + auto tensor = op_dest.GetOutputDesc(i); |
| 73 | - tensor.SetOriginFormat(ge::FORMAT_NCHW); | 73 | + tensor.SetOriginFormat(ge::FORMAT_NCHW); |
| 74 | - tensor.SetFormat(ge::FORMAT_NCHW); | 74 | + tensor.SetFormat(ge::FORMAT_NCHW); |
| 75 | - auto ret_y = op_dest.UpdateOutputDesc(i, tensor); | 75 | + auto ret_y = op_dest.UpdateOutputDesc(i, tensor); |
| 76 | - if (ret_y != ge::GRAPH_SUCCESS) { | 76 | + if (ret_y != ge::GRAPH_SUCCESS) { |
| 77 | - OP_LOGE("Quant", "update output format failed."); | 77 | + OP_LOGE("Quant", "update output format failed."); |
| 78 | - return FAILED; | 78 | + return FAILED; |
| 79 | - } | 79 | + } |
| 80 | - } | 80 | + } |
| 81 | - | 81 | + |
| 82 | - return SUCCESS; | 82 | + return SUCCESS; |
| 83 | -} | 83 | +} |
| 84 | - | 84 | + |
| 85 | -// register AscendQuant op info to GE | 85 | +// register AscendQuant op info to GE |
| 86 | -REGISTER_CUSTOM_OP("AscendQuant") | 86 | +REGISTER_CUSTOM_OP("AscendQuant") |
| 87 | - .FrameworkType(ONNX) | 87 | + .FrameworkType(ONNX) |
| 88 | - .OriginOpType({ge::AscendString("ai.onnx::8::AscendQuant"), ge::AscendString("ai.onnx::9::AscendQuant"), | 88 | + .OriginOpType({ge::AscendString("ai.onnx::8::AscendQuant"), ge::AscendString("ai.onnx::9::AscendQuant"), |
| 89 | - ge::AscendString("ai.onnx::10::AscendQuant"), ge::AscendString("ai.onnx::11::AscendQuant"), | 89 | + ge::AscendString("ai.onnx::10::AscendQuant"), ge::AscendString("ai.onnx::11::AscendQuant"), |
| 90 | - ge::AscendString("ai.onnx::12::AscendQuant"), ge::AscendString("ai.onnx::13::AscendQuant"), | 90 | + ge::AscendString("ai.onnx::12::AscendQuant"), ge::AscendString("ai.onnx::13::AscendQuant"), |
| 91 | - ge::AscendString("ai.onnx::14::AscendQuant"), ge::AscendString("ai.onnx::15::AscendQuant"), | 91 | + ge::AscendString("ai.onnx::14::AscendQuant"), ge::AscendString("ai.onnx::15::AscendQuant"), |
| 92 | - ge::AscendString("ai.onnx::16::AscendQuant"), ge::AscendString("ai.onnx::17::AscendQuant"), | 92 | + ge::AscendString("ai.onnx::16::AscendQuant"), ge::AscendString("ai.onnx::17::AscendQuant"), |
| 93 | - ge::AscendString("ai.onnx::18::AscendQuant"), ge::AscendString("ai.onnx::19::AscendQuant"), | 93 | + ge::AscendString("ai.onnx::18::AscendQuant"), ge::AscendString("ai.onnx::19::AscendQuant"), |
| 94 | - ge::AscendString("ai.onnx::20::AscendQuant"), ge::AscendString("ai.onnx::21::AscendQuant"), | 94 | + ge::AscendString("ai.onnx::20::AscendQuant"), ge::AscendString("ai.onnx::21::AscendQuant"), |
| 95 | - ge::AscendString("ai.onnx::22::AscendQuant")}) | 95 | + ge::AscendString("ai.onnx::22::AscendQuant")}) |
| 96 | - .ParseParamsFn(ParseParamsAscendQuant) | 96 | + .ParseParamsFn(ParseParamsAscendQuant) |
| 97 | - .ImplyType(ImplyType::TVM); | 97 | + .ImplyType(ImplyType::TVM); |
| 98 | -} // namespace domi | 98 | +} // namespace domi |
Rcommon/src/framework/int8_quantize_onnx_plugin.cpp→quant/ascend_quant/framework/int8_quantize_onnx_plugin.cpp+73-73
| @@ -1,74 +1,74 @@ | |||
| 1 | -/** | 1 | +/** |
| 2 | - * Copyright (c) 2025 Huawei Technologies Co., Ltd. | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Please refer to the License for details. You may not use this file except in compliance with the License. | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | + * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | - * See LICENSE in the root of the software repository for the full text of the License. | 8 | + * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | - */ | 9 | + */ |
| 10 | - | 10 | + |
| 11 | -#include "onnx_common.h" | 11 | +#include "onnx_common.h" |
| 12 | - | 12 | + |
| 13 | -namespace domi { | 13 | +namespace domi { |
| 14 | - | 14 | + |
| 15 | -static Status ParseParamsInt8Quantize(const Message* op_src, ge::Operator& op_dest) | 15 | +static Status ParseParamsInt8Quantize(const Message* op_src, ge::Operator& op_dest) |
| 16 | -{ | 16 | +{ |
| 17 | - const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); | 17 | + const ge::onnx::NodeProto* node = dynamic_cast<const ge::onnx::NodeProto*>(op_src); |
| 18 | - if (node == nullptr) { | 18 | + if (node == nullptr) { |
| 19 | - OP_LOGE("Int8Quantize", "Dynamic cast op_src to NodeProto failed."); | 19 | + OP_LOGE("Int8Quantize", "Dynamic cast op_src to NodeProto failed."); |
| 20 | - return FAILED; | 20 | + return FAILED; |
| 21 | - } | 21 | + } |
| 22 | - | 22 | + |
| 23 | - float scale = 0.0; | 23 | + float scale = 0.0; |
| 24 | - float offset = 0.0; | 24 | + float offset = 0.0; |
| 25 | - bool sqrt_mode = false; | 25 | + bool sqrt_mode = false; |
| 26 | - std::string round_mode = "Round"; | 26 | + std::string round_mode = "Round"; |
| 27 | - for (const auto& attr : node->attribute()) { | 27 | + for (const auto& attr : node->attribute()) { |
| 28 | - if (attr.name() == "Y_scale" && attr.type() == ge::onnx::AttributeProto::FLOAT) { | 28 | + if (attr.name() == "Y_scale" && attr.type() == ge::onnx::AttributeProto::FLOAT) { |
| 29 | - scale = attr.f(); | 29 | + scale = attr.f(); |
| 30 | - } else if (attr.name() == "Y_zero_point" && attr.type() == ge::onnx::AttributeProto::INT) { | 30 | + } else if (attr.name() == "Y_zero_point" && attr.type() == ge::onnx::AttributeProto::INT) { |
| 31 | - offset = static_cast<float>(attr.i()); | 31 | + offset = static_cast<float>(attr.i()); |
| 32 | - } | 32 | + } |
| 33 | - } | 33 | + } |
| 34 | - | 34 | + |
| 35 | - op_dest.SetAttr("scale", scale); | 35 | + op_dest.SetAttr("scale", scale); |
| 36 | - op_dest.SetAttr("offset", offset); | 36 | + op_dest.SetAttr("offset", offset); |
| 37 | - op_dest.SetAttr("sqrt_mode", sqrt_mode); | 37 | + op_dest.SetAttr("sqrt_mode", sqrt_mode); |
| 38 | - op_dest.SetAttr("round_mode", round_mode); | 38 | + op_dest.SetAttr("round_mode", round_mode); |
| 39 | - | 39 | + |
| 40 | - for (size_t i = 0; i < op_dest.GetInputsSize(); i++) { | 40 | + for (size_t i = 0; i < op_dest.GetInputsSize(); i++) { |
| 41 | - auto tensor = op_dest.GetInputDesc(i); | 41 | + auto tensor = op_dest.GetInputDesc(i); |
| 42 | - tensor.SetOriginFormat(ge::FORMAT_NCHW); | 42 | + tensor.SetOriginFormat(ge::FORMAT_NCHW); |
| 43 | - tensor.SetFormat(ge::FORMAT_NCHW); | 43 | + tensor.SetFormat(ge::FORMAT_NCHW); |
| 44 | - auto ret_x = op_dest.UpdateInputDesc(i, tensor); | 44 | + auto ret_x = op_dest.UpdateInputDesc(i, tensor); |
| 45 | - if (ret_x != ge::GRAPH_SUCCESS) { | 45 | + if (ret_x != ge::GRAPH_SUCCESS) { |
| 46 | - OP_LOGE("Int8Quantize", "update input format failed."); | 46 | + OP_LOGE("Int8Quantize", "update input format failed."); |
| 47 | - return FAILED; | 47 | + return FAILED; |
| 48 | - } | 48 | + } |
| 49 | - } | 49 | + } |
| 50 | - for (size_t i = 0; i < op_dest.GetOutputsSize(); i++) { | 50 | + for (size_t i = 0; i < op_dest.GetOutputsSize(); i++) { |
| 51 | - auto tensor = op_dest.GetOutputDesc(i); | 51 | + auto tensor = op_dest.GetOutputDesc(i); |
| 52 | - tensor.SetOriginFormat(ge::FORMAT_NCHW); | 52 | + tensor.SetOriginFormat(ge::FORMAT_NCHW); |
| 53 | - tensor.SetFormat(ge::FORMAT_NCHW); | 53 | + tensor.SetFormat(ge::FORMAT_NCHW); |
| 54 | - auto ret_y = op_dest.UpdateOutputDesc(i, tensor); | 54 | + auto ret_y = op_dest.UpdateOutputDesc(i, tensor); |
| 55 | - if (ret_y != ge::GRAPH_SUCCESS) { | 55 | + if (ret_y != ge::GRAPH_SUCCESS) { |
| 56 | - OP_LOGE("Int8Quantize", "update output format failed."); | 56 | + OP_LOGE("Int8Quantize", "update output format failed."); |
| 57 | - return FAILED; | 57 | + return FAILED; |
| 58 | - } | 58 | + } |
| 59 | - } | 59 | + } |
| 60 | - | 60 | + |
| 61 | - return SUCCESS; | 61 | + return SUCCESS; |
| 62 | -} | 62 | +} |
| 63 | - | 63 | + |
| 64 | -// register AscendQuant op info to GE | 64 | +// register AscendQuant op info to GE |
| 65 | -REGISTER_CUSTOM_OP("AscendQuant") | 65 | +REGISTER_CUSTOM_OP("AscendQuant") |
| 66 | - .FrameworkType(ONNX) | 66 | + .FrameworkType(ONNX) |
| 67 | - .OriginOpType({ge::AscendString("ai.onnx::8::Int8Quantize"), ge::AscendString("ai.onnx::9::Int8Quantize"), | 67 | + .OriginOpType({ge::AscendString("ai.onnx::8::Int8Quantize"), ge::AscendString("ai.onnx::9::Int8Quantize"), |
| 68 | - ge::AscendString("ai.onnx::10::Int8Quantize"), ge::AscendString("ai.onnx::11::Int8Quantize"), | 68 | + ge::AscendString("ai.onnx::10::Int8Quantize"), ge::AscendString("ai.onnx::11::Int8Quantize"), |
| 69 | - ge::AscendString("ai.onnx::12::Int8Quantize"), ge::AscendString("ai.onnx::13::Int8Quantize"), | 69 | + ge::AscendString("ai.onnx::12::Int8Quantize"), ge::AscendString("ai.onnx::13::Int8Quantize"), |
| 70 | - ge::AscendString("ai.onnx::14::Int8Quantize"), ge::AscendString("ai.onnx::15::Int8Quantize"), | 70 | + ge::AscendString("ai.onnx::14::Int8Quantize"), ge::AscendString("ai.onnx::15::Int8Quantize"), |
| 71 | - ge::AscendString("ai.onnx::16::Int8Quantize")}) | 71 | + ge::AscendString("ai.onnx::16::Int8Quantize")}) |
| 72 | - .ParseParamsFn(ParseParamsInt8Quantize) | 72 | + .ParseParamsFn(ParseParamsInt8Quantize) |
| 73 | - .ImplyType(ImplyType::TVM); | 73 | + .ImplyType(ImplyType::TVM); |
| 74 | } // namespace domi | 74 | } // namespace domi |