已合并
回退pooling算子 #6415
丛吉钰创建于 6月23日
回退pooling算子 #6415
已合并
共 33 个文件变更+104-328
| @@ -38,7 +38,8 @@ public: | |||
| 38 | .DynamicRankSupportFlag(true) | 38 | .DynamicRankSupportFlag(true) |
| 39 | .DynamicShapeSupportFlag(true) | 39 | .DynamicShapeSupportFlag(true) |
| 40 | .NeedCheckSupportFlag(false) | 40 | .NeedCheckSupportFlag(false) |
| 41 | - .PrecisionReduceFlag(true); | 41 | + .PrecisionReduceFlag(true) |
| 42 | + .ExtendCfgInfo("opFile.value", "adaptive_avg_pool2d_apt"); | ||
| 42 | this->AICore().AddConfig("ascend950", aicore_config_950); | 43 | this->AICore().AddConfig("ascend950", aicore_config_950); |
| 43 | } | 44 | } |
| 44 | }; | 45 | }; |
| @@ -1,18 +0,0 @@ | |||
| 1 | -# ---------------------------------------------------------------------------- | ||
| 2 | -# Copyright (c) 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 | ||
| 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. | ||
| 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. | ||
| 8 | -# See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | -# ---------------------------------------------------------------------------- | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -add_kernel_sources( | ||
| 13 | - KERNEL_SRC arch35/adaptive_avg_pool2d.cpp | ||
| 14 | - COMPUTE_UNITS ascend950 | ||
| 15 | - AUTO_SYNC false | ||
| 16 | -) | ||
| 17 | - | ||
| 18 | - | ||
Rpooling/adaptive_avg_pool2d/op_kernel/arch35/adaptive_avg_pool2d.cpp→pooling/adaptive_avg_pool2d/op_kernel/adaptive_avg_pool2d_apt.cpp+5-5
| @@ -9,14 +9,14 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | /* ! | 11 | /* ! |
| 12 | - * \file adaptive_avg_pool2d.cpp | 12 | + * \file adaptive_avg_pool2d_apt.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | -#include "adaptive_avg_pool2d_big_kernel.h" | 16 | +#include "arch35/adaptive_avg_pool2d_big_kernel.h" |
| 17 | -#include "adaptive_avg_pool2d_simt.h" | 17 | +#include "arch35/adaptive_avg_pool2d_simt.h" |
| 18 | -#include "adaptive_avg_pool2d_small_kernel.h" | 18 | +#include "arch35/adaptive_avg_pool2d_small_kernel.h" |
| 19 | -#include "adaptive_avg_pool2d_struct.h" | 19 | +#include "arch35/adaptive_avg_pool2d_struct.h" |
| 20 | 20 | ||
| 21 | using namespace AdaptiveAvgPool2dOp; | 21 | using namespace AdaptiveAvgPool2dOp; |
| 22 | template <uint64_t TEMPLATE_MODE = TPL_SIMT_KERNEL, uint64_t DTYPE_MODE = TPL_INT32_UINT32, uint64_t NC_FACTOR, | 22 | template <uint64_t TEMPLATE_MODE = TPL_SIMT_KERNEL, uint64_t DTYPE_MODE = TPL_INT32_UINT32, uint64_t NC_FACTOR, |
| @@ -52,7 +52,8 @@ public: | |||
| 52 | .DynamicRankSupportFlag(true) | 52 | .DynamicRankSupportFlag(true) |
| 53 | .DynamicShapeSupportFlag(true) | 53 | .DynamicShapeSupportFlag(true) |
| 54 | .NeedCheckSupportFlag(false) | 54 | .NeedCheckSupportFlag(false) |
| 55 | - .PrecisionReduceFlag(true); | 55 | + .PrecisionReduceFlag(true) |
| 56 | + .ExtendCfgInfo("opFile.value", "adaptive_avg_pool3d_apt"); | ||
| 56 | this->AICore().AddConfig("ascend950", aicore_config_950); | 57 | this->AICore().AddConfig("ascend950", aicore_config_950); |
| 57 | 58 | ||
| 58 | OpAICoreConfig ascend310p_config; | 59 | OpAICoreConfig ascend310p_config; |
| @@ -1,26 +0,0 @@ | |||
| 1 | -# ---------------------------------------------------------------------------- | ||
| 2 | -# Copyright (c) 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 | ||
| 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. | ||
| 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. | ||
| 8 | -# See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | -# ---------------------------------------------------------------------------- | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -add_kernel_sources( | ||
| 13 | - COMPUTE_UNITS ascend910b ascend910_93 | ||
| 14 | -) | ||
| 15 | - | ||
| 16 | -add_kernel_sources( | ||
| 17 | - COMPUTE_UNITS ascend310p kirinx90 kirin9030 | ||
| 18 | -) | ||
| 19 | - | ||
| 20 | -add_kernel_sources( | ||
| 21 | - KERNEL_SRC arch35/adaptive_avg_pool3d.cpp | ||
| 22 | - COMPUTE_UNITS ascend950 | ||
| 23 | - AUTO_SYNC false | ||
| 24 | -) | ||
| 25 | - | ||
| 26 | - | ||
Rpooling/adaptive_avg_pool3d/op_kernel/arch35/adaptive_avg_pool3d.cpp→pooling/adaptive_avg_pool3d/op_kernel/adaptive_avg_pool3d_apt.cpp+2-2
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025-2026 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. |
| @@ -9,7 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | /*! | 11 | /*! |
| 12 | - * \file adaptive_avg_pool3d.cpp | 12 | + * \file adaptive_avg_pool3d_apt.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| @@ -73,7 +73,8 @@ public: | |||
| 73 | .DynamicRankSupportFlag(true) | 73 | .DynamicRankSupportFlag(true) |
| 74 | .DynamicShapeSupportFlag(true) | 74 | .DynamicShapeSupportFlag(true) |
| 75 | .NeedCheckSupportFlag(false) | 75 | .NeedCheckSupportFlag(false) |
| 76 | - .PrecisionReduceFlag(true); | 76 | + .PrecisionReduceFlag(true) |
| 77 | + .ExtendCfgInfo("opFile.value", "adaptive_max_pool3d_apt"); | ||
| 77 | this->AICore().AddConfig("ascend950", aicore_config_950); | 78 | this->AICore().AddConfig("ascend950", aicore_config_950); |
| 78 | 79 | ||
| 79 | OpAICoreConfig config_kirin = GetKirinCoreConfig(); | 80 | OpAICoreConfig config_kirin = GetKirinCoreConfig(); |
| @@ -1,25 +0,0 @@ | |||
| 1 | -# ---------------------------------------------------------------------------- | ||
| 2 | -# Copyright (c) 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 | ||
| 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. | ||
| 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. | ||
| 8 | -# See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | -# ---------------------------------------------------------------------------- | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -add_kernel_sources( | ||
| 13 | - COMPUTE_UNITS ascend910b ascend910_93 | ||
| 14 | -) | ||
| 15 | - | ||
| 16 | -add_kernel_sources( | ||
| 17 | - COMPUTE_UNITS kirinx90 kirin9030 | ||
| 18 | -) | ||
| 19 | - | ||
| 20 | -add_kernel_sources( | ||
| 21 | - KERNEL_SRC arch35/adaptive_max_pool3d.cpp | ||
| 22 | - COMPUTE_UNITS ascend950 | ||
| 23 | -) | ||
| 24 | - | ||
| 25 | - | ||
Rpooling/adaptive_max_pool3d/op_kernel/arch35/adaptive_max_pool3d.cpp→pooling/adaptive_max_pool3d/op_kernel/adaptive_max_pool3d_apt.cpp+6-6
| @@ -1,15 +1,15 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd. | 2 | + * This program is free software, you can redistribute it and/or modify. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * This file is a part of the CANN Open Software. |
| 5 | + * Licensed under 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. | 6 | * 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, | 7 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, 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_pool3d.cpp | 12 | + * \file adaptive_max_pool3d_apt.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| @@ -46,7 +46,8 @@ public: | |||
| 46 | .DynamicRankSupportFlag(true) | 46 | .DynamicRankSupportFlag(true) |
| 47 | .DynamicShapeSupportFlag(true) | 47 | .DynamicShapeSupportFlag(true) |
| 48 | .NeedCheckSupportFlag(false) | 48 | .NeedCheckSupportFlag(false) |
| 49 | - .PrecisionReduceFlag(true); | 49 | + .PrecisionReduceFlag(true) |
| 50 | + .ExtendCfgInfo("opFile.value", "avg_pool_apt"); | ||
| 50 | this->AICore().AddConfig("ascend950", aiCoreConfig); | 51 | this->AICore().AddConfig("ascend950", aiCoreConfig); |
| 51 | } | 52 | } |
| 52 | }; | 53 | }; |
| @@ -1,24 +0,0 @@ | |||
| 1 | -# ---------------------------------------------------------------------------- | ||
| 2 | -# Copyright (c) 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 | ||
| 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. | ||
| 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. | ||
| 8 | -# See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | -# ---------------------------------------------------------------------------- | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -add_kernel_sources( | ||
| 13 | - KERNEL_SRC arch35/avg_pool.cpp | ||
| 14 | - COMPUTE_UNITS ascend950 | ||
| 15 | - AUTO_SYNC false | ||
| 16 | -) | ||
| 17 | - | ||
| 18 | -add_kernel_sources( | ||
| 19 | - KERNEL_SRC arch35/avg_pool.cpp | ||
| 20 | - COMPUTE_UNITS mc62 | ||
| 21 | - AUTO_SYNC false | ||
| 22 | -) | ||
| 23 | - | ||
| 24 | - | ||
| @@ -9,21 +9,21 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | /*! | 11 | /*! |
| 12 | - * \file avg_pool.cpp | 12 | + * \file avg_pool_apt.cpp |
| 13 | * \brief avg_pool implied | 13 | * \brief avg_pool implied |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "avg_pool_nhwc_small_kernel.h" | 19 | +#include "arch35/avg_pool_nhwc_small_kernel.h" |
| 20 | -#include "avg_pool_nhwc_small_kernel_pad.h" | 20 | +#include "arch35/avg_pool_nhwc_small_kernel_pad.h" |
| 21 | -#include "avg_pool_nchw_small_kernel.h" | 21 | +#include "arch35/avg_pool_nchw_small_kernel.h" |
| 22 | -#include "avg_pool_simt.h" | 22 | +#include "arch35/avg_pool_simt.h" |
| 23 | -#include "avg_pool_nchw_small_kernel_pad.h" | 23 | +#include "arch35/avg_pool_nchw_small_kernel_pad.h" |
| 24 | -#include "avg_pool_big_kernel_nhwc.h" | 24 | +#include "arch35/avg_pool_big_kernel_nhwc.h" |
| 25 | -#include "avg_pool_big_kernel.h" | 25 | +#include "arch35/avg_pool_big_kernel.h" |
| 26 | -#include "avg_pool_struct.h" | 26 | +#include "arch35/avg_pool_struct.h" |
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | 29 | ||
| @@ -80,7 +80,8 @@ public: | |||
| 80 | .DynamicRankSupportFlag(true) | 80 | .DynamicRankSupportFlag(true) |
| 81 | .DynamicShapeSupportFlag(true) | 81 | .DynamicShapeSupportFlag(true) |
| 82 | .NeedCheckSupportFlag(false) | 82 | .NeedCheckSupportFlag(false) |
| 83 | - .PrecisionReduceFlag(true); | 83 | + .PrecisionReduceFlag(true) |
| 84 | + .ExtendCfgInfo("opFile.value", "avg_pool3_d_apt"); | ||
| 84 | this->AICore().AddConfig("ascend950", aiCoreConfig); | 85 | this->AICore().AddConfig("ascend950", aiCoreConfig); |
| 85 | 86 | ||
| 86 | OpAICoreConfig config_kirin = GetKirinCoreConfig(); | 87 | OpAICoreConfig config_kirin = GetKirinCoreConfig(); |
| @@ -1,32 +0,0 @@ | |||
| 1 | -# ---------------------------------------------------------------------------- | ||
| 2 | -# Copyright (c) 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 | ||
| 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. | ||
| 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. | ||
| 8 | -# See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | -# ---------------------------------------------------------------------------- | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -add_kernel_sources( | ||
| 13 | - COMPUTE_UNITS ascend910b ascend910_93 | ||
| 14 | -) | ||
| 15 | - | ||
| 16 | -add_kernel_sources( | ||
| 17 | - COMPUTE_UNITS kirinx90 kirin9030 | ||
| 18 | -) | ||
| 19 | - | ||
| 20 | -add_kernel_sources( | ||
| 21 | - KERNEL_SRC arch35/avg_pool3_d.cpp | ||
| 22 | - COMPUTE_UNITS ascend950 | ||
| 23 | - AUTO_SYNC false | ||
| 24 | -) | ||
| 25 | - | ||
| 26 | -add_kernel_sources( | ||
| 27 | - KERNEL_SRC arch35/avg_pool3_d.cpp | ||
| 28 | - COMPUTE_UNITS mc62 | ||
| 29 | - OPTIONS "--cce-no-dcache-flush" | ||
| 30 | -) | ||
| 31 | - | ||
| 32 | - | ||
Rpooling/avg_pool3_d/op_kernel/arch35/avg_pool3_d.cpp→pooling/avg_pool3_d/op_kernel/avg_pool3_d_apt.cpp+1-1
| @@ -9,7 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | /*! | 11 | /*! |
| 12 | - * \file avg_pool3_d.cpp | 12 | + * \file avg_pool3_d_apt.cpp |
| 13 | * \brief pool_3d implied | 13 | * \brief pool_3d implied |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| @@ -60,7 +60,8 @@ public: | |||
| 60 | .DynamicRankSupportFlag(true) | 60 | .DynamicRankSupportFlag(true) |
| 61 | .DynamicShapeSupportFlag(true) | 61 | .DynamicShapeSupportFlag(true) |
| 62 | .NeedCheckSupportFlag(false) | 62 | .NeedCheckSupportFlag(false) |
| 63 | - .PrecisionReduceFlag(true); | 63 | + .PrecisionReduceFlag(true) |
| 64 | + .ExtendCfgInfo("opFile.value", "avg_pool_grad_apt"); | ||
| 64 | this->AICore().AddConfig("ascend950", aiCoreConfig); | 65 | this->AICore().AddConfig("ascend950", aiCoreConfig); |
| 65 | } | 66 | } |
| 66 | }; | 67 | }; |
| @@ -1,19 +0,0 @@ | |||
| 1 | -# ---------------------------------------------------------------------------- | ||
| 2 | -# Copyright (c) 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 | ||
| 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. | ||
| 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. | ||
| 8 | -# See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | -# ---------------------------------------------------------------------------- | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -add_kernel_sources( | ||
| 13 | - KERNEL_SRC arch35/avg_pool_grad.cpp | ||
| 14 | - COMPUTE_UNITS ascend950 | ||
| 15 | - AUTO_SYNC false | ||
| 16 | - OPTIONS "--cce-no-dcache-flush" | ||
| 17 | -) | ||
| 18 | - | ||
| 19 | - | ||
Rpooling/avg_pool_grad/op_kernel/arch35/avg_pool_grad.cpp→pooling/avg_pool_grad/op_kernel/avg_pool_grad_apt.cpp+1-1
| @@ -9,7 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | /*! | 11 | /*! |
| 12 | - * \file avg_pool_grad.cpp | 12 | + * \file avg_pool_v2_grad.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| @@ -67,7 +67,8 @@ public: | |||
| 67 | .DynamicRankSupportFlag(true) | 67 | .DynamicRankSupportFlag(true) |
| 68 | .DynamicShapeSupportFlag(true) | 68 | .DynamicShapeSupportFlag(true) |
| 69 | .NeedCheckSupportFlag(false) | 69 | .NeedCheckSupportFlag(false) |
| 70 | - .PrecisionReduceFlag(true); | 70 | + .PrecisionReduceFlag(true) |
| 71 | + .ExtendCfgInfo("opFile.value", "avg_pool_v2_apt"); | ||
| 71 | this->AICore().AddConfig("ascend950", aiCoreConfig); | 72 | this->AICore().AddConfig("ascend950", aiCoreConfig); |
| 72 | } | 73 | } |
| 73 | }; | 74 | }; |
| @@ -1,26 +0,0 @@ | |||
| 1 | -# ---------------------------------------------------------------------------- | ||
| 2 | -# Copyright (c) 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 | ||
| 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. | ||
| 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. | ||
| 8 | -# See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | -# ---------------------------------------------------------------------------- | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -add_kernel_sources( | ||
| 13 | - KERNEL_SRC arch35/avg_pool_v2.cpp | ||
| 14 | - COMPUTE_UNITS ascend950 | ||
| 15 | - IMPL_MODE high_performance,high_precision | ||
| 16 | - AUTO_SYNC false | ||
| 17 | -) | ||
| 18 | - | ||
| 19 | -add_kernel_sources( | ||
| 20 | - KERNEL_SRC arch35/avg_pool_v2.cpp | ||
| 21 | - COMPUTE_UNITS mc62 | ||
| 22 | - IMPL_MODE high_performance,high_precision | ||
| 23 | - AUTO_SYNC false | ||
| 24 | -) | ||
| 25 | - | ||
| 26 | - | ||
Rpooling/avg_pool_v2/op_kernel/arch35/avg_pool_v2.cpp→pooling/avg_pool_v2/op_kernel/avg_pool_v2_apt.cpp+1-1
| @@ -8,7 +8,7 @@ | |||
| 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 | - * \file avg_pool_v2.cpp | 11 | + * \file avg_pool_apt.cpp |
| 12 | * \brief avg_pool implied | 12 | * \brief avg_pool implied |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| @@ -7,11 +7,11 @@ | |||
| 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 avg_pool_v2_grad_def.cpp | 12 | +* \file avg_pool_v2_grad_def.cpp |
| 13 | - * \brief | 13 | +* \brief |
| 14 | - */ | 14 | +*/ |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| @@ -21,8 +21,7 @@ class AvgPoolV2Grad : public OpDef { | |||
| 21 | public: | 21 | public: |
| 22 | const std::vector<ge::DataType> AvgPoolV2GradXDataType = {ge::DT_FLOAT16, ge::DT_FLOAT, ge::DT_BF16}; | 22 | const std::vector<ge::DataType> AvgPoolV2GradXDataType = {ge::DT_FLOAT16, ge::DT_FLOAT, ge::DT_BF16}; |
| 23 | const std::vector<ge::Format> AvgPoolV2GradXFormat = {ge::FORMAT_ND, ge::FORMAT_ND, ge::FORMAT_ND}; | 23 | const std::vector<ge::Format> AvgPoolV2GradXFormat = {ge::FORMAT_ND, ge::FORMAT_ND, ge::FORMAT_ND}; |
| 24 | - explicit AvgPoolV2Grad(const char* name) : OpDef(name) | 24 | + explicit AvgPoolV2Grad(const char* name) : OpDef(name) { |
| 25 | - { | ||
| 26 | this->Input("orig_input_shape") | 25 | this->Input("orig_input_shape") |
| 27 | .ParamType(REQUIRED) | 26 | .ParamType(REQUIRED) |
| 28 | .ValueDepend(OPTIONAL) | 27 | .ValueDepend(OPTIONAL) |
| @@ -42,15 +41,33 @@ public: | |||
| 42 | .Format(AvgPoolV2GradXFormat) | 41 | .Format(AvgPoolV2GradXFormat) |
| 43 | .UnknownShapeFormat(AvgPoolV2GradXFormat) | 42 | .UnknownShapeFormat(AvgPoolV2GradXFormat) |
| 44 | .AutoContiguous(); | 43 | .AutoContiguous(); |
| 45 | - this->Attr("ksize").AttrType(REQUIRED).ListInt(); | 44 | + this->Attr("ksize") |
| 46 | - this->Attr("strides").AttrType(REQUIRED).ListInt(); | 45 | + .AttrType(REQUIRED) |
| 47 | - this->Attr("padding_mode").AttrType(OPTIONAL).String("CALCULATED"); | 46 | + .ListInt(); |
| 48 | - this->Attr("pads").AttrType(OPTIONAL).ListInt({0, 0, 0, 0}); | 47 | + this->Attr("strides") |
| 49 | - this->Attr("data_format").AttrType(OPTIONAL).String("NCHW"); | 48 | + .AttrType(REQUIRED) |
| 50 | - this->Attr("global_pooling").AttrType(OPTIONAL).Bool(false); | 49 | + .ListInt(); |
| 51 | - this->Attr("ceil_mode").AttrType(OPTIONAL).Bool(false); | 50 | + this->Attr("padding_mode") |
| 52 | - this->Attr("exclusive").AttrType(OPTIONAL).Bool(true); | 51 | + .AttrType(OPTIONAL) |
| 53 | - this->Attr("divisor_override").AttrType(OPTIONAL).Int(0); | 52 | + .String("CALCULATED"); |
| 53 | + this->Attr("pads") | ||
| 54 | + .AttrType(OPTIONAL) | ||
| 55 | + .ListInt({0, 0, 0, 0}); | ||
| 56 | + this->Attr("data_format") | ||
| 57 | + .AttrType(OPTIONAL) | ||
| 58 | + .String("NCHW"); | ||
| 59 | + this->Attr("global_pooling") | ||
| 60 | + .AttrType(OPTIONAL) | ||
| 61 | + .Bool(false); | ||
| 62 | + this->Attr("ceil_mode") | ||
| 63 | + .AttrType(OPTIONAL) | ||
| 64 | + .Bool(false); | ||
| 65 | + this->Attr("exclusive") | ||
| 66 | + .AttrType(OPTIONAL) | ||
| 67 | + .Bool(true); | ||
| 68 | + this->Attr("divisor_override") | ||
| 69 | + .AttrType(OPTIONAL) | ||
| 70 | + .Int(0); | ||
| 54 | 71 | ||
| 55 | OpAICoreConfig aiCoreConfig; | 72 | OpAICoreConfig aiCoreConfig; |
| 56 | aiCoreConfig.DynamicCompileStaticFlag(true) | 73 | aiCoreConfig.DynamicCompileStaticFlag(true) |
| @@ -58,10 +75,11 @@ public: | |||
| 58 | .DynamicRankSupportFlag(true) | 75 | .DynamicRankSupportFlag(true) |
| 59 | .DynamicShapeSupportFlag(true) | 76 | .DynamicShapeSupportFlag(true) |
| 60 | .NeedCheckSupportFlag(false) | 77 | .NeedCheckSupportFlag(false) |
| 61 | - .PrecisionReduceFlag(true); | 78 | + .PrecisionReduceFlag(true) |
| 79 | + .ExtendCfgInfo("opFile.value", "avg_pool_v2_grad_apt"); | ||
| 62 | this->AICore().AddConfig("ascend950", aiCoreConfig); | 80 | this->AICore().AddConfig("ascend950", aiCoreConfig); |
| 63 | } | 81 | } |
| 64 | }; | 82 | }; |
| 65 | 83 | ||
| 66 | OP_ADD(AvgPoolV2Grad); | 84 | OP_ADD(AvgPoolV2Grad); |
| 67 | -} // namespace ops | 85 | +} // namespace ops |
| @@ -1,18 +0,0 @@ | |||
| 1 | -# ---------------------------------------------------------------------------- | ||
| 2 | -# Copyright (c) 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 | ||
| 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. | ||
| 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. | ||
| 8 | -# See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | -# ---------------------------------------------------------------------------- | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -add_kernel_sources( | ||
| 13 | - KERNEL_SRC arch35/avg_pool_v2_grad.cpp | ||
| 14 | - COMPUTE_UNITS ascend950 | ||
| 15 | - OPTIONS "--cce-no-dcache-flush" | ||
| 16 | -) | ||
| 17 | - | ||
| 18 | - | ||
Rpooling/avg_pool_v2_grad/op_kernel/arch35/avg_pool_v2_grad.cpp→pooling/avg_pool_v2_grad/op_kernel/avg_pool_v2_grad_apt.cpp+10-10
| @@ -1,10 +1,10 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd. | 2 | + * This program is free software, you can redistribute it and/or modify. |
| 3 | - * This program is free software, you can redistribute it and/or modify it under the terms and conditions of | 3 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 4 | - * CANN Open Software License Agreement Version 2.0 (the "License"). | 4 | + * This file is a part of the CANN Open Software. |
| 5 | + * Licensed under 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. | 6 | * 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, | 7 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, 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 | ||
| @@ -12,11 +12,11 @@ | |||
| 12 | * \file avg_pool_v2_grad.cpp | 12 | * \file avg_pool_v2_grad.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | -#include "avg_pool_v2_grad_simt.h" | 15 | +#include "arch35/avg_pool_v2_grad_simt.h" |
| 16 | -#include "avg_pool_v2_grad_nhwc_kernel.h" | 16 | +#include "arch35/avg_pool_v2_grad_nhwc_kernel.h" |
| 17 | -#include "avg_pool_v2_grad_nchw_kernel.h" | 17 | +#include "arch35/avg_pool_v2_grad_nchw_kernel.h" |
| 18 | -#include "avg_pool_v2_grad_tiling_data.h" | 18 | +#include "arch35/avg_pool_v2_grad_tiling_data.h" |
| 19 | -#include "avg_pool_v2_grad_tiling_key.h" | 19 | +#include "arch35/avg_pool_v2_grad_tiling_key.h" |
| 20 | using namespace AscendC; | 20 | using namespace AscendC; |
| 21 | using namespace AvgPoolV2Grad; | 21 | using namespace AvgPoolV2Grad; |
| 22 | using namespace AvgPoolV2GradNHWCNameSpace; | 22 | using namespace AvgPoolV2GradNHWCNameSpace; |
| @@ -42,7 +42,8 @@ public: | |||
| 42 | .DynamicRankSupportFlag(true) | 42 | .DynamicRankSupportFlag(true) |
| 43 | .DynamicShapeSupportFlag(true) | 43 | .DynamicShapeSupportFlag(true) |
| 44 | .NeedCheckSupportFlag(false) | 44 | .NeedCheckSupportFlag(false) |
| 45 | - .PrecisionReduceFlag(true); | 45 | + .PrecisionReduceFlag(true) |
| 46 | + .ExtendCfgInfo("opFile.value", "max_pool3_d_apt"); | ||
| 46 | this->AICore().AddConfig("ascend950", aiCoreConfig); | 47 | this->AICore().AddConfig("ascend950", aiCoreConfig); |
| 47 | } | 48 | } |
| 48 | }; | 49 | }; |
| @@ -1,24 +0,0 @@ | |||
| 1 | -# ---------------------------------------------------------------------------- | ||
| 2 | -# Copyright (c) 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 | ||
| 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. | ||
| 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. | ||
| 8 | -# See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | -# ---------------------------------------------------------------------------- | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -add_kernel_sources( | ||
| 13 | - KERNEL_SRC arch35/max_pool3_d.cpp | ||
| 14 | - COMPUTE_UNITS ascend950 | ||
| 15 | - AUTO_SYNC false | ||
| 16 | - OPTIONS "--cce-no-dcache-flush" | ||
| 17 | -) | ||
| 18 | - | ||
| 19 | -add_kernel_sources( | ||
| 20 | - KERNEL_SRC arch35/max_pool3_d.cpp | ||
| 21 | - COMPUTE_UNITS mc62 | ||
| 22 | -) | ||
| 23 | - | ||
| 24 | - | ||
Rpooling/max_pool3_d/op_kernel/arch35/max_pool3_d.cpp→pooling/max_pool3_d/op_kernel/max_pool3_d_apt.cpp+1-1
| @@ -8,7 +8,7 @@ | |||
| 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 | - * \file max_pool3_d.cpp | 11 | + * \file pool_3d.cpp |
| 12 | * \brief pool_3d implied | 12 | * \brief pool_3d implied |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| @@ -17,10 +17,13 @@ | |||
| 17 | namespace ops { | 17 | namespace ops { |
| 18 | class MaxPoolV2 : public OpDef { | 18 | class MaxPoolV2 : public OpDef { |
| 19 | public: | 19 | public: |
| 20 | - const std::vector<ge::DataType> maxPoolV2XDataType = {ge::DT_FLOAT16}; | 20 | + const std::vector<ge::DataType> maxPoolV2XDataType = { |
| 21 | - const std::vector<ge::DataType> maxPoolV2KsizeDataType = {ge::DT_INT32}; | 21 | + ge::DT_FLOAT16}; |
| 22 | - const std::vector<ge::Format> maxPoolV2XFormat = {ge::FORMAT_ND}; | 22 | + const std::vector<ge::DataType> maxPoolV2KsizeDataType = { |
| 23 | - explicit MaxPoolV2(const char* name) : OpDef(name) | 23 | + ge::DT_INT32}; |
| 24 | + const std::vector<ge::Format> maxPoolV2XFormat = { | ||
| 25 | + ge::FORMAT_ND}; | ||
| 26 | + explicit MaxPoolV2(const char *name) : OpDef(name) | ||
| 24 | { | 27 | { |
| 25 | this->Input("x") | 28 | this->Input("x") |
| 26 | .ParamType(REQUIRED) | 29 | .ParamType(REQUIRED) |
| @@ -56,7 +59,8 @@ public: | |||
| 56 | .DynamicRankSupportFlag(true) | 59 | .DynamicRankSupportFlag(true) |
| 57 | .DynamicShapeSupportFlag(true) | 60 | .DynamicShapeSupportFlag(true) |
| 58 | .NeedCheckSupportFlag(false) | 61 | .NeedCheckSupportFlag(false) |
| 59 | - .PrecisionReduceFlag(true); | 62 | + .PrecisionReduceFlag(true) |
| 63 | + .ExtendCfgInfo("opFile.value", "max_pool_v2_apt"); | ||
| 60 | this->AICore().AddConfig("ascend950", aiCoreConfig); | 64 | this->AICore().AddConfig("ascend950", aiCoreConfig); |
| 61 | } | 65 | } |
| 62 | }; | 66 | }; |
| @@ -1,17 +0,0 @@ | |||
| 1 | -# ---------------------------------------------------------------------------- | ||
| 2 | -# Copyright (c) 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 | ||
| 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. | ||
| 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. | ||
| 8 | -# See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | -# ---------------------------------------------------------------------------- | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -add_kernel_sources( | ||
| 13 | - KERNEL_SRC arch35/max_pool_v2.cpp | ||
| 14 | - COMPUTE_UNITS ascend950 | ||
| 15 | -) | ||
| 16 | - | ||
| 17 | - | ||
Rpooling/max_pool_v2/op_kernel/arch35/max_pool_v2.cpp→pooling/max_pool_v2/op_kernel/max_pool_v2_apt.cpp+0-0
文件重命名但无更改。
| @@ -50,7 +50,8 @@ public: | |||
| 50 | .DynamicRankSupportFlag(true) | 50 | .DynamicRankSupportFlag(true) |
| 51 | .DynamicShapeSupportFlag(true) | 51 | .DynamicShapeSupportFlag(true) |
| 52 | .NeedCheckSupportFlag(false) | 52 | .NeedCheckSupportFlag(false) |
| 53 | - .PrecisionReduceFlag(true); | 53 | + .PrecisionReduceFlag(true) |
| 54 | + .ExtendCfgInfo("opFile.value", "max_pool_v3_apt"); | ||
| 54 | this->AICore().AddConfig("ascend950", aiCoreConfig); | 55 | this->AICore().AddConfig("ascend950", aiCoreConfig); |
| 55 | } | 56 | } |
| 56 | }; | 57 | }; |
| @@ -1,26 +0,0 @@ | |||
| 1 | -# ---------------------------------------------------------------------------- | ||
| 2 | -# Copyright (c) 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 | ||
| 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. | ||
| 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. | ||
| 8 | -# See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | -# ---------------------------------------------------------------------------- | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -add_kernel_sources( | ||
| 13 | - KERNEL_SRC arch35/max_pool_v3.cpp | ||
| 14 | - COMPUTE_UNITS ascend950 | ||
| 15 | - AUTO_SYNC false | ||
| 16 | - OPTIONS "--cce-no-dcache-flush" | ||
| 17 | -) | ||
| 18 | - | ||
| 19 | -add_kernel_sources( | ||
| 20 | - KERNEL_SRC arch35/max_pool_v3.cpp | ||
| 21 | - COMPUTE_UNITS mc62 | ||
| 22 | - AUTO_SYNC false | ||
| 23 | - OPTIONS "--cce-no-dcache-flush" | ||
| 24 | -) | ||
| 25 | - | ||
| 26 | - | ||
Rpooling/max_pool_v3/op_kernel/arch35/max_pool_v3.cpp→pooling/max_pool_v3/op_kernel/max_pool_v3_apt.cpp+6-6
| @@ -14,12 +14,12 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "max_pool_v3_big_kernel.h" | 17 | +#include "arch35/max_pool_v3_big_kernel.h" |
| 18 | -#include "max_pool_v3_small_kernel.h" | 18 | +#include "arch35/max_pool_v3_small_kernel.h" |
| 19 | -#include "max_pool_v3_small_kernel_pad.h" | 19 | +#include "arch35/max_pool_v3_small_kernel_pad.h" |
| 20 | -#include "max_pool_v3_nhwc_big_kernel.h" | 20 | +#include "arch35/max_pool_v3_nhwc_big_kernel.h" |
| 21 | -#include "max_pool_v3_nhwc_small_kernel.h" | 21 | +#include "arch35/max_pool_v3_nhwc_small_kernel.h" |
| 22 | -#include "max_pool_v3_nhwc_small_kernel_pad.h" | 22 | +#include "arch35/max_pool_v3_nhwc_small_kernel_pad.h" |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | ||