已合并
refactor: EXEC_OPAPI_CMD 迁移为 CANN_OPS_OPB_SYN_EXEC_ACLNN 并升级 opbase #8648
yuyuanfeng创建于 8月13日
refactor: EXEC_OPAPI_CMD 迁移为 CANN_OPS_OPB_SYN_EXEC_ACLNN 并升级 opbase #8648
已合并
共 7 个文件变更+15-15
| @@ -7,7 +7,7 @@ | |||
| 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 | -set(OPBASE_TAG_ID bd20a12ebbd210daccd9f936a9ff4fdd62fa9462) | 10 | +set(OPBASE_TAG_ID 40cc7bedb324a9358aa247a75f5ff898dd46f18c) |
| 11 | 11 | ||
| 12 | if(EXISTS "${PROJECT_SOURCE_DIR}/../../ops-base") | 12 | if(EXISTS "${PROJECT_SOURCE_DIR}/../../ops-base") |
| 13 | get_filename_component(OPBASE_SOURCE_PATH | 13 | get_filename_component(OPBASE_SOURCE_PATH |
| @@ -104,8 +104,8 @@ graphStatus ForeachAddListExecuteFunc(OpExecuteContext* hostApiCtx) | |||
| 104 | PrepareOutputTensorListForeachAddList(hostApiCtx, geTenserListOut, FIRST_OUTPUT, numGeOut); | 104 | PrepareOutputTensorListForeachAddList(hostApiCtx, geTenserListOut, FIRST_OUTPUT, numGeOut); |
| 105 | 105 | ||
| 106 | // execute opapi | 106 | // execute opapi |
| 107 | - auto host_api_ctx = hostApiCtx; | 107 | + auto apiRet = CANN_OPS_OPB_SYN_EXEC_ACLNN(hostApiCtx, aclnnForeachAddList, geTensorListX1, geTensorListX2, alpha, |
| 108 | - auto apiRet = EXEC_OPAPI_CMD(aclnnForeachAddList, geTensorListX1, geTensorListX2, alpha, geTenserListOut); | 108 | + geTenserListOut); |
| 109 | OP_CHECK_IF(apiRet != GRAPH_SUCCESS, OP_LOGE("aclnnfallback", "apiRet faild:%d", apiRet), return GRAPH_FAILED); | 109 | OP_CHECK_IF(apiRet != GRAPH_SUCCESS, OP_LOGE("aclnnfallback", "apiRet faild:%d", apiRet), return GRAPH_FAILED); |
| 110 | 110 | ||
| 111 | return GRAPH_SUCCESS; | 111 | return GRAPH_SUCCESS; |
| @@ -56,8 +56,8 @@ static graphStatus ScatterListHostExecuteFunc(OpExecuteContext* hostApiCtx) | |||
| 56 | const int64_t* axis = attrs->GetAttrPointer<int64_t>(1); | 56 | const int64_t* axis = attrs->GetAttrPointer<int64_t>(1); |
| 57 | 57 | ||
| 58 | // execute opapi | 58 | // execute opapi |
| 59 | - auto host_api_ctx = hostApiCtx; | 59 | + auto apiRet = CANN_OPS_OPB_SYN_EXEC_ACLNN(hostApiCtx, aclnnScatterList, geTenserListVar, indices, update, mask, |
| 60 | - auto apiRet = EXEC_OPAPI_CMD(aclnnScatterList, geTenserListVar, indices, update, mask, reduce, *axis); | 60 | + reduce, *axis); |
| 61 | OP_CHECK_IF(apiRet != GRAPH_SUCCESS, OP_LOGE(hostApiCtx->GetNodeName(), "apiRet faild:%d", apiRet), | 61 | OP_CHECK_IF(apiRet != GRAPH_SUCCESS, OP_LOGE(hostApiCtx->GetNodeName(), "apiRet faild:%d", apiRet), |
| 62 | return GRAPH_FAILED); | 62 | return GRAPH_FAILED); |
| 63 | 63 | ||
| @@ -58,8 +58,8 @@ static graphStatus QuantBatchMatmulInplaceAddExecuteFunc(OpExecuteContext* host_ | |||
| 58 | auto yRef = host_api_ctx->GetInputTensor(QUANTMATMULIA_INDEX_INPUT_Y); | 58 | auto yRef = host_api_ctx->GetInputTensor(QUANTMATMULIA_INDEX_INPUT_Y); |
| 59 | int64_t groupSize = (groupSizePtr != nullptr ? *groupSizePtr : 0); | 59 | int64_t groupSize = (groupSizePtr != nullptr ? *groupSizePtr : 0); |
| 60 | // execute opapi | 60 | // execute opapi |
| 61 | - auto apiRet = EXEC_OPAPI_CMD(aclnnQuantBatchMatmulInplaceAdd, x1, x2, x1Scale, x2Scale, yRef, transposeX1, | 61 | + auto apiRet = CANN_OPS_OPB_SYN_EXEC_ACLNN(host_api_ctx, aclnnQuantBatchMatmulInplaceAdd, x1, x2, x1Scale, x2Scale, |
| 62 | - transposeX2, groupSize); | 62 | + yRef, transposeX1, transposeX2, groupSize); |
| 63 | OP_CHECK_IF(apiRet != GRAPH_SUCCESS, | 63 | OP_CHECK_IF(apiRet != GRAPH_SUCCESS, |
| 64 | OP_LOGE("Execute aclnnfallback quant_batch_matmul_inplace_add", "api_ret faild:%d", apiRet), | 64 | OP_LOGE("Execute aclnnfallback quant_batch_matmul_inplace_add", "api_ret faild:%d", apiRet), |
| 65 | return GRAPH_FAILED); | 65 | return GRAPH_FAILED); |
| @@ -77,12 +77,13 @@ static graphStatus QuantBatchMatmulV3ExecuteFunc(OpExecuteContext* host_api_ctx) | |||
| 77 | const int64_t* groupSizePtr = attrs->GetInt(3); // in QuantBatchMatmulV3 greoupSize attr idx is 3 | 77 | const int64_t* groupSizePtr = attrs->GetInt(3); // in QuantBatchMatmulV3 greoupSize attr idx is 3 |
| 78 | int64_t groupSize = (groupSizePtr != nullptr ? *groupSizePtr : 0); | 78 | int64_t groupSize = (groupSizePtr != nullptr ? *groupSizePtr : 0); |
| 79 | // execute opapi | 79 | // execute opapi |
| 80 | - apiRet = EXEC_OPAPI_CMD(aclnnQuantMatmulV5, x1, x2, pertokenScale, scale, yScale, x1Offset, offset, yOffset, | 80 | + apiRet = CANN_OPS_OPB_SYN_EXEC_ACLNN(host_api_ctx, aclnnQuantMatmulV5, x1, x2, pertokenScale, scale, yScale, |
| 81 | - bias, transposeX1, transposeX2, groupSize, output); | 81 | + x1Offset, offset, yOffset, bias, transposeX1, transposeX2, groupSize, |
| 82 | + output); | ||
| 82 | } else { | 83 | } else { |
| 83 | // execute opapi | 84 | // execute opapi |
| 84 | - apiRet = EXEC_OPAPI_CMD(aclnnQuantMatmulV4, x1, x2, scale, offset, pertokenScale, bias, transposeX1, | 85 | + apiRet = CANN_OPS_OPB_SYN_EXEC_ACLNN(host_api_ctx, aclnnQuantMatmulV4, x1, x2, scale, offset, pertokenScale, |
| 85 | - transposeX2, output); | 86 | + bias, transposeX1, transposeX2, output); |
| 86 | } | 87 | } |
| 87 | OP_CHECK_IF(apiRet != GRAPH_SUCCESS, OP_LOGE("aclnnfallback quant_batch_matmul_v3", "api_ret faild:%d", apiRet), | 88 | OP_CHECK_IF(apiRet != GRAPH_SUCCESS, OP_LOGE("aclnnfallback quant_batch_matmul_v3", "api_ret faild:%d", apiRet), |
| 88 | return GRAPH_FAILED); | 89 | return GRAPH_FAILED); |
| @@ -56,9 +56,8 @@ static graphStatus GroupNormSiluExecuteFunc(OpExecuteContext* hostApiCtx) | |||
| 56 | bool activateSilu = *(attrs->GetAttrPointer<bool>(THIRD_ATTR_INDEX)); | 56 | bool activateSilu = *(attrs->GetAttrPointer<bool>(THIRD_ATTR_INDEX)); |
| 57 | 57 | ||
| 58 | // execute opapi | 58 | // execute opapi |
| 59 | - auto host_api_ctx = hostApiCtx; | 59 | + auto apiRet = CANN_OPS_OPB_SYN_EXEC_ACLNN(hostApiCtx, aclnnGroupNormSiluV2, self, gamma, beta, *group, eps, |
| 60 | - auto apiRet = EXEC_OPAPI_CMD(aclnnGroupNormSiluV2, self, gamma, beta, *group, eps, activateSilu, out, meanOut, | 60 | + activateSilu, out, meanOut, rstdOut); |
| 61 | - rstdOut); | ||
| 62 | OP_CHECK_IF(apiRet != GRAPH_SUCCESS, OP_LOGE(hostApiCtx->GetNodeName(), "apiRet faild:%d", apiRet), | 61 | OP_CHECK_IF(apiRet != GRAPH_SUCCESS, OP_LOGE(hostApiCtx->GetNodeName(), "apiRet faild:%d", apiRet), |
| 63 | return GRAPH_FAILED); | 62 | return GRAPH_FAILED); |
| 64 | 63 | ||
| @@ -35,7 +35,7 @@ static graphStatus TransQuantParamV2ExecuteFunc(OpExecuteContext* host_api_ctx) | |||
| 35 | OP_CHECK_IF(attrs == nullptr, OP_LOGE("aclnnfallback trans_quant_param_v2", "attrs is null"), return GRAPH_FAILED); | 35 | OP_CHECK_IF(attrs == nullptr, OP_LOGE("aclnnfallback trans_quant_param_v2", "attrs is null"), return GRAPH_FAILED); |
| 36 | int64_t roundMode = (attrs->GetInt(0) == nullptr) ? 0 : (*(attrs->GetInt(0))); | 36 | int64_t roundMode = (attrs->GetInt(0) == nullptr) ? 0 : (*(attrs->GetInt(0))); |
| 37 | // execute opapi | 37 | // execute opapi |
| 38 | - auto apiRet = EXEC_OPAPI_CMD(aclnnTransQuantParamV3, scale, offset, roundMode, output); | 38 | + auto apiRet = CANN_OPS_OPB_SYN_EXEC_ACLNN(host_api_ctx, aclnnTransQuantParamV3, scale, offset, roundMode, output); |
| 39 | OP_CHECK_IF(apiRet != GRAPH_SUCCESS, OP_LOGE("aclnnfallback trans_quant_param_v2", "apiRet faild:%d", apiRet), | 39 | OP_CHECK_IF(apiRet != GRAPH_SUCCESS, OP_LOGE("aclnnfallback trans_quant_param_v2", "apiRet faild:%d", apiRet), |
| 40 | return GRAPH_FAILED); | 40 | return GRAPH_FAILED); |
| 41 | 41 | ||