已合并
fix:重构runtime2_util.h #8841
FishPotatoChen创建于 22 天前
fix:重构runtime2_util.h #8841
已合并
共 30 个文件变更+66-66
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | -#include "op_api/runtime2_util.h" | 22 | +#include "op_api/runtime2_util_nn.h" |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | ||
| @@ -49,4 +49,4 @@ protected: | |||
| 49 | 49 | ||
| 50 | } // namespace optiling | 50 | } // namespace optiling |
| 51 | 51 | ||
| 52 | -#endif // NORM_CONFUSION_SOFTMAX_GRAD_TILING_H_ | 52 | +#endif // NORM_CONFUSION_SOFTMAX_GRAD_TILING_H_ |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "op_api/runtime2_util.h" | 19 | +#include "op_api/runtime2_util_nn.h" |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| @@ -282,4 +282,4 @@ extern ge::graphStatus TilingPrepareForSoftmaxGradExt(gert::TilingParseContext* | |||
| 282 | 282 | ||
| 283 | } // namespace optiling | 283 | } // namespace optiling |
| 284 | 284 | ||
| 285 | -#endif // SOFTMAX_GRAD_EXT_TILING_BASE_H_ | 285 | +#endif // SOFTMAX_GRAD_EXT_TILING_BASE_H_ |
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025 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. |
| @@ -9,11 +9,11 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | /*! | 11 | /*! |
| 12 | - * \file runtime2_util.h | 12 | + * \file runtime2_util_nn.h |
| 13 | * \brief runtime2 util | 13 | * \brief runtime2 util |
| 14 | */ | 14 | */ |
| 15 | -#ifndef CANN_OPS_BUILT_IN_OP_TILING_RUNTIME2_UTIL_H_ | 15 | +#ifndef CANN_OPS_BUILT_IN_OP_TILING_RUNTIME2_UTIL_NN_H_ |
| 16 | -#define CANN_OPS_BUILT_IN_OP_TILING_RUNTIME2_UTIL_H_ | 16 | +#define CANN_OPS_BUILT_IN_OP_TILING_RUNTIME2_UTIL_NN_H_ |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| @@ -120,4 +120,4 @@ private: | |||
| 120 | T content; | 120 | T content; |
| 121 | }; | 121 | }; |
| 122 | } // namespace optiling | 122 | } // namespace optiling |
| 123 | -#endif // CANN_OPS_BUILT_IN_OP_TILING_RUNTIME2_UTIL_H_ | 123 | +#endif // CANN_OPS_BUILT_IN_OP_TILING_RUNTIME2_UTIL_NN_H_ |
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025 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. |
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "op_api/runtime2_util.h" | 16 | +#include "op_api/runtime2_util_nn.h" |
| 17 | 17 | ||
| 18 | namespace optiling { | 18 | namespace optiling { |
| 19 | class CacheTilingContext { | 19 | class CacheTilingContext { |
| @@ -39,7 +39,7 @@ private: | |||
| 39 | template <typename T> | 39 | template <typename T> |
| 40 | class GenericHashItem { | 40 | class GenericHashItem { |
| 41 | public: | 41 | public: |
| 42 | - GenericHashItem(){}; | 42 | + GenericHashItem() {}; |
| 43 | GenericHashItem(const GenericHashItem& obj) | 43 | GenericHashItem(const GenericHashItem& obj) |
| 44 | { | 44 | { |
| 45 | cacheTilingContext = obj.cacheTilingContext; | 45 | cacheTilingContext = obj.cacheTilingContext; |
Mexperimental/norm/sync_batch_norm_gather_stats/op_host/sync_batch_norm_gather_stats_infershape.cpp+1-1
| @@ -14,7 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "op_api/runtime2_util.h" | 17 | +#include "op_api/runtime2_util_nn.h" |
| 18 | 18 | ||
| 19 | using namespace ge; | 19 | using namespace ge; |
| 20 | namespace ops { | 20 | namespace ops { |
| @@ -27,7 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | -#include "op_api/runtime2_util.h" | 30 | +#include "op_api/runtime2_util_nn.h" |
| 31 | 31 | ||
| 32 | namespace optiling { | 32 | namespace optiling { |
| 33 | using Ops::NN::Optiling::TilingBaseClass; | 33 | using Ops::NN::Optiling::TilingBaseClass; |
| @@ -117,4 +117,4 @@ private: | |||
| 117 | int32_t vRegSize_ = 256; | 117 | int32_t vRegSize_ = 256; |
| 118 | }; | 118 | }; |
| 119 | } // namespace optiling | 119 | } // namespace optiling |
| 120 | -#endif // AIR_CXX_RUNTIME_V2_OP_IMPL_EMBEDDING_H | 120 | +#endif // AIR_CXX_RUNTIME_V2_OP_IMPL_EMBEDDING_H |
| @@ -13,7 +13,7 @@ | |||
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | -#include "op_api/runtime2_util.h" | 16 | +#include "op_api/runtime2_util_nn.h" |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| @@ -185,4 +185,4 @@ ge::graphStatus Tiling4IndexFillArch35(gert::TilingContext* context) | |||
| 185 | return Ops::NN::Optiling::TilingRegistry::GetInstance().DoTilingImpl(context); | 185 | return Ops::NN::Optiling::TilingRegistry::GetInstance().DoTilingImpl(context); |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | -} // namespace optiling | 188 | +} // namespace optiling |
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "op_api/runtime2_util.h" | 19 | +#include "op_api/runtime2_util_nn.h" |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| @@ -13,7 +13,7 @@ | |||
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | -#include "op_api/runtime2_util.h" | 16 | +#include "op_api/runtime2_util_nn.h" |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| @@ -13,7 +13,7 @@ | |||
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | -#include "op_api/runtime2_util.h" | 16 | +#include "op_api/runtime2_util_nn.h" |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | -#include "op_api/runtime2_util.h" | 20 | +#include "op_api/runtime2_util_nn.h" |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | namespace optiling { | 23 | namespace optiling { |
| @@ -66,4 +66,4 @@ ge::graphStatus TilingPrepareRepeatInterleaveForAscendC(gert::TilingParseContext | |||
| 66 | IMPL_OP_OPTILING(RepeatInterleave) | 66 | IMPL_OP_OPTILING(RepeatInterleave) |
| 67 | .Tiling(RepeatInterleaveTilingForAscendC) | 67 | .Tiling(RepeatInterleaveTilingForAscendC) |
| 68 | .TilingParse<RepeatInterleaveCompileInfo>(TilingPrepareRepeatInterleaveForAscendC); | 68 | .TilingParse<RepeatInterleaveCompileInfo>(TilingPrepareRepeatInterleaveForAscendC); |
| 69 | -} // namespace optiling | 69 | +} // namespace optiling |
| @@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | -#include "op_api/runtime2_util.h" | 21 | +#include "op_api/runtime2_util_nn.h" |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| @@ -107,4 +107,4 @@ protected: | |||
| 107 | bool UseSIMT(); | 107 | bool UseSIMT(); |
| 108 | }; | 108 | }; |
| 109 | } // namespace optiling | 109 | } // namespace optiling |
| 110 | -#endif // OP_NN_INDEX_SPARSE_SLICE_OP_HOST_ARCH35_TILING_H | 110 | +#endif // OP_NN_INDEX_SPARSE_SLICE_OP_HOST_ARCH35_TILING_H |
| @@ -27,7 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | -#include "op_api/runtime2_util.h" | 30 | +#include "op_api/runtime2_util_nn.h" |
| 31 | 31 | ||
| 32 | namespace optiling { | 32 | namespace optiling { |
| 33 | using Ops::NN::Optiling::TilingBaseClass; | 33 | using Ops::NN::Optiling::TilingBaseClass; |
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025 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. |
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | -#include "op_api/runtime2_util.h" | 20 | +#include "op_api/runtime2_util_nn.h" |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| @@ -217,4 +217,4 @@ ge::graphStatus TilingParse4SigmoidCrossEntropyWithLogitsV2(gert::TilingParseCon | |||
| 217 | IMPL_OP_OPTILING(SigmoidCrossEntropyWithLogitsV2) | 217 | IMPL_OP_OPTILING(SigmoidCrossEntropyWithLogitsV2) |
| 218 | .Tiling(Tiling4SigmoidCrossEntropyWithLogitsV2) | 218 | .Tiling(Tiling4SigmoidCrossEntropyWithLogitsV2) |
| 219 | .TilingParse<SigmoidCEWithLogitsV2CompileInfo>(TilingParse4SigmoidCrossEntropyWithLogitsV2); | 219 | .TilingParse<SigmoidCEWithLogitsV2CompileInfo>(TilingParse4SigmoidCrossEntropyWithLogitsV2); |
| 220 | -} // namespace optiling | 220 | +} // namespace optiling |
Mnorm/add_rms_norm_dynamic_quant_v2/op_host/arch35/add_rms_norm_dynamic_quant_v2_tiling_arch35.cpp+1-1
| @@ -14,7 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "op_api/runtime2_util.h" | 17 | +#include "op_api/runtime2_util_nn.h" |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | namespace optiling { | 20 | namespace optiling { |
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | -#include "op_api/runtime2_util.h" | 28 | +#include "op_api/runtime2_util_nn.h" |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | 31 | ||
| @@ -14,7 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "op_api/runtime2_util.h" | 17 | +#include "op_api/runtime2_util_nn.h" |
| 18 | 18 | ||
| 19 | using namespace ge; | 19 | using namespace ge; |
| 20 | namespace ops { | 20 | namespace ops { |
| @@ -76,4 +76,4 @@ static ge::graphStatus BatchNormInferDataType(gert::InferDataTypeContext* contex | |||
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | IMPL_OP_INFERSHAPE(BatchNorm).InferShape(BatchNormInferShape).InferDataType(BatchNormInferDataType); | 78 | IMPL_OP_INFERSHAPE(BatchNorm).InferShape(BatchNormInferShape).InferDataType(BatchNormInferDataType); |
| 79 | -} // namespace ops | 79 | +} // namespace ops |
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | -#include "op_api/runtime2_util.h" | 28 | +#include "op_api/runtime2_util_nn.h" |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | 31 | ||
| @@ -14,7 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "op_api/runtime2_util.h" | 17 | +#include "op_api/runtime2_util_nn.h" |
| 18 | 18 | ||
| 19 | using namespace ge; | 19 | using namespace ge; |
| 20 | namespace ops { | 20 | namespace ops { |
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025 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. |
| @@ -13,7 +13,7 @@ | |||
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | -#include "op_api/runtime2_util.h" | 16 | +#include "op_api/runtime2_util_nn.h" |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025 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. |
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "op_api/runtime2_util.h" | 23 | +#include "op_api/runtime2_util_nn.h" |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | namespace optiling { | 26 | namespace optiling { |
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025 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. |
| @@ -13,7 +13,7 @@ | |||
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | -#include "op_api/runtime2_util.h" | 16 | +#include "op_api/runtime2_util_nn.h" |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| @@ -383,7 +383,7 @@ static void SetTilingKey4Ascend950(const gert::TilingContext* context, int64_t& | |||
| 383 | otherUbSize += dichotomyAddExtraSize; | 383 | otherUbSize += dichotomyAddExtraSize; |
| 384 | 384 | ||
| 385 | ubRemain = ubSize <= otherUbSize ? 0 : ubSize - otherUbSize; | 385 | ubRemain = ubSize <= otherUbSize ? 0 : ubSize - otherUbSize; |
| 386 | - OP_CHECK_IF((xDtypeSize == 0), OP_LOGE(context->GetNodeName(), "xDtypeSize is zero."), return ); | 386 | + OP_CHECK_IF((xDtypeSize == 0), OP_LOGE(context->GetNodeName(), "xDtypeSize is zero."), return); |
| 387 | maxReduceCount = (ubRemain / (DOUBLE_BUFFER * BUFFER_NUM)) / xDtypeSize; | 387 | maxReduceCount = (ubRemain / (DOUBLE_BUFFER * BUFFER_NUM)) / xDtypeSize; |
| 388 | 388 | ||
| 389 | if (maxReduceCount > reduceCount) { | 389 | if (maxReduceCount > reduceCount) { |
| @@ -451,11 +451,11 @@ static void SetWelfordParallelN(const gert::TilingContext* context, int64_t xDty | |||
| 451 | { | 451 | { |
| 452 | auto compileInfo = context->GetCompileInfo<GroupNormV2CompileInfo>(); | 452 | auto compileInfo = context->GetCompileInfo<GroupNormV2CompileInfo>(); |
| 453 | int64_t blockSize = compileInfo->blockSize; | 453 | int64_t blockSize = compileInfo->blockSize; |
| 454 | - OP_CHECK_IF((xDtypeSize == 0), OP_LOGE(context->GetNodeName(), "xDtypeSize is zero."), return ); | 454 | + OP_CHECK_IF((xDtypeSize == 0), OP_LOGE(context->GetNodeName(), "xDtypeSize is zero."), return); |
| 455 | int64_t coeff = FLOAT32_BYTES / xDtypeSize; | 455 | int64_t coeff = FLOAT32_BYTES / xDtypeSize; |
| 456 | int64_t totalNum = BUFFER_NUM * (coeff + 1); | 456 | int64_t totalNum = BUFFER_NUM * (coeff + 1); |
| 457 | int64_t welfordBase = blockSize / xDtypeSize; | 457 | int64_t welfordBase = blockSize / xDtypeSize; |
| 458 | - OP_CHECK_IF((totalNum == 0), OP_LOGE(context->GetNodeName(), "TotalNum is zero."), return ); | 458 | + OP_CHECK_IF((totalNum == 0), OP_LOGE(context->GetNodeName(), "TotalNum is zero."), return); |
| 459 | int64_t maxParallelN = DownAlign((ubRemain / xDtypeSize) / totalNum, welfordBase); | 459 | int64_t maxParallelN = DownAlign((ubRemain / xDtypeSize) / totalNum, welfordBase); |
| 460 | 460 | ||
| 461 | int64_t dichotomyAddPower = 0; | 461 | int64_t dichotomyAddPower = 0; |
| @@ -491,10 +491,10 @@ static void SetUbTiling4TwoPass(const gert::TilingContext* context, GroupNormV2T | |||
| 491 | auto compileInfo = context->GetCompileInfo<GroupNormV2CompileInfo>(); | 491 | auto compileInfo = context->GetCompileInfo<GroupNormV2CompileInfo>(); |
| 492 | int64_t blockSize = compileInfo->blockSize; | 492 | int64_t blockSize = compileInfo->blockSize; |
| 493 | int64_t elemNum = tilingData.get_elemNum(); | 493 | int64_t elemNum = tilingData.get_elemNum(); |
| 494 | - OP_CHECK_IF((xDtypeSize == 0), OP_LOGE(context->GetNodeName(), "xDtypeSize is zero."), return ); | 494 | + OP_CHECK_IF((xDtypeSize == 0), OP_LOGE(context->GetNodeName(), "xDtypeSize is zero."), return); |
| 495 | int64_t elemNumAlign = RoundUp(elemNum, blockSize / xDtypeSize); | 495 | int64_t elemNumAlign = RoundUp(elemNum, blockSize / xDtypeSize); |
| 496 | SetDichotomyAddParams(context, tilingData); | 496 | SetDichotomyAddParams(context, tilingData); |
| 497 | - OP_CHECK_IF((elemNumAlign == 0), OP_LOGE(context->GetNodeName(), "ElemNumAlign is zero."), return ); | 497 | + OP_CHECK_IF((elemNumAlign == 0), OP_LOGE(context->GetNodeName(), "ElemNumAlign is zero."), return); |
| 498 | int64_t count = maxReduceCount / elemNumAlign; | 498 | int64_t count = maxReduceCount / elemNumAlign; |
| 499 | int64_t processSize = count * elemNumAlign; | 499 | int64_t processSize = count * elemNumAlign; |
| 500 | tilingData.set_processSize(processSize); | 500 | tilingData.set_processSize(processSize); |
| @@ -521,7 +521,7 @@ static void SetUbTiling4WelfordPerf(const gert::TilingContext* context, GroupNor | |||
| 521 | SetWelfordParallelN(context, xDtypeSize, ubRemain, tilingData); | 521 | SetWelfordParallelN(context, xDtypeSize, ubRemain, tilingData); |
| 522 | WelfordTilingInitResult result = InitWelfordTilingCommon(context, tilingData, blockSize, xDtypeSize); | 522 | WelfordTilingInitResult result = InitWelfordTilingCommon(context, tilingData, blockSize, xDtypeSize); |
| 523 | OP_CHECK_IF((result.checkResult == false), OP_LOGE(context->GetNodeName(), "InitWelfordTilingCommon Failed."), | 523 | OP_CHECK_IF((result.checkResult == false), OP_LOGE(context->GetNodeName(), "InitWelfordTilingCommon Failed."), |
| 524 | - return ); | 524 | + return); |
| 525 | int64_t count = maxReduceCount / result.hwNumAlign; | 525 | int64_t count = maxReduceCount / result.hwNumAlign; |
| 526 | if (count >= 1) { | 526 | if (count >= 1) { |
| 527 | result.loopNum = CeilDiv(tilingData.get_shapeD(), count); | 527 | result.loopNum = CeilDiv(tilingData.get_shapeD(), count); |
| @@ -549,7 +549,7 @@ static void SetUbTiling4WelfordGeneralized(const gert::TilingContext* context, G | |||
| 549 | int64_t blockSize = compileInfo->blockSize; | 549 | int64_t blockSize = compileInfo->blockSize; |
| 550 | WelfordTilingInitResult result = InitWelfordTilingCommon(context, tilingData, blockSize, xDtypeSize); | 550 | WelfordTilingInitResult result = InitWelfordTilingCommon(context, tilingData, blockSize, xDtypeSize); |
| 551 | OP_CHECK_IF((result.checkResult == false), OP_LOGE(context->GetNodeName(), "InitWelfordTilingCommon Failed."), | 551 | OP_CHECK_IF((result.checkResult == false), OP_LOGE(context->GetNodeName(), "InitWelfordTilingCommon Failed."), |
| 552 | - return ); | 552 | + return); |
| 553 | int64_t maxReduceCount = (ubRemain / (DOUBLE_BUFFER * BUFFER_NUM)) / xDtypeSize; | 553 | int64_t maxReduceCount = (ubRemain / (DOUBLE_BUFFER * BUFFER_NUM)) / xDtypeSize; |
| 554 | int64_t count = maxReduceCount / result.hwNumAlign; | 554 | int64_t count = maxReduceCount / result.hwNumAlign; |
| 555 | int64_t gammaRealSize = GetOptionalInputTensorSize(context, INPUT_IDX_GAMMA, count); | 555 | int64_t gammaRealSize = GetOptionalInputTensorSize(context, INPUT_IDX_GAMMA, count); |
| @@ -710,4 +710,4 @@ static ge::graphStatus TilingPrepare4GroupNormV2(gert::TilingParseContext* conte | |||
| 710 | 710 | ||
| 711 | // register tiling interface of the GroupNormV2 op. | 711 | // register tiling interface of the GroupNormV2 op. |
| 712 | IMPL_OP_OPTILING(GroupNormV2).Tiling(Tiling4GroupNormV2).TilingParse<GroupNormV2CompileInfo>(TilingPrepare4GroupNormV2); | 712 | IMPL_OP_OPTILING(GroupNormV2).Tiling(Tiling4GroupNormV2).TilingParse<GroupNormV2CompileInfo>(TilingPrepare4GroupNormV2); |
| 713 | -} // namespace optiling | 713 | +} // namespace optiling |
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025 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. |
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "op_api/runtime2_util.h" | 23 | +#include "op_api/runtime2_util_nn.h" |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | namespace optiling { | 26 | namespace optiling { |
| @@ -69,4 +69,4 @@ enum class GroupNormV2TilingKey : int64_t { | |||
| 69 | 69 | ||
| 70 | ge::graphStatus SetTilingData(gert::TilingContext* context); | 70 | ge::graphStatus SetTilingData(gert::TilingContext* context); |
| 71 | } // namespace optiling | 71 | } // namespace optiling |
| 72 | -#endif | 72 | +#endif |
| @@ -14,7 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "op_api/runtime2_util.h" | 17 | +#include "op_api/runtime2_util_nn.h" |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | namespace optiling { | 20 | namespace optiling { |
| @@ -14,7 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "op_api/runtime2_util.h" | 17 | +#include "op_api/runtime2_util_nn.h" |
| 18 | 18 | ||
| 19 | using namespace Ops::Base; | 19 | using namespace Ops::Base; |
| 20 | using namespace ge; | 20 | using namespace ge; |
| @@ -72,4 +72,4 @@ static graphStatus InferShape4LayerNorm(gert::InferShapeContext* context) | |||
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | IMPL_OP_INFERSHAPE(LayerNorm).InferShape(InferShape4LayerNorm); | 74 | IMPL_OP_INFERSHAPE(LayerNorm).InferShape(InferShape4LayerNorm); |
| 75 | -} // namespace ops | 75 | +} // namespace ops |
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025 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. |
| @@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | -#include "op_api/runtime2_util.h" | 21 | +#include "op_api/runtime2_util_nn.h" |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025 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. |
| @@ -14,7 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "op_api/runtime2_util.h" | 17 | +#include "op_api/runtime2_util_nn.h" |
| 18 | 18 | ||
| 19 | using namespace Ops::Base; | 19 | using namespace Ops::Base; |
| 20 | using namespace ge; | 20 | using namespace ge; |
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025 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. |
| @@ -14,7 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "op_api/runtime2_util.h" | 17 | +#include "op_api/runtime2_util_nn.h" |
| 18 | 18 | ||
| 19 | using namespace ge; | 19 | using namespace ge; |
| 20 | namespace ops { | 20 | namespace ops { |
| @@ -38,4 +38,4 @@ static ge::graphStatus InferShape4SyncBatchNormBackwardReduce(gert::InferShapeCo | |||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | IMPL_OP_INFERSHAPE(SyncBatchNormBackwardReduce).InferShape(InferShape4SyncBatchNormBackwardReduce); | 40 | IMPL_OP_INFERSHAPE(SyncBatchNormBackwardReduce).InferShape(InferShape4SyncBatchNormBackwardReduce); |
| 41 | -} // namespace ops | 41 | +} // namespace ops |
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025 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. |
| @@ -14,7 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "op_api/runtime2_util.h" | 17 | +#include "op_api/runtime2_util_nn.h" |
| 18 | 18 | ||
| 19 | using namespace ge; | 19 | using namespace ge; |
| 20 | namespace ops { | 20 | namespace ops { |
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025 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. |
| @@ -14,7 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "op_api/runtime2_util.h" | 17 | +#include "op_api/runtime2_util_nn.h" |
| 18 | 18 | ||
| 19 | using namespace ge; | 19 | using namespace ge; |
| 20 | namespace ops { | 20 | namespace ops { |
| @@ -36,4 +36,4 @@ static ge::graphStatus InferShape4InIdx1AndOutIdx0(gert::InferShapeContext* cont | |||
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | IMPL_OP_INFERSHAPE(SyncBNTrainingUpdate).InferShape(InferShape4InIdx1AndOutIdx0); | 38 | IMPL_OP_INFERSHAPE(SyncBNTrainingUpdate).InferShape(InferShape4InIdx1AndOutIdx0); |
| 39 | -} // namespace ops | 39 | +} // namespace ops |