From 04882ab830ed66eb5d72c99afc35a25c294ee847 Mon Sep 17 00:00:00 2001 From: wulinyu Date: Mon, 1 Sep 2025 11:45:47 +0800 Subject: [PATCH 1/2] fix ele nbuf err --- atvc/include/common/atvc_op_check.h | 3 ++- atvc/include/elewise/elewise_host.h | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/atvc/include/common/atvc_op_check.h b/atvc/include/common/atvc_op_check.h index 06ae33e1..095e6b15 100644 --- a/atvc/include/common/atvc_op_check.h +++ b/atvc/include/common/atvc_op_check.h @@ -63,7 +63,8 @@ bool DebugCheck() { if constexpr (templateType == ATVC::TemplateType::REDUCE || templateType == ATVC::TemplateType::BROADCAST) { if (!CheckSameDtype_()) { - printf("[ERROR]: Different input/output data types is not surpport in Reduce or Broadcast template.\n"); + printf("[ERROR]: [ATVC][OpTraits] Different input/output data types is not support " + "in Reduce or Broadcast template.\n"); return false; } } diff --git a/atvc/include/elewise/elewise_host.h b/atvc/include/elewise/elewise_host.h index 6b4d221f..3f62a1b4 100644 --- a/atvc/include/elewise/elewise_host.h +++ b/atvc/include/elewise/elewise_host.h @@ -58,7 +58,7 @@ bool CheckEleWiseHyperParam(const EleWiseTilingHyperParam &hyperParam) "ubSizeLimitThreshold(%f) must be in [0.5, 0.96].\n", hyperParam.ubSizeLimitThreshold); return false; } - if(hyperParam.nBufferNum > MAX_BUF_NUM || hyperParam.singleCoreBaseLine < MIN_BUF_NUM) { + if(hyperParam.nBufferNum > MAX_BUF_NUM || hyperParam.nBufferNum < MIN_BUF_NUM) { printf("[ERROR]: [ATVC][EleWise] Tiling hyperParam is invalid: nBufferNum(%u) must be in [1, 2].\n", hyperParam.nBufferNum); return false; @@ -96,9 +96,6 @@ int32_t GetEleWiseBasicCnt(const EleWiseTilingHyperParam &hyperParam, if (blockNum == 0) { return 0; } - if (!CheckEleWiseHyperParam(hyperParam)) { - return 0; - } uint32_t avgElePerBlock = totalCnt / blockNum; for (uint32_t i =0; i < MAX_SHAPE_NODE; i++) { if (avgElePerBlock <= hyperParam.splitDataShape[i]) { @@ -132,6 +129,9 @@ template bool CalcEleWiseTiling(int32_t totalCnt, ATVC::EleWiseParam ¶m, EleWiseTilingHyperParam hyperParam = EleWiseTilingHyperParam()) { + if (!CheckEleWiseHyperParam(hyperParam)) { + return 0; + } using Inputs = typename OpTraits::In::types; using Outputs = typename OpTraits::Out::types; using Temps = typename OpTraits::Temp::types; -- Gitee From 1d2519957a8406a0c3f0a872a8201d7ec6b6e409 Mon Sep 17 00:00:00 2001 From: wulinyu Date: Mon, 1 Sep 2025 11:47:50 +0800 Subject: [PATCH 2/2] fix ele nbuf err --- atvc/include/elewise/elewise_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atvc/include/elewise/elewise_host.h b/atvc/include/elewise/elewise_host.h index 3f62a1b4..ca91426e 100644 --- a/atvc/include/elewise/elewise_host.h +++ b/atvc/include/elewise/elewise_host.h @@ -130,7 +130,7 @@ bool CalcEleWiseTiling(int32_t totalCnt, ATVC::EleWiseParam ¶m, EleWiseTilingHyperParam hyperParam = EleWiseTilingHyperParam()) { if (!CheckEleWiseHyperParam(hyperParam)) { - return 0; + return false; } using Inputs = typename OpTraits::In::types; using Outputs = typename OpTraits::Out::types; -- Gitee