Merged
[NpuArch整改] Index、Pooling 算子统一 DAV_3510 注册与平台判断 #13760
陈展熹Add on 16 days ago
[NpuArch整改] Index、Pooling 算子统一 DAV_3510 注册与平台判断 #13760
Merged
Total: 85 files changed+249-247
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend960dt" "ascend960pr" "ascend350" "ascend5162") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202" "ascend5162") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE bucketize_v2 ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE bucketize_v2 ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file bucketize_v2_def.cpp | 12 | * \file bucketize_v2_def.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -67,10 +68,9 @@ public: | |||
| 67 | .NeedCheckSupportFlag(false) | 68 | .NeedCheckSupportFlag(false) |
| 68 | .PrecisionReduceFlag(true) | 69 | .PrecisionReduceFlag(true) |
| 69 | .ExtendCfgInfo("opFile.value", "bucketize_v2_apt"); | 70 | .ExtendCfgInfo("opFile.value", "bucketize_v2_apt"); |
| 70 | - this->AICore().AddConfig("ascend950", aicoreConfig); | 71 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicoreConfig); |
| 71 | - this->AICore().AddConfig("ascend960dt", aicoreConfig); | 72 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfig); |
| 72 | - this->AICore().AddConfig("ascend960pr", aicoreConfig); | 73 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicoreConfig); |
| 73 | - this->AICore().AddConfig("ascend350", aicoreConfig); | ||
| 74 | this->AICore().AddConfig("ascend5162", aicoreConfig); | 74 | this->AICore().AddConfig("ascend5162", aicoreConfig); |
| 75 | } | 75 | } |
| 76 | }; | 76 | }; |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "DAV_3510" "mc62" "ascend910b" "ascend910_93" "DAV_9201" "DAV_9202") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "mc62" "ascend910b" "ascend910_93" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | set(SUPPORT_TILING_DIR "arch35" "arch35" "arch22" "arch22" "arch35" "arch35") | 14 | set(SUPPORT_TILING_DIR "arch35" "arch35" "arch22" "arch22" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE gather_elements ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES gather_elements_v2) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE gather_elements ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES gather_elements_v2) |
| @@ -12,8 +12,8 @@ | |||
| 12 | * \file gather_elements_def.cpp | 12 | * \file gather_elements_def.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | -#include "register/op_def_registry.h" | ||
| 16 | #include "op_common/op_host/util/op_arch_helper.h" | 15 | #include "op_common/op_host/util/op_arch_helper.h" |
| 16 | +#include "register/op_def_registry.h" | ||
| 17 | 17 | ||
| 18 | namespace ops { | 18 | namespace ops { |
| 19 | class GatherElements : public OpDef { | 19 | class GatherElements : public OpDef { |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "mc62" "ascend350" "ascend960dt" "ascend960pr" "ascend5162") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "mc62" "dav_9201" "dav_9202" "ascend5162") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE gather_nd ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE gather_nd ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) |
| @@ -90,9 +90,9 @@ static const std::initializer_list<DataType>& GetOutDtypeSupportList() | |||
| 90 | { | 90 | { |
| 91 | auto curArch = GetCurrentPlatformInfo().GetCurNpuArch(); | 91 | auto curArch = GetCurrentPlatformInfo().GetCurNpuArch(); |
| 92 | switch (curArch) { | 92 | switch (curArch) { |
| 93 | - case NpuArch::DAV_3510: | 93 | + case Ops::Base::DAV_3510: |
| 94 | - case NpuArch::DAV_9202: | 94 | + case Ops::Base::DAV_9202: |
| 95 | - case NpuArch::DAV_9201: { | 95 | + case Ops::Base::DAV_9201: { |
| 96 | return DTYPE_SUPPORT_LIST_950; | 96 | return DTYPE_SUPPORT_LIST_950; |
| 97 | } | 97 | } |
| 98 | case NpuArch::DAV_2201: { | 98 | case NpuArch::DAV_2201: { |
| @@ -13,6 +13,7 @@ | |||
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 16 | #include "register/op_def_registry.h" | 17 | #include "register/op_def_registry.h" |
| 17 | 18 | ||
| 18 | namespace ops { | 19 | namespace ops { |
| @@ -84,10 +85,9 @@ public: | |||
| 84 | .NeedCheckSupportFlag(false) | 85 | .NeedCheckSupportFlag(false) |
| 85 | .PrecisionReduceFlag(true) | 86 | .PrecisionReduceFlag(true) |
| 86 | .ExtendCfgInfo("opFile.value", "gather_nd_apt"); | 87 | .ExtendCfgInfo("opFile.value", "gather_nd_apt"); |
| 87 | - this->AICore().AddConfig("ascend950", aicore_config); | 88 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicore_config); |
| 88 | - this->AICore().AddConfig("ascend350", aicore_config); | 89 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicore_config); |
| 89 | - this->AICore().AddConfig("ascend960dt", aicore_config); | 90 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicore_config); |
| 90 | - this->AICore().AddConfig("ascend960pr", aicore_config); | ||
| 91 | this->AICore().AddConfig("ascend5162", aicore_config); | 91 | this->AICore().AddConfig("ascend5162", aicore_config); |
| 92 | } | 92 | } |
| 93 | }; | 93 | }; |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "mc62" "ascend350" "ascend960dt" "ascend960pr" "ascend5162" "kirinx90" "kirin9030") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "mc62" "dav_9201" "dav_9202" "ascend5162" "kirinx90" "kirin9030") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35" "arch35" "arch31" "arch31") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35" "arch31" "arch31") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE gather_v2 ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES scatter_update renorm gather_elements gather_v3 linear_index_v2 index_put_with_sort HOSTCPU TRUE) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE gather_v2 ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES scatter_update renorm gather_elements gather_v3 linear_index_v2 index_put_with_sort HOSTCPU TRUE) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file gather_v2_def.cpp | 12 | * \file gather_v2_def.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -241,10 +242,9 @@ public: | |||
| 241 | .NeedCheckSupportFlag(false) | 242 | .NeedCheckSupportFlag(false) |
| 242 | .PrecisionReduceFlag(true) | 243 | .PrecisionReduceFlag(true) |
| 243 | .ExtendCfgInfo("opFile.value", "gather_v2_apt"); | 244 | .ExtendCfgInfo("opFile.value", "gather_v2_apt"); |
| 244 | - this->AICore().AddConfig("ascend950", aicoreConfig); | 245 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicoreConfig); |
| 245 | - this->AICore().AddConfig("ascend350", aicoreConfig); | 246 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfig); |
| 246 | - this->AICore().AddConfig("ascend960dt", aicoreConfig); | 247 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicoreConfig); |
| 247 | - this->AICore().AddConfig("ascend960pr", aicoreConfig); | ||
| 248 | 248 | ||
| 249 | OpAICoreConfig config_kirin; | 249 | OpAICoreConfig config_kirin; |
| 250 | config_kirin.DynamicCompileStaticFlag(true) | 250 | config_kirin.DynamicCompileStaticFlag(true) |
| @@ -11,7 +11,7 @@ | |||
| 11 | # A5(arch35) 使用 arch35 目录下的 gather_v2_apt.cpp 作为 kernel 入口 | 11 | # A5(arch35) 使用 arch35 目录下的 gather_v2_apt.cpp 作为 kernel 入口 |
| 12 | add_kernel_sources( | 12 | add_kernel_sources( |
| 13 | KERNEL_SRC arch35/gather_v2_apt.cpp | 13 | KERNEL_SRC arch35/gather_v2_apt.cpp |
| 14 | - COMPUTE_UNITS ascend950 ascend350 mc62 | 14 | + COMPUTE_UNITS dav_3510 mc62 |
| 15 | IMPL_MODE high_performance,high_precision,support_out_of_bound_index | 15 | IMPL_MODE high_performance,high_precision,support_out_of_bound_index |
| 16 | OPTIONS "--cce-no-dcache-flush" | 16 | OPTIONS "--cce-no-dcache-flush" |
| 17 | ) | 17 | ) |
| @@ -23,7 +23,7 @@ add_kernel_sources( | |||
| 23 | # A6(arch92) 使用 arch92 目录下的入口,额外引入 arch92 的 Gather_DMA 模板 | 23 | # A6(arch92) 使用 arch92 目录下的入口,额外引入 arch92 的 Gather_DMA 模板 |
| 24 | add_kernel_sources( | 24 | add_kernel_sources( |
| 25 | KERNEL_SRC arch92/gather_v2_apt.cpp | 25 | KERNEL_SRC arch92/gather_v2_apt.cpp |
| 26 | - COMPUTE_UNITS ascend960dt ascend960pr | 26 | + COMPUTE_UNITS dav_9201 dav_9202 |
| 27 | IMPL_MODE high_performance,high_precision,support_out_of_bound_index | 27 | IMPL_MODE high_performance,high_precision,support_out_of_bound_index |
| 28 | OPTIONS "--cce-no-dcache-flush" | 28 | OPTIONS "--cce-no-dcache-flush" |
| 29 | ) | 29 | ) |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend910b" "ascend910_93" "ascend950" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "ascend910b" "ascend910_93" "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch22" "arch22" "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch22" "arch22" "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE index_fill ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE index_fill ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) |
| @@ -13,6 +13,7 @@ | |||
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | #include <cstdint> | 15 | #include <cstdint> |
| 16 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 16 | #include "register/op_def_registry.h" | 17 | #include "register/op_def_registry.h" |
| 17 | #include "version/metadef_version.h" | 18 | #include "version/metadef_version.h" |
| 18 | namespace { | 19 | namespace { |
| @@ -105,8 +106,7 @@ public: | |||
| 105 | .DynamicFormatFlag(true) | 106 | .DynamicFormatFlag(true) |
| 106 | .DynamicRankSupportFlag(true) | 107 | .DynamicRankSupportFlag(true) |
| 107 | .DynamicShapeSupportFlag(true); | 108 | .DynamicShapeSupportFlag(true); |
| 108 | - this->AICore().AddConfig("ascend950", config_950); | 109 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, config_950); |
| 109 | - this->AICore().AddConfig("ascend350", config_950); | ||
| 110 | 110 | ||
| 111 | #if defined(METADEF_VERSION_NUM) && METADEF_VERSION_NUM >= 90300000 | 111 | #if defined(METADEF_VERSION_NUM) && METADEF_VERSION_NUM >= 90300000 |
| 112 | OpAICoreConfig config_960; | 112 | OpAICoreConfig config_960; |
| @@ -134,8 +134,8 @@ public: | |||
| 134 | .DynamicFormatFlag(true) | 134 | .DynamicFormatFlag(true) |
| 135 | .DynamicRankSupportFlag(true) | 135 | .DynamicRankSupportFlag(true) |
| 136 | .DynamicShapeSupportFlag(true); | 136 | .DynamicShapeSupportFlag(true); |
| 137 | - this->AICore().AddConfig("ascend960dt", config_960); | 137 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, config_960); |
| 138 | - this->AICore().AddConfig("ascend960pr", config_960); | 138 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, config_960); |
| 139 | #endif | 139 | #endif |
| 140 | } | 140 | } |
| 141 | }; | 141 | }; |
| @@ -19,7 +19,7 @@ add_kernel_sources( | |||
| 19 | # A5(arch35) 使用 arch35 目录下的 index_fill.cpp 作为 kernel 入口 | 19 | # A5(arch35) 使用 arch35 目录下的 index_fill.cpp 作为 kernel 入口 |
| 20 | add_kernel_sources( | 20 | add_kernel_sources( |
| 21 | KERNEL_SRC arch35/index_fill.cpp | 21 | KERNEL_SRC arch35/index_fill.cpp |
| 22 | - COMPUTE_UNITS ascend950 ascend350 | 22 | + COMPUTE_UNITS dav_3510 |
| 23 | SIMPLIFIED_KEY 0 | 23 | SIMPLIFIED_KEY 0 |
| 24 | IMPL_MODE high_performance | 24 | IMPL_MODE high_performance |
| 25 | AUTO_SYNC false | 25 | AUTO_SYNC false |
| @@ -28,7 +28,7 @@ add_kernel_sources( | |||
| 28 | # A6(arch92) 使用 arch92 目录下的入口,额外引入 arch92 的 SIMD_DMA 模板 | 28 | # A6(arch92) 使用 arch92 目录下的入口,额外引入 arch92 的 SIMD_DMA 模板 |
| 29 | add_kernel_sources( | 29 | add_kernel_sources( |
| 30 | KERNEL_SRC arch92/index_fill.cpp | 30 | KERNEL_SRC arch92/index_fill.cpp |
| 31 | - COMPUTE_UNITS ascend960dt ascend960pr | 31 | + COMPUTE_UNITS dav_9201 dav_9202 |
| 32 | SIMPLIFIED_KEY 0 | 32 | SIMPLIFIED_KEY 0 |
| 33 | IMPL_MODE high_performance | 33 | IMPL_MODE high_performance |
| 34 | AUTO_SYNC false | 34 | AUTO_SYNC false |
| @@ -9,8 +9,8 @@ | |||
| 9 | # ----------------------------------------------------------------------------------------------------------- | 9 | # ----------------------------------------------------------------------------------------------------------- |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | -# 设置算子定义时支持的芯片类型 | 12 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 13 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr") | 13 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202") |
| 14 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 14 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 15 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") | 15 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") |
| 16 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE index_fill_d ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) | 16 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE index_fill_d ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file index_fill_d.cpp | 12 | * \file index_fill_d.cpp |
| 13 | * \brief index_fill_d op host | 13 | * \brief index_fill_d op host |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -37,10 +38,9 @@ public: | |||
| 37 | .NeedCheckSupportFlag(false) | 38 | .NeedCheckSupportFlag(false) |
| 38 | .ExtendCfgInfo("opFile.value", "index_fill_d_apt"); | 39 | .ExtendCfgInfo("opFile.value", "index_fill_d_apt"); |
| 39 | 40 | ||
| 40 | - this->AICore().AddConfig("ascend950", aicore_config); | 41 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicore_config); |
| 41 | - this->AICore().AddConfig("ascend350", aicore_config); | 42 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicore_config); |
| 42 | - this->AICore().AddConfig("ascend960dt", aicore_config); | 43 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicore_config); |
| 43 | - this->AICore().AddConfig("ascend960pr", aicore_config); | ||
| 44 | } | 44 | } |
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE inplace_index_add ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE inplace_index_add ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file inplace_index_add_def.cpp | 12 | * \file inplace_index_add_def.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -55,10 +56,9 @@ public: | |||
| 55 | .DynamicShapeSupportFlag(true) | 56 | .DynamicShapeSupportFlag(true) |
| 56 | .NeedCheckSupportFlag(false) | 57 | .NeedCheckSupportFlag(false) |
| 57 | .PrecisionReduceFlag(true); | 58 | .PrecisionReduceFlag(true); |
| 58 | - this->AICore().AddConfig("ascend950", aicoreConfig); | 59 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicoreConfig); |
| 59 | - this->AICore().AddConfig("ascend350", aicoreConfig); | 60 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfig); |
| 60 | - this->AICore().AddConfig("ascend960dt", aicoreConfig); | 61 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicoreConfig); |
| 61 | - this->AICore().AddConfig("ascend960pr", aicoreConfig); | ||
| 62 | } | 62 | } |
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| @@ -11,14 +11,14 @@ | |||
| 11 | # A5(arch35) 使用 arch35 目录下的 inplace_index_add_apt.cpp 作为 kernel 入口 | 11 | # A5(arch35) 使用 arch35 目录下的 inplace_index_add_apt.cpp 作为 kernel 入口 |
| 12 | add_kernel_sources( | 12 | add_kernel_sources( |
| 13 | KERNEL_SRC arch35/inplace_index_add.cpp | 13 | KERNEL_SRC arch35/inplace_index_add.cpp |
| 14 | - COMPUTE_UNITS ascend950 ascend350 | 14 | + COMPUTE_UNITS dav_3510 |
| 15 | AUTO_SYNC false | 15 | AUTO_SYNC false |
| 16 | OPTIONS "--cce-no-dcache-flush" | 16 | OPTIONS "--cce-no-dcache-flush" |
| 17 | ) | 17 | ) |
| 18 | # A6(arch92) 使用 arch92 目录下的入口,额外引入 arch92 的 ScatterDMA 模板 | 18 | # A6(arch92) 使用 arch92 目录下的入口,额外引入 arch92 的 ScatterDMA 模板 |
| 19 | add_kernel_sources( | 19 | add_kernel_sources( |
| 20 | KERNEL_SRC arch92/inplace_index_add.cpp | 20 | KERNEL_SRC arch92/inplace_index_add.cpp |
| 21 | - COMPUTE_UNITS ascend960dt ascend960pr | 21 | + COMPUTE_UNITS dav_9201 dav_9202 |
| 22 | AUTO_SYNC false | 22 | AUTO_SYNC false |
| 23 | OPTIONS "--cce-no-dcache-flush" | 23 | OPTIONS "--cce-no-dcache-flush" |
| 24 | ) | 24 | ) |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE inplace_index_fill ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE inplace_index_fill ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) |
| @@ -13,6 +13,7 @@ | |||
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | #include <cstdint> | 15 | #include <cstdint> |
| 16 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 16 | #include "register/op_def_registry.h" | 17 | #include "register/op_def_registry.h" |
| 17 | namespace { | 18 | namespace { |
| 18 | // x支持10种数据类型,indices支持int32/int64两种,共10x2=20种合法组合 | 19 | // x支持10种数据类型,indices支持int32/int64两种,共10x2=20种合法组合 |
| @@ -54,9 +55,8 @@ public: | |||
| 54 | .NeedCheckSupportFlag(false) | 55 | .NeedCheckSupportFlag(false) |
| 55 | .ExtendCfgInfo("opFile.value", "inplace_index_fill_apt"); | 56 | .ExtendCfgInfo("opFile.value", "inplace_index_fill_apt"); |
| 56 | 57 | ||
| 57 | - this->AICore().AddConfig("ascend950", aicore_config); | 58 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicore_config); |
| 58 | - this->AICore().AddConfig("ascend350", aicore_config); | 59 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicore_config); |
| 59 | - this->AICore().AddConfig("ascend960dt", aicore_config); | ||
| 60 | } | 60 | } |
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file linear_index_v2_def.cpp | 12 | * \file linear_index_v2_def.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -70,10 +71,9 @@ public: | |||
| 70 | .DynamicRankSupportFlag(true) | 71 | .DynamicRankSupportFlag(true) |
| 71 | .DynamicShapeSupportFlag(true) | 72 | .DynamicShapeSupportFlag(true) |
| 72 | .NeedCheckSupportFlag(false); | 73 | .NeedCheckSupportFlag(false); |
| 73 | - this->AICore().AddConfig("ascend950", aicoreConfig); | 74 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicoreConfig); |
| 74 | - this->AICore().AddConfig("ascend350", aicoreConfig); | 75 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfig); |
| 75 | - this->AICore().AddConfig("ascend960dt", aicoreConfig); | 76 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicoreConfig); |
| 76 | - this->AICore().AddConfig("ascend960pr", aicoreConfig); | ||
| 77 | } | 77 | } |
| 78 | }; | 78 | }; |
| 79 | 79 | ||
| @@ -137,7 +137,7 @@ ge::graphStatus LinearIndexV2Tiling::Init() | |||
| 137 | } | 137 | } |
| 138 | // for ascend950, indices can be [0], which means support non-continuous indices | 138 | // for ascend950, indices can be [0], which means support non-continuous indices |
| 139 | uint64_t validIdx = 0; | 139 | uint64_t validIdx = 0; |
| 140 | - if (compileInfo->isAscend950) { | 140 | + if (compileInfo->isRegbase) { |
| 141 | for (uint64_t i = 0; i < tensorId_; i++) { | 141 | for (uint64_t i = 0; i < tensorId_; i++) { |
| 142 | auto idxTensorShapePtr = tilingContext_->GetDynamicInputShape(0, i); | 142 | auto idxTensorShapePtr = tilingContext_->GetDynamicInputShape(0, i); |
| 143 | OP_CHECK_IF(idxTensorShapePtr == nullptr, OP_LOGE_WITH_INVALID_INPUT(opName_, "indices_list"), | 143 | OP_CHECK_IF(idxTensorShapePtr == nullptr, OP_LOGE_WITH_INVALID_INPUT(opName_, "indices_list"), |
| @@ -153,12 +153,12 @@ ge::graphStatus LinearIndexV2Tiling::Init() | |||
| 153 | } | 153 | } |
| 154 | // 1. 取出tensorList中第一个tensor的shape, aclnn中保证了第一个tensor是非空的(For ascend950, need find a valid | 154 | // 1. 取出tensorList中第一个tensor的shape, aclnn中保证了第一个tensor是非空的(For ascend950, need find a valid |
| 155 | // shape) | 155 | // shape) |
| 156 | - auto idxTensorShapePtr = compileInfo->isAscend950 ? tilingContext_->GetDynamicInputShape(0, validIdx) : | 156 | + auto idxTensorShapePtr = compileInfo->isRegbase ? tilingContext_->GetDynamicInputShape(0, validIdx) : |
| 157 | - tilingContext_->GetDynamicInputShape(0, 0); | 157 | + tilingContext_->GetDynamicInputShape(0, 0); |
| 158 | OP_CHECK_IF(idxTensorShapePtr == nullptr, OP_LOGE_WITH_INVALID_INPUT("LinearIndexV2", "indices_list"), | 158 | OP_CHECK_IF(idxTensorShapePtr == nullptr, OP_LOGE_WITH_INVALID_INPUT("LinearIndexV2", "indices_list"), |
| 159 | return ge::GRAPH_FAILED); | 159 | return ge::GRAPH_FAILED); |
| 160 | - auto idxTensorDtypePtr = compileInfo->isAscend950 ? tilingContext_->GetDynamicInputDesc(0, validIdx) : | 160 | + auto idxTensorDtypePtr = compileInfo->isRegbase ? tilingContext_->GetDynamicInputDesc(0, validIdx) : |
| 161 | - tilingContext_->GetDynamicInputDesc(0, 0); | 161 | + tilingContext_->GetDynamicInputDesc(0, 0); |
| 162 | OP_CHECK_IF(idxTensorDtypePtr == nullptr, OP_LOGE_WITH_INVALID_INPUT("LinearIndexV2", "indices_list"), | 162 | OP_CHECK_IF(idxTensorDtypePtr == nullptr, OP_LOGE_WITH_INVALID_INPUT("LinearIndexV2", "indices_list"), |
| 163 | return ge::GRAPH_FAILED); | 163 | return ge::GRAPH_FAILED); |
| 164 | auto idxDtype = idxTensorDtypePtr->GetDataType(); | 164 | auto idxDtype = idxTensorDtypePtr->GetDataType(); |
| @@ -236,7 +236,7 @@ ge::graphStatus LinearIndexV2Tiling::RunKernelTiling() | |||
| 236 | tilingContext_->SetTilingKey(tilingKey_); | 236 | tilingContext_->SetTilingKey(tilingKey_); |
| 237 | tilingContext_->SetBlockDim(usedCoreNum_); | 237 | tilingContext_->SetBlockDim(usedCoreNum_); |
| 238 | auto compileInfo = static_cast<const LinearIndexV2CompileInfo*>(tilingContext_->GetCompileInfo()); | 238 | auto compileInfo = static_cast<const LinearIndexV2CompileInfo*>(tilingContext_->GetCompileInfo()); |
| 239 | - if (compileInfo->isAscend950) { | 239 | + if (compileInfo->isRegbase) { |
| 240 | tilingContext_->SetScheduleMode(1); | 240 | tilingContext_->SetScheduleMode(1); |
| 241 | tilingContext_->SetLocalMemorySize(compileInfo->ubSizePlatForm - DCACHE_SIZE - REGBASE_CCEC_CACHE_SIZE); | 241 | tilingContext_->SetLocalMemorySize(compileInfo->ubSizePlatForm - DCACHE_SIZE - REGBASE_CCEC_CACHE_SIZE); |
| 242 | } | 242 | } |
| @@ -288,7 +288,7 @@ ge::graphStatus TilingPrepareForLinearIndexV2(gert::TilingParseContext* context) | |||
| 288 | OP_CHECK_IF(platformInfo == nullptr, ReportMissingTilingObject(__func__, "platformInfo"), return ge::GRAPH_FAILED); | 288 | OP_CHECK_IF(platformInfo == nullptr, ReportMissingTilingObject(__func__, "platformInfo"), return ge::GRAPH_FAILED); |
| 289 | auto ascendcPlatform = platform_ascendc::PlatformAscendC(platformInfo); | 289 | auto ascendcPlatform = platform_ascendc::PlatformAscendC(platformInfo); |
| 290 | compileInfo->totalCoreNum = ascendcPlatform.GetCoreNumAiv(); | 290 | compileInfo->totalCoreNum = ascendcPlatform.GetCoreNumAiv(); |
| 291 | - compileInfo->isAscend950 = Ops::NN::OpTiling::IsRegbaseSocVersion(context); | 291 | + compileInfo->isRegbase = Ops::NN::OpTiling::IsRegbaseSocVersion(context); |
| 292 | uint64_t ubSizePlatForm; | 292 | uint64_t ubSizePlatForm; |
| 293 | ascendcPlatform.GetCoreMemSize(platform_ascendc::CoreMemType::UB, ubSizePlatForm); | 293 | ascendcPlatform.GetCoreMemSize(platform_ascendc::CoreMemType::UB, ubSizePlatForm); |
| 294 | compileInfo->ubSizePlatForm = ubSizePlatForm; | 294 | compileInfo->ubSizePlatForm = ubSizePlatForm; |
| @@ -47,7 +47,7 @@ REGISTER_TILING_DATA_CLASS(LinearIndexV2, LinearIndexV2TilingData) | |||
| 47 | struct LinearIndexV2CompileInfo { | 47 | struct LinearIndexV2CompileInfo { |
| 48 | int32_t totalCoreNum = 0; | 48 | int32_t totalCoreNum = 0; |
| 49 | uint64_t ubSizePlatForm = 0; | 49 | uint64_t ubSizePlatForm = 0; |
| 50 | - bool isAscend950 = false; | 50 | + bool isRegbase = false; |
| 51 | }; | 51 | }; |
| 52 | } // namespace optiling | 52 | } // namespace optiling |
| 53 | 53 | ||
| @@ -9,5 +9,5 @@ | |||
| 9 | 9 | ||
| 10 | add_kernel_sources( | 10 | add_kernel_sources( |
| 11 | KERNEL_SRC arch35/linear_index_v2.cpp | 11 | KERNEL_SRC arch35/linear_index_v2.cpp |
| 12 | - COMPUTE_UNITS ascend950 ascend350 ascend960dt ascend960pr | 12 | + COMPUTE_UNITS dav_3510 dav_9201 dav_9202 |
| 13 | ) | 13 | ) |
| @@ -8,10 +8,10 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend910b" "ascend910_93" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "ascend910b" "ascend910_93" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch22" "arch22" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch22" "arch22" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE masked_scatter ACLNNTYPE aclnn_exclude | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE masked_scatter ACLNNTYPE aclnn_exclude |
| 16 | COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES masked_scatter_with_position) | 16 | COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES masked_scatter_with_position) |
| 17 | if (TARGET ${OPHOST_NAME}_tiling_obj) | 17 | if (TARGET ${OPHOST_NAME}_tiling_obj) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file masked_scatter_def.cpp | 12 | * \file masked_scatter_def.cpp |
| 13 | * \brief MaskedScatter ophost | 13 | * \brief MaskedScatter ophost |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -95,10 +96,9 @@ public: | |||
| 95 | .NeedCheckSupportFlag(false) | 96 | .NeedCheckSupportFlag(false) |
| 96 | .PrecisionReduceFlag(true) | 97 | .PrecisionReduceFlag(true) |
| 97 | .ExtendCfgInfo("opFile.value", "masked_scatter_apt"); | 98 | .ExtendCfgInfo("opFile.value", "masked_scatter_apt"); |
| 98 | - this->AICore().AddConfig("ascend950", aicore_config); | 99 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicore_config); |
| 99 | - this->AICore().AddConfig("ascend350", aicore_config); | 100 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicore_config); |
| 100 | - this->AICore().AddConfig("ascend960dt", aicore_config); | 101 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicore_config); |
| 101 | - this->AICore().AddConfig("ascend960pr", aicore_config); | ||
| 102 | 102 | ||
| 103 | OpAICoreConfig aicore_config_910B; | 103 | OpAICoreConfig aicore_config_910B; |
| 104 | aicore_config_910B.DynamicCompileStaticFlag(true) | 104 | aicore_config_910B.DynamicCompileStaticFlag(true) |
| @@ -11,7 +11,7 @@ | |||
| 11 | # Ascend 960 reuses the existing kernel implementation. | 11 | # Ascend 960 reuses the existing kernel implementation. |
| 12 | add_kernel_sources( | 12 | add_kernel_sources( |
| 13 | KERNEL_SRC masked_scatter_apt.cpp | 13 | KERNEL_SRC masked_scatter_apt.cpp |
| 14 | - COMPUTE_UNITS ascend960dt ascend960pr | 14 | + COMPUTE_UNITS dav_9201 dav_9202 |
| 15 | SIMPLIFIED_KEY 0 | 15 | SIMPLIFIED_KEY 0 |
| 16 | AUTO_SYNC false | 16 | AUTO_SYNC false |
| 17 | OPTIONS "--cce-no-dcache-flush" | 17 | OPTIONS "--cce-no-dcache-flush" |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE repeat_interleave ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE repeat_interleave ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \brief | 12 | * \brief |
| 13 | */ | 13 | */ |
| 14 | #include <cstdint> | 14 | #include <cstdint> |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -75,10 +76,9 @@ public: | |||
| 75 | .NeedCheckSupportFlag(false) | 76 | .NeedCheckSupportFlag(false) |
| 76 | .PrecisionReduceFlag(true) | 77 | .PrecisionReduceFlag(true) |
| 77 | .ExtendCfgInfo("opFile.value", "repeat_interleave_apt"); | 78 | .ExtendCfgInfo("opFile.value", "repeat_interleave_apt"); |
| 78 | - this->AICore().AddConfig("ascend950", config910d); | 79 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, config910d); |
| 79 | - this->AICore().AddConfig("ascend350", config910d); | 80 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, config910d); |
| 80 | - this->AICore().AddConfig("ascend960dt", config910d); | 81 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, config910d); |
| 81 | - this->AICore().AddConfig("ascend960pr", config910d); | ||
| 82 | } | 82 | } |
| 83 | }; | 83 | }; |
| 84 | OP_ADD(RepeatInterleave); | 84 | OP_ADD(RepeatInterleave); |
| @@ -11,7 +11,7 @@ | |||
| 11 | # Ascend 960 reuses the existing kernel implementation. | 11 | # Ascend 960 reuses the existing kernel implementation. |
| 12 | add_kernel_sources( | 12 | add_kernel_sources( |
| 13 | KERNEL_SRC repeat_interleave_apt.cpp | 13 | KERNEL_SRC repeat_interleave_apt.cpp |
| 14 | - COMPUTE_UNITS ascend960dt ascend960pr | 14 | + COMPUTE_UNITS dav_9201 dav_9202 |
| 15 | SIMPLIFIED_KEY 0 | 15 | SIMPLIFIED_KEY 0 |
| 16 | AUTO_SYNC false | 16 | AUTO_SYNC false |
| 17 | OPTIONS "--cce-no-dcache-flush" | 17 | OPTIONS "--cce-no-dcache-flush" |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "mc62" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "mc62" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE reverse_v2 ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE reverse_v2 ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) |
| @@ -13,6 +13,7 @@ | |||
| 13 | * \brief reverse_v2 op host | 13 | * \brief reverse_v2 op host |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 16 | #include "register/op_def_registry.h" | 17 | #include "register/op_def_registry.h" |
| 17 | 18 | ||
| 18 | namespace ops { | 19 | namespace ops { |
| @@ -62,10 +63,9 @@ public: | |||
| 62 | .NeedCheckSupportFlag(false) | 63 | .NeedCheckSupportFlag(false) |
| 63 | .PrecisionReduceFlag(true) | 64 | .PrecisionReduceFlag(true) |
| 64 | .ExtendCfgInfo("opFile.value", "reverse_v2_apt"); | 65 | .ExtendCfgInfo("opFile.value", "reverse_v2_apt"); |
| 65 | - this->AICore().AddConfig("ascend950", aicoreConfig); | 66 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicoreConfig); |
| 66 | - this->AICore().AddConfig("ascend350", aicoreConfig); | 67 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfig); |
| 67 | - this->AICore().AddConfig("ascend960dt", aicoreConfig); | 68 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicoreConfig); |
| 68 | - this->AICore().AddConfig("ascend960pr", aicoreConfig); | ||
| 69 | } | 69 | } |
| 70 | }; | 70 | }; |
| 71 | OP_ADD(ReverseV2); | 71 | OP_ADD(ReverseV2); |
| @@ -8,10 +8,10 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend960dt" "ascend960pr" "ascend350") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") |
| 15 | 15 | ||
| 16 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} | 16 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} |
| 17 | OPTYPE scatter ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) | 17 | OPTYPE scatter ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) |
| @@ -13,6 +13,7 @@ | |||
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | #include <vector> | 15 | #include <vector> |
| 16 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 16 | #include "register/op_def_registry.h" | 17 | #include "register/op_def_registry.h" |
| 17 | 18 | ||
| 18 | namespace ops { | 19 | namespace ops { |
| @@ -59,10 +60,9 @@ public: | |||
| 59 | .NeedCheckSupportFlag(false) | 60 | .NeedCheckSupportFlag(false) |
| 60 | .PrecisionReduceFlag(true) | 61 | .PrecisionReduceFlag(true) |
| 61 | .ExtendCfgInfo("opFile.value", "scatter_apt"); | 62 | .ExtendCfgInfo("opFile.value", "scatter_apt"); |
| 62 | - this->AICore().AddConfig("ascend950", aicoreConfig); | 63 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicoreConfig); |
| 63 | - this->AICore().AddConfig("ascend960dt", aicoreConfig); | 64 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfig); |
| 64 | - this->AICore().AddConfig("ascend960pr", aicoreConfig); | 65 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicoreConfig); |
| 65 | - this->AICore().AddConfig("ascend350", aicoreConfig); | ||
| 66 | } | 66 | } |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| @@ -11,14 +11,14 @@ | |||
| 11 | # A5(arch35) 使用 arch35 目录下的 scatter_apt.cpp 作为 kernel 入口 | 11 | # A5(arch35) 使用 arch35 目录下的 scatter_apt.cpp 作为 kernel 入口 |
| 12 | add_kernel_sources( | 12 | add_kernel_sources( |
| 13 | KERNEL_SRC arch35/scatter_apt.cpp | 13 | KERNEL_SRC arch35/scatter_apt.cpp |
| 14 | - COMPUTE_UNITS ascend950 ascend350 | 14 | + COMPUTE_UNITS dav_3510 |
| 15 | AUTO_SYNC false | 15 | AUTO_SYNC false |
| 16 | IMPL_MODE high_performance,optional | 16 | IMPL_MODE high_performance,optional |
| 17 | ) | 17 | ) |
| 18 | # A6(arch92) 使用 arch92 目录下的入口,支持 128b dtype 提升与 SIMD scatter DMA 模板 | 18 | # A6(arch92) 使用 arch92 目录下的入口,支持 128b dtype 提升与 SIMD scatter DMA 模板 |
| 19 | add_kernel_sources( | 19 | add_kernel_sources( |
| 20 | KERNEL_SRC arch92/scatter_apt.cpp | 20 | KERNEL_SRC arch92/scatter_apt.cpp |
| 21 | - COMPUTE_UNITS ascend960dt ascend960pr | 21 | + COMPUTE_UNITS dav_9201 dav_9202 |
| 22 | AUTO_SYNC false | 22 | AUTO_SYNC false |
| 23 | IMPL_MODE high_performance,optional | 23 | IMPL_MODE high_performance,optional |
| 24 | ) | 24 | ) |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_add ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES linear_index scatter_elements_v2 scatter_update tf_scatter_add scatter_nd_add) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_add ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES linear_index scatter_elements_v2 scatter_update tf_scatter_add scatter_nd_add) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file scatter_add_def.cpp | 12 | * \file scatter_add_def.cpp |
| 13 | * \brief scatter_add_def | 13 | * \brief scatter_add_def |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -64,10 +65,9 @@ public: | |||
| 64 | .DynamicRankSupportFlag(true) | 65 | .DynamicRankSupportFlag(true) |
| 65 | .DynamicShapeSupportFlag(true) | 66 | .DynamicShapeSupportFlag(true) |
| 66 | .NeedCheckSupportFlag(false); | 67 | .NeedCheckSupportFlag(false); |
| 67 | - this->AICore().AddConfig("ascend950", aicoreConfig); | 68 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicoreConfig); |
| 68 | - this->AICore().AddConfig("ascend350", aicoreConfig); | 69 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfig); |
| 69 | - this->AICore().AddConfig("ascend960dt", aicoreConfig); | 70 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicoreConfig); |
| 70 | - this->AICore().AddConfig("ascend960pr", aicoreConfig); | ||
| 71 | } | 71 | } |
| 72 | }; | 72 | }; |
| 73 | 73 | ||
| @@ -14,7 +14,7 @@ | |||
| 14 | # 编译器自动插入的同步与 kernel 末尾全量 dcache flush | 14 | # 编译器自动插入的同步与 kernel 末尾全量 dcache flush |
| 15 | add_kernel_sources( | 15 | add_kernel_sources( |
| 16 | KERNEL_SRC arch35/scatter_add.cpp | 16 | KERNEL_SRC arch35/scatter_add.cpp |
| 17 | - COMPUTE_UNITS ascend950 ascend350 | 17 | + COMPUTE_UNITS dav_3510 |
| 18 | IMPL_MODE high_precision,support_out_of_bound_index,optional | 18 | IMPL_MODE high_precision,support_out_of_bound_index,optional |
| 19 | AUTO_SYNC false | 19 | AUTO_SYNC false |
| 20 | OPTIONS "--cce-no-dcache-flush" | 20 | OPTIONS "--cce-no-dcache-flush" |
| @@ -22,7 +22,7 @@ add_kernel_sources( | |||
| 22 | # A6(arch92) 使用 arch92 目录下的入口(复用 arch35 原子头 + arch92 scatter_dma 模板) | 22 | # A6(arch92) 使用 arch92 目录下的入口(复用 arch35 原子头 + arch92 scatter_dma 模板) |
| 23 | add_kernel_sources( | 23 | add_kernel_sources( |
| 24 | KERNEL_SRC arch92/scatter_add.cpp | 24 | KERNEL_SRC arch92/scatter_add.cpp |
| 25 | - COMPUTE_UNITS ascend960dt ascend960pr | 25 | + COMPUTE_UNITS dav_9201 dav_9202 |
| 26 | IMPL_MODE high_precision,support_out_of_bound_index,optional | 26 | IMPL_MODE high_precision,support_out_of_bound_index,optional |
| 27 | AUTO_SYNC false | 27 | AUTO_SYNC false |
| 28 | OPTIONS "--cce-no-dcache-flush" | 28 | OPTIONS "--cce-no-dcache-flush" |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file scatter_add_with_sorted_def.cpp | 12 | * \file scatter_add_with_sorted_def.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -100,10 +101,9 @@ public: | |||
| 100 | .DynamicFormatFlag(true) | 101 | .DynamicFormatFlag(true) |
| 101 | .DynamicRankSupportFlag(true) | 102 | .DynamicRankSupportFlag(true) |
| 102 | .DynamicShapeSupportFlag(true); | 103 | .DynamicShapeSupportFlag(true); |
| 103 | - this->AICore().AddConfig("ascend950", config_950); | 104 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, config_950); |
| 104 | - this->AICore().AddConfig("ascend350", config_950); | 105 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, config_950); |
| 105 | - this->AICore().AddConfig("ascend960dt", config_950); | 106 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, config_950); |
| 106 | - this->AICore().AddConfig("ascend960pr", config_950); | ||
| 107 | 107 | ||
| 108 | OpAICoreConfig config_kirin = GetKirinCoreConfig(); | 108 | OpAICoreConfig config_kirin = GetKirinCoreConfig(); |
| 109 | this->AICore().AddConfig("kirinx90", config_kirin); | 109 | this->AICore().AddConfig("kirinx90", config_kirin); |
| @@ -10,5 +10,5 @@ | |||
| 10 | 10 | ||
| 11 | add_kernel_sources( | 11 | add_kernel_sources( |
| 12 | KERNEL_SRC arch35/scatter_add_with_sorted.cpp | 12 | KERNEL_SRC arch35/scatter_add_with_sorted.cpp |
| 13 | - COMPUTE_UNITS ascend950 ascend350 ascend960dt ascend960pr | 13 | + COMPUTE_UNITS dav_3510 dav_9201 dav_9202 |
| 14 | ) | 14 | ) |
| @@ -8,15 +8,15 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "mc62" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "mc62" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_elements ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES scatter_elements_v2 scatter_update tf_scatter_add scatter_nd_add sort_lib HOSTCPU TRUE) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_elements ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES scatter_elements_v2 scatter_update tf_scatter_add scatter_nd_add sort_lib HOSTCPU TRUE) |
| 16 | 16 | ||
| 17 | add_kernel_sources( | 17 | add_kernel_sources( |
| 18 | KERNEL_SRC scatter_elements_apt.cpp | 18 | KERNEL_SRC scatter_elements_apt.cpp |
| 19 | - COMPUTE_UNITS ascend960dt ascend960pr | 19 | + COMPUTE_UNITS dav_9201 dav_9202 |
| 20 | AUTO_SYNC false | 20 | AUTO_SYNC false |
| 21 | OPTIONS "--cce-no-dcache-flush" | 21 | OPTIONS "--cce-no-dcache-flush" |
| 22 | ) | 22 | ) |
| @@ -13,6 +13,7 @@ | |||
| 13 | * \brief scatter_elements_def | 13 | * \brief scatter_elements_def |
| 14 | */ | 14 | */ |
| 15 | #include <vector> | 15 | #include <vector> |
| 16 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 16 | #include "register/op_def_registry.h" | 17 | #include "register/op_def_registry.h" |
| 17 | 18 | ||
| 18 | namespace ops { | 19 | namespace ops { |
| @@ -73,10 +74,9 @@ public: | |||
| 73 | .DynamicShapeSupportFlag(true) | 74 | .DynamicShapeSupportFlag(true) |
| 74 | .NeedCheckSupportFlag(false) | 75 | .NeedCheckSupportFlag(false) |
| 75 | .ExtendCfgInfo("opFile.value", "scatter_elements_apt"); | 76 | .ExtendCfgInfo("opFile.value", "scatter_elements_apt"); |
| 76 | - this->AICore().AddConfig("ascend950", aicoreConfig); | 77 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicoreConfig); |
| 77 | - this->AICore().AddConfig("ascend350", aicoreConfig); | 78 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfig); |
| 78 | - this->AICore().AddConfig("ascend960dt", aicoreConfig); | 79 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicoreConfig); |
| 79 | - this->AICore().AddConfig("ascend960pr", aicoreConfig); | ||
| 80 | } | 80 | } |
| 81 | }; | 81 | }; |
| 82 | 82 | ||
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend910b" "ascend910_93" "ascend310p" "ascend950" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "ascend910b" "ascend910_93" "ascend310p" "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch22" "arch22" "arch22" "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch22" "arch22" "arch22" "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_elements_v2 ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES linear_index scatter_add_with_sorted scatter_add scatter_update scatter_elements sort_lib) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_elements_v2 ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES linear_index scatter_add_with_sorted scatter_add scatter_update scatter_elements sort_lib) |
| @@ -13,6 +13,7 @@ | |||
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | +#include "op_common/op_host/util/op_const_def.h" | ||
| 16 | #include "scatter_elements_v2_asc_tiling.h" | 17 | #include "scatter_elements_v2_asc_tiling.h" |
| 17 | #include <vector> | 18 | #include <vector> |
| 18 | #include "register/op_def_registry.h" | 19 | #include "register/op_def_registry.h" |
| @@ -173,8 +174,8 @@ ge::graphStatus ScatterElementsV2AscTiling::GetShapeAttrsInfo() | |||
| 173 | if (!isScalarUpdates_ && reduction_ == REDUCTION_ADD && dtype_ == ge::DT_INT64 && dataShape.GetDimNum() == 1 && | 174 | if (!isScalarUpdates_ && reduction_ == REDUCTION_ADD && dtype_ == ge::DT_INT64 && dataShape.GetDimNum() == 1 && |
| 174 | dataAxis_ > 0 && allAxis_ > 0 && (allAxis_ - 1) / dataAxis_ >= INT64_LOCAL_ADD_REPEAT_RATIO) { | 175 | dataAxis_ > 0 && allAxis_ > 0 && (allAxis_ - 1) / dataAxis_ >= INT64_LOCAL_ADD_REPEAT_RATIO) { |
| 175 | auto* platformInfo = context_->GetPlatformInfo(); | 176 | auto* platformInfo = context_->GetPlatformInfo(); |
| 176 | - if (platformInfo != nullptr && platform_ascendc::PlatformAscendC(platformInfo).GetSocVersion() == | 177 | + if (platformInfo != nullptr && |
| 177 | - platform_ascendc::SocVersion::ASCEND950) { | 178 | + platform_ascendc::PlatformAscendC(platformInfo).GetCurNpuArch() == Ops::Base::DAV_3510) { |
| 178 | isDeterministic_ = 1; | 179 | isDeterministic_ = 1; |
| 179 | } | 180 | } |
| 180 | } | 181 | } |
| @@ -15,6 +15,7 @@ | |||
| 15 | * \file scatter_elements_v2_def.cpp | 15 | * \file scatter_elements_v2_def.cpp |
| 16 | * \brief | 16 | * \brief |
| 17 | */ | 17 | */ |
| 18 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 18 | #include "register/op_def_registry.h" | 19 | #include "register/op_def_registry.h" |
| 19 | 20 | ||
| 20 | namespace ops { | 21 | namespace ops { |
| @@ -169,10 +170,9 @@ public: | |||
| 169 | .DynamicShapeSupportFlag(true) | 170 | .DynamicShapeSupportFlag(true) |
| 170 | .NeedCheckSupportFlag(false) | 171 | .NeedCheckSupportFlag(false) |
| 171 | .ExtendCfgInfo("opFile.value", "scatter_elements_v2_apt"); | 172 | .ExtendCfgInfo("opFile.value", "scatter_elements_v2_apt"); |
| 172 | - this->AICore().AddConfig("ascend950", aiCoreConfig); | 173 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aiCoreConfig); |
| 173 | - this->AICore().AddConfig("ascend350", aiCoreConfig); | 174 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aiCoreConfig); |
| 174 | - this->AICore().AddConfig("ascend960dt", aiCoreConfig); | 175 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aiCoreConfig); |
| 175 | - this->AICore().AddConfig("ascend960pr", aiCoreConfig); | ||
| 176 | } | 176 | } |
| 177 | }; | 177 | }; |
| 178 | 178 | ||
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | add_kernel_sources( | 11 | add_kernel_sources( |
| 12 | KERNEL_SRC scatter_elements_v2_apt.cpp | 12 | KERNEL_SRC scatter_elements_v2_apt.cpp |
| 13 | - COMPUTE_UNITS ascend950 ascend960dt ascend960pr | 13 | + COMPUTE_UNITS dav_3510 dav_9201 dav_9202 |
| 14 | AUTO_SYNC false | 14 | AUTO_SYNC false |
| 15 | OPTIONS "--cce-simd-vf-fusion=false" | 15 | OPTIONS "--cce-simd-vf-fusion=false" |
| 16 | ) | 16 | ) |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend960dt" "ascend960pr" "mc62" "ascend350") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202" "mc62") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_nd ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES scatter_nd_update scatter_nd_add) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_nd ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES scatter_nd_update scatter_nd_add) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file scatter_nd_def.cpp | 12 | * \file scatter_nd_def.cpp |
| 13 | * \brief scatter_nd_def | 13 | * \brief scatter_nd_def |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -65,10 +66,9 @@ public: | |||
| 65 | .NeedCheckSupportFlag(false) | 66 | .NeedCheckSupportFlag(false) |
| 66 | .PrecisionReduceFlag(true) | 67 | .PrecisionReduceFlag(true) |
| 67 | .ExtendCfgInfo("opFile.value", "scatter_nd_apt"); | 68 | .ExtendCfgInfo("opFile.value", "scatter_nd_apt"); |
| 68 | - this->AICore().AddConfig("ascend950", aicoreConfig); | 69 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicoreConfig); |
| 69 | - this->AICore().AddConfig("ascend960dt", aicoreConfig); | 70 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfig); |
| 70 | - this->AICore().AddConfig("ascend960pr", aicoreConfig); | 71 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicoreConfig); |
| 71 | - this->AICore().AddConfig("ascend350", aicoreConfig); | ||
| 72 | } | 72 | } |
| 73 | }; | 73 | }; |
| 74 | OP_ADD(ScatterNd); | 74 | OP_ADD(ScatterNd); |
| @@ -11,10 +11,10 @@ | |||
| 11 | # A5(arch35) 使用 arch35 目录下的 scatter_nd_apt.cpp 作为 kernel 入口 | 11 | # A5(arch35) 使用 arch35 目录下的 scatter_nd_apt.cpp 作为 kernel 入口 |
| 12 | add_kernel_sources( | 12 | add_kernel_sources( |
| 13 | KERNEL_SRC arch35/scatter_nd_apt.cpp | 13 | KERNEL_SRC arch35/scatter_nd_apt.cpp |
| 14 | - COMPUTE_UNITS ascend950 ascend350 mc62 | 14 | + COMPUTE_UNITS dav_3510 mc62 |
| 15 | ) | 15 | ) |
| 16 | # A6(arch92) 使用 arch92 目录下的入口,额外引入 arch92 的 SIMD DMA 模板 | 16 | # A6(arch92) 使用 arch92 目录下的入口,额外引入 arch92 的 SIMD DMA 模板 |
| 17 | add_kernel_sources( | 17 | add_kernel_sources( |
| 18 | KERNEL_SRC arch92/scatter_nd_apt.cpp | 18 | KERNEL_SRC arch92/scatter_nd_apt.cpp |
| 19 | - COMPUTE_UNITS ascend960dt ascend960pr | 19 | + COMPUTE_UNITS dav_9201 dav_9202 |
| 20 | ) | 20 | ) |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "mc62" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "mc62" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_nd_add ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_nd_add ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file scatter_nd_add_def.cpp | 12 | * \file scatter_nd_add_def.cpp |
| 13 | * \brief ScatterNdAdd ophost | 13 | * \brief ScatterNdAdd ophost |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -59,10 +60,9 @@ public: | |||
| 59 | .DynamicShapeSupportFlag(true) | 60 | .DynamicShapeSupportFlag(true) |
| 60 | .NeedCheckSupportFlag(false) | 61 | .NeedCheckSupportFlag(false) |
| 61 | .PrecisionReduceFlag(true); | 62 | .PrecisionReduceFlag(true); |
| 62 | - this->AICore().AddConfig("ascend950", aicore_config); | 63 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicore_config); |
| 63 | - this->AICore().AddConfig("ascend350", aicore_config); | 64 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicore_config); |
| 64 | - this->AICore().AddConfig("ascend960dt", aicore_config); | 65 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicore_config); |
| 65 | - this->AICore().AddConfig("ascend960pr", aicore_config); | ||
| 66 | } | 66 | } |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| @@ -14,7 +14,7 @@ | |||
| 14 | # 编译器自动插入的同步与 kernel 末尾全量 dcache flush | 14 | # 编译器自动插入的同步与 kernel 末尾全量 dcache flush |
| 15 | add_kernel_sources( | 15 | add_kernel_sources( |
| 16 | KERNEL_SRC arch35/scatter_nd_add.cpp | 16 | KERNEL_SRC arch35/scatter_nd_add.cpp |
| 17 | - COMPUTE_UNITS ascend950 mc62 ascend350 | 17 | + COMPUTE_UNITS dav_3510 mc62 |
| 18 | IMPL_MODE high_precision,support_out_of_bound_index,optional | 18 | IMPL_MODE high_precision,support_out_of_bound_index,optional |
| 19 | AUTO_SYNC false | 19 | AUTO_SYNC false |
| 20 | OPTIONS "--cce-no-dcache-flush" | 20 | OPTIONS "--cce-no-dcache-flush" |
| @@ -22,7 +22,7 @@ add_kernel_sources( | |||
| 22 | # A6(arch92) 使用 arch92 目录下的入口(复用 arch35 原子头 + arch92 simd_dma 模板) | 22 | # A6(arch92) 使用 arch92 目录下的入口(复用 arch35 原子头 + arch92 simd_dma 模板) |
| 23 | add_kernel_sources( | 23 | add_kernel_sources( |
| 24 | KERNEL_SRC arch92/scatter_nd_add.cpp | 24 | KERNEL_SRC arch92/scatter_nd_add.cpp |
| 25 | - COMPUTE_UNITS ascend960dt ascend960pr | 25 | + COMPUTE_UNITS dav_9201 dav_9202 |
| 26 | IMPL_MODE high_precision,support_out_of_bound_index,optional | 26 | IMPL_MODE high_precision,support_out_of_bound_index,optional |
| 27 | AUTO_SYNC false | 27 | AUTO_SYNC false |
| 28 | OPTIONS "--cce-no-dcache-flush" | 28 | OPTIONS "--cce-no-dcache-flush" |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_nd_max ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES scatter_nd_common) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_nd_max ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES scatter_nd_common) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file scatter_nd_max_def.cpp | 12 | * \file scatter_nd_max_def.cpp |
| 13 | * \brief ScatterNdMax ophost | 13 | * \brief ScatterNdMax ophost |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -83,10 +84,9 @@ public: | |||
| 83 | .NeedCheckSupportFlag(false) | 84 | .NeedCheckSupportFlag(false) |
| 84 | .PrecisionReduceFlag(true); | 85 | .PrecisionReduceFlag(true); |
| 85 | 86 | ||
| 86 | - this->AICore().AddConfig("ascend950", aicore_config); | 87 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicore_config); |
| 87 | - this->AICore().AddConfig("ascend350", aicore_config); | 88 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicore_config); |
| 88 | - this->AICore().AddConfig("ascend960dt", aicore_config); | 89 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicore_config); |
| 89 | - this->AICore().AddConfig("ascend960pr", aicore_config); | ||
| 90 | } | 90 | } |
| 91 | }; | 91 | }; |
| 92 | 92 | ||
| @@ -10,6 +10,6 @@ | |||
| 10 | 10 | ||
| 11 | add_kernel_sources( | 11 | add_kernel_sources( |
| 12 | KERNEL_SRC arch35/scatter_nd_max.cpp | 12 | KERNEL_SRC arch35/scatter_nd_max.cpp |
| 13 | - COMPUTE_UNITS ascend950 ascend350 ascend960dt ascend960pr | 13 | + COMPUTE_UNITS dav_3510 dav_9201 dav_9202 |
| 14 | OPTIONS "--cce-no-dcache-flush" | 14 | OPTIONS "--cce-no-dcache-flush" |
| 15 | ) | 15 | ) |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_nd_min ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES scatter_nd_common) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_nd_min ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES scatter_nd_common) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file scatter_nd_min_def.cpp | 12 | * \file scatter_nd_min_def.cpp |
| 13 | * \brief ScatterNdMin ophost | 13 | * \brief ScatterNdMin ophost |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -83,10 +84,9 @@ public: | |||
| 83 | .NeedCheckSupportFlag(false) | 84 | .NeedCheckSupportFlag(false) |
| 84 | .PrecisionReduceFlag(true); | 85 | .PrecisionReduceFlag(true); |
| 85 | 86 | ||
| 86 | - this->AICore().AddConfig("ascend950", aicore_config); | 87 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicore_config); |
| 87 | - this->AICore().AddConfig("ascend350", aicore_config); | 88 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicore_config); |
| 88 | - this->AICore().AddConfig("ascend960dt", aicore_config); | 89 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicore_config); |
| 89 | - this->AICore().AddConfig("ascend960pr", aicore_config); | ||
| 90 | } | 90 | } |
| 91 | }; | 91 | }; |
| 92 | 92 | ||
| @@ -10,6 +10,6 @@ | |||
| 10 | 10 | ||
| 11 | add_kernel_sources( | 11 | add_kernel_sources( |
| 12 | KERNEL_SRC arch35/scatter_nd_min.cpp | 12 | KERNEL_SRC arch35/scatter_nd_min.cpp |
| 13 | - COMPUTE_UNITS ascend950 ascend350 ascend960dt ascend960pr | 13 | + COMPUTE_UNITS dav_3510 dav_9201 dav_9202 |
| 14 | OPTIONS "--cce-no-dcache-flush" | 14 | OPTIONS "--cce-no-dcache-flush" |
| 15 | ) | 15 | ) |
| @@ -8,10 +8,10 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "mc62" "ascend910b" "ascend910_93" "ascend350" "ascend960dt" "ascend960pr" "ascend5162" "kirinx90" "kirin9030") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "mc62" "ascend910b" "ascend910_93" "dav_9201" "dav_9202" "ascend5162" "kirinx90" "kirin9030") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch22" "arch22" "arch35" "arch35" "arch35" "arch35" "arch22" "arch22") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch22" "arch22" "arch35" "arch35" "arch35" "arch22" "arch22") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_nd_update ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES scatter_nd_add) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_nd_update ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES scatter_nd_add) |
| 16 | 16 | ||
| 17 | # kirinx90/kirin9030 使用 scatter_nd_update.cpp 作为 kernel 入口 | 17 | # kirinx90/kirin9030 使用 scatter_nd_update.cpp 作为 kernel 入口 |
| @@ -13,6 +13,7 @@ | |||
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | +#include "op_common/op_host/util/op_const_def.h" | ||
| 16 | #include "aclnn_scatter_nd_update.h" | 17 | #include "aclnn_scatter_nd_update.h" |
| 17 | #include "scatter_nd_update.h" | 18 | #include "scatter_nd_update.h" |
| 18 | #include "level0/broadcast_to.h" | 19 | #include "level0/broadcast_to.h" |
| @@ -63,10 +64,10 @@ static bool CheckNotNull(aclTensor* varRef, const aclTensor* indices, const aclT | |||
| 63 | static const std::initializer_list<DataType>& GetDtypeSupportList() | 64 | static const std::initializer_list<DataType>& GetDtypeSupportList() |
| 64 | { | 65 | { |
| 65 | auto socVersion = op::GetCurrentPlatformInfo().GetCurNpuArch(); | 66 | auto socVersion = op::GetCurrentPlatformInfo().GetCurNpuArch(); |
| 66 | - if (socVersion == NpuArch::DAV_9201 || socVersion == NpuArch::DAV_9202) { | 67 | + if (socVersion == Ops::Base::DAV_9201 || socVersion == Ops::Base::DAV_9202) { |
| 67 | return ASCEND960_DTYPE_DTYPE_SUPPORT_LIST; | 68 | return ASCEND960_DTYPE_DTYPE_SUPPORT_LIST; |
| 68 | } | 69 | } |
| 69 | - if (socVersion == NpuArch::DAV_3510) { | 70 | + if (socVersion == Ops::Base::DAV_3510) { |
| 70 | return ASCEND950_DTYPE_DTYPE_SUPPORT_LIST; | 71 | return ASCEND950_DTYPE_DTYPE_SUPPORT_LIST; |
| 71 | } | 72 | } |
| 72 | if (GetCurrentPlatformInfo().GetSocVersion() >= SocVersion::ASCEND910B && | 73 | if (GetCurrentPlatformInfo().GetSocVersion() >= SocVersion::ASCEND910B && |
| @@ -389,7 +390,7 @@ aclnnStatus aclnnScatterNdUpdateGetWorkspaceSize(aclTensor* varRef, const aclTen | |||
| 389 | bool dimCheck = (indicesDimNum > 0 && indexAxisNum <= MAX_INDICES_RANK); | 390 | bool dimCheck = (indicesDimNum > 0 && indexAxisNum <= MAX_INDICES_RANK); |
| 390 | 391 | ||
| 391 | if (dimCheck) { | 392 | if (dimCheck) { |
| 392 | - if (socVersion == NpuArch::DAV_3510 && IsSupportNonContiguous(varRef, indexAxisNum)) { | 393 | + if (socVersion == Ops::Base::DAV_3510 && IsSupportNonContiguous(varRef, indexAxisNum)) { |
| 393 | // arch35:非索引轴连续,索引轴非连续 → 通用 view 优化路径 | 394 | // arch35:非索引轴连续,索引轴非连续 → 通用 view 优化路径 |
| 394 | return ProcessNonContiguousCase(varRef, indices, updates, workspaceSize, executor, uniqueExecutor); | 395 | return ProcessNonContiguousCase(varRef, indices, updates, workspaceSize, executor, uniqueExecutor); |
| 395 | } | 396 | } |
| @@ -11,6 +11,7 @@ | |||
| 11 | * \file scatter_nd_update.cpp | 11 | * \file scatter_nd_update.cpp |
| 12 | * \brief ScatterNdUpdate ophost | 12 | * \brief ScatterNdUpdate ophost |
| 13 | */ | 13 | */ |
| 14 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 14 | #include "register/op_def_registry.h" | 15 | #include "register/op_def_registry.h" |
| 15 | // opbuild 工具编译 def 时仅注入工具链 include(无仓根 -I),须用相对路径引用仓内公共头 | 16 | // opbuild 工具编译 def 时仅注入工具链 include(无仓根 -I),须用相对路径引用仓内公共头 |
| 16 | #include "../../../common/inc/op_host/op_const_def_nn.h" | 17 | #include "../../../common/inc/op_host/op_const_def_nn.h" |
| @@ -85,8 +86,7 @@ public: | |||
| 85 | .NeedCheckSupportFlag(false) | 86 | .NeedCheckSupportFlag(false) |
| 86 | .PrecisionReduceFlag(true) | 87 | .PrecisionReduceFlag(true) |
| 87 | .ExtendCfgInfo("opFile.value", "scatter_nd_update_apt"); | 88 | .ExtendCfgInfo("opFile.value", "scatter_nd_update_apt"); |
| 88 | - this->AICore().AddConfig("ascend950", aicore_config); | 89 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicore_config); |
| 89 | - this->AICore().AddConfig("ascend350", aicore_config); | ||
| 90 | this->AICore().AddConfig("ascend5162", aicore_config); | 90 | this->AICore().AddConfig("ascend5162", aicore_config); |
| 91 | 91 | ||
| 92 | OpAICoreConfig aicoreConfigArch35Hif4; | 92 | OpAICoreConfig aicoreConfigArch35Hif4; |
| @@ -163,8 +163,8 @@ public: | |||
| 163 | .NeedCheckSupportFlag(false) | 163 | .NeedCheckSupportFlag(false) |
| 164 | .PrecisionReduceFlag(true) | 164 | .PrecisionReduceFlag(true) |
| 165 | .ExtendCfgInfo("opFile.value", "scatter_nd_update_apt"); | 165 | .ExtendCfgInfo("opFile.value", "scatter_nd_update_apt"); |
| 166 | - this->AICore().AddConfig("ascend960dt", aicoreConfigArch35Hif4); | 166 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfigArch35Hif4); |
| 167 | - this->AICore().AddConfig("ascend960pr", aicoreConfigArch35Hif4); | 167 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicoreConfigArch35Hif4); |
| 168 | 168 | ||
| 169 | OpAICoreConfig aicoreConfigArch22; | 169 | OpAICoreConfig aicoreConfigArch22; |
| 170 | aicoreConfigArch22.Input("var") | 170 | aicoreConfigArch22.Input("var") |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_sub ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES linear_index scatter_elements_v2 scatter_update tf_scatter_add scatter_nd_add) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_sub ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES linear_index scatter_elements_v2 scatter_update tf_scatter_add scatter_nd_add) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file scatter_sub_def.cpp | 12 | * \file scatter_sub_def.cpp |
| 13 | * \brief scatter_sub_def | 13 | * \brief scatter_sub_def |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -64,9 +65,8 @@ public: | |||
| 64 | .DynamicRankSupportFlag(true) | 65 | .DynamicRankSupportFlag(true) |
| 65 | .DynamicShapeSupportFlag(true) | 66 | .DynamicShapeSupportFlag(true) |
| 66 | .NeedCheckSupportFlag(false); | 67 | .NeedCheckSupportFlag(false); |
| 67 | - this->AICore().AddConfig("ascend950", aicoreConfig); | 68 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicoreConfig); |
| 68 | - this->AICore().AddConfig("ascend350", aicoreConfig); | 69 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfig); |
| 69 | - this->AICore().AddConfig("ascend960dt", aicoreConfig); | ||
| 70 | } | 70 | } |
| 71 | }; | 71 | }; |
| 72 | 72 | ||
| @@ -14,7 +14,7 @@ | |||
| 14 | # 编译器自动插入的同步与 kernel 末尾全量 dcache flush | 14 | # 编译器自动插入的同步与 kernel 末尾全量 dcache flush |
| 15 | add_kernel_sources( | 15 | add_kernel_sources( |
| 16 | KERNEL_SRC arch35/scatter_sub.cpp | 16 | KERNEL_SRC arch35/scatter_sub.cpp |
| 17 | - COMPUTE_UNITS ascend950 ascend350 | 17 | + COMPUTE_UNITS dav_3510 |
| 18 | IMPL_MODE high_precision,support_out_of_bound_index,optional | 18 | IMPL_MODE high_precision,support_out_of_bound_index,optional |
| 19 | AUTO_SYNC false | 19 | AUTO_SYNC false |
| 20 | OPTIONS "--cce-no-dcache-flush" | 20 | OPTIONS "--cce-no-dcache-flush" |
| @@ -22,7 +22,7 @@ add_kernel_sources( | |||
| 22 | # A6(arch92) 使用 arch92 目录下的入口(复用 scatter_add 的 arch35 原子头与 arch92 scatter_dma 模板) | 22 | # A6(arch92) 使用 arch92 目录下的入口(复用 scatter_add 的 arch35 原子头与 arch92 scatter_dma 模板) |
| 23 | add_kernel_sources( | 23 | add_kernel_sources( |
| 24 | KERNEL_SRC arch92/scatter_sub.cpp | 24 | KERNEL_SRC arch92/scatter_sub.cpp |
| 25 | - COMPUTE_UNITS ascend960dt | 25 | + COMPUTE_UNITS dav_9201 |
| 26 | IMPL_MODE high_precision,support_out_of_bound_index,optional | 26 | IMPL_MODE high_precision,support_out_of_bound_index,optional |
| 27 | AUTO_SYNC false | 27 | AUTO_SYNC false |
| 28 | OPTIONS "--cce-no-dcache-flush" | 28 | OPTIONS "--cce-no-dcache-flush" |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_update ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DEPENDENCIES index_put_v2) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE scatter_update ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DEPENDENCIES index_put_v2) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file scatter_update.cpp | 12 | * \file scatter_update.cpp |
| 13 | * \brief scatter_update | 13 | * \brief scatter_update |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | #include "../../../common/inc/op_host/op_const_def_nn.h" | 17 | #include "../../../common/inc/op_host/op_const_def_nn.h" |
| 17 | 18 | ||
| @@ -82,8 +83,7 @@ public: | |||
| 82 | .DynamicShapeSupportFlag(true) | 83 | .DynamicShapeSupportFlag(true) |
| 83 | .NeedCheckSupportFlag(false) | 84 | .NeedCheckSupportFlag(false) |
| 84 | .PrecisionReduceFlag(true); | 85 | .PrecisionReduceFlag(true); |
| 85 | - this->AICore().AddConfig("ascend950", aicore_config); | 86 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicore_config); |
| 86 | - this->AICore().AddConfig("ascend350", aicore_config); | ||
| 87 | OpAICoreConfig aiCoreConfig; | 87 | OpAICoreConfig aiCoreConfig; |
| 88 | aiCoreConfig.Input("var") | 88 | aiCoreConfig.Input("var") |
| 89 | .ParamType(REQUIRED) | 89 | .ParamType(REQUIRED) |
| @@ -114,8 +114,8 @@ public: | |||
| 114 | .DynamicShapeSupportFlag(true) | 114 | .DynamicShapeSupportFlag(true) |
| 115 | .NeedCheckSupportFlag(false) | 115 | .NeedCheckSupportFlag(false) |
| 116 | .PrecisionReduceFlag(true); | 116 | .PrecisionReduceFlag(true); |
| 117 | - this->AICore().AddConfig("ascend960dt", aiCoreConfig); | 117 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aiCoreConfig); |
| 118 | - this->AICore().AddConfig("ascend960pr", aiCoreConfig); | 118 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aiCoreConfig); |
| 119 | } | 119 | } |
| 120 | }; | 120 | }; |
| 121 | 121 | ||
| @@ -14,7 +14,7 @@ | |||
| 14 | # support_out_of_bound_index 两套二进制在 ascend950/ascend350 上丢失(功能回退)。 | 14 | # support_out_of_bound_index 两套二进制在 ascend950/ascend350 上丢失(功能回退)。 |
| 15 | add_kernel_sources( | 15 | add_kernel_sources( |
| 16 | KERNEL_SRC arch35/scatter_update.cpp | 16 | KERNEL_SRC arch35/scatter_update.cpp |
| 17 | - COMPUTE_UNITS ascend950 ascend350 | 17 | + COMPUTE_UNITS dav_3510 |
| 18 | IMPL_MODE high_performance,high_precision,support_out_of_bound_index | 18 | IMPL_MODE high_performance,high_precision,support_out_of_bound_index |
| 19 | AUTO_SYNC false | 19 | AUTO_SYNC false |
| 20 | OPTIONS "--cce-no-dcache-flush" | 20 | OPTIONS "--cce-no-dcache-flush" |
| @@ -22,7 +22,7 @@ add_kernel_sources( | |||
| 22 | # A6(arch92) 使用 arch92 目录下的入口,额外引入 arch92 的 SIMD_SCATTER_DMA 模板 | 22 | # A6(arch92) 使用 arch92 目录下的入口,额外引入 arch92 的 SIMD_SCATTER_DMA 模板 |
| 23 | add_kernel_sources( | 23 | add_kernel_sources( |
| 24 | KERNEL_SRC arch92/scatter_update.cpp | 24 | KERNEL_SRC arch92/scatter_update.cpp |
| 25 | - COMPUTE_UNITS ascend960dt ascend960pr | 25 | + COMPUTE_UNITS dav_9201 dav_9202 |
| 26 | IMPL_MODE high_performance,high_precision,support_out_of_bound_index | 26 | IMPL_MODE high_performance,high_precision,support_out_of_bound_index |
| 27 | AUTO_SYNC false | 27 | AUTO_SYNC false |
| 28 | OPTIONS "--cce-no-dcache-flush" | 28 | OPTIONS "--cce-no-dcache-flush" |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend960dt" "ascend960pr" "ascend350") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} OPTYPE segment_sum ACLNNTYPE aclnn_exclude) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} OPTYPE segment_sum ACLNNTYPE aclnn_exclude) |
| @@ -13,6 +13,7 @@ | |||
| 13 | * \brief segment_sum op host config | 13 | * \brief segment_sum op host config |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 16 | #include "register/op_def_registry.h" | 17 | #include "register/op_def_registry.h" |
| 17 | 18 | ||
| 18 | namespace ops { | 19 | namespace ops { |
| @@ -46,10 +47,9 @@ public: | |||
| 46 | .DynamicShapeSupportFlag(true) | 47 | .DynamicShapeSupportFlag(true) |
| 47 | .NeedCheckSupportFlag(false) | 48 | .NeedCheckSupportFlag(false) |
| 48 | .ExtendCfgInfo("opFile.value", "segment_sum_apt"); | 49 | .ExtendCfgInfo("opFile.value", "segment_sum_apt"); |
| 49 | - this->AICore().AddConfig("ascend950", aicoreConfig); | 50 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicoreConfig); |
| 50 | - this->AICore().AddConfig("ascend960dt", aicoreConfig); | 51 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfig); |
| 51 | - this->AICore().AddConfig("ascend960pr", aicoreConfig); | 52 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicoreConfig); |
| 52 | - this->AICore().AddConfig("ascend350", aicoreConfig); | ||
| 53 | } | 53 | } |
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} OPTYPE sorted_sparse_segment_mean_grad ACLNNTYPE aclnn_exclude) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} OPTYPE sorted_sparse_segment_mean_grad ACLNNTYPE aclnn_exclude) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file sorted_sparse_segment_mean_grad.cpp | 12 | * \file sorted_sparse_segment_mean_grad.cpp |
| 13 | * \brief SortedSparseSegmentMeanGrad ophost | 13 | * \brief SortedSparseSegmentMeanGrad ophost |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -119,10 +120,9 @@ public: | |||
| 119 | .DynamicShapeSupportFlag(true) | 120 | .DynamicShapeSupportFlag(true) |
| 120 | .NeedCheckSupportFlag(false) | 121 | .NeedCheckSupportFlag(false) |
| 121 | .PrecisionReduceFlag(true); | 122 | .PrecisionReduceFlag(true); |
| 122 | - this->AICore().AddConfig("ascend950", aicore_config); | 123 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicore_config); |
| 123 | - this->AICore().AddConfig("ascend350", aicore_config); | 124 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicore_config); |
| 124 | - this->AICore().AddConfig("ascend960dt", aicore_config); | 125 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicore_config); |
| 125 | - this->AICore().AddConfig("ascend960pr", aicore_config); | ||
| 126 | } | 126 | } |
| 127 | }; | 127 | }; |
| 128 | 128 | ||
| @@ -11,7 +11,7 @@ | |||
| 11 | # A5/A6 均使用 arch35 目录下的 sorted_sparse_segment_mean_grad.cpp 作为 kernel 入口 | 11 | # A5/A6 均使用 arch35 目录下的 sorted_sparse_segment_mean_grad.cpp 作为 kernel 入口 |
| 12 | add_kernel_sources( | 12 | add_kernel_sources( |
| 13 | KERNEL_SRC arch35/sorted_sparse_segment_mean_grad.cpp | 13 | KERNEL_SRC arch35/sorted_sparse_segment_mean_grad.cpp |
| 14 | - COMPUTE_UNITS ascend950 ascend350 ascend960dt ascend960pr | 14 | + COMPUTE_UNITS dav_3510 dav_9201 dav_9202 |
| 15 | AUTO_SYNC false | 15 | AUTO_SYNC false |
| 16 | OPTIONS "--cce-no-dcache-flush" | 16 | OPTIONS "--cce-no-dcache-flush" |
| 17 | ) | 17 | ) |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} OPTYPE sparse_segment_mean ACLNNTYPE aclnn_exclude HOSTCPU TRUE) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} OPTYPE sparse_segment_mean ACLNNTYPE aclnn_exclude HOSTCPU TRUE) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file sparse_segment_mean.cpp | 12 | * \file sparse_segment_mean.cpp |
| 13 | * \brief SparseSegmentMean ophost | 13 | * \brief SparseSegmentMean ophost |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -63,10 +64,9 @@ public: | |||
| 63 | .NeedCheckSupportFlag(false) | 64 | .NeedCheckSupportFlag(false) |
| 64 | .PrecisionReduceFlag(true) | 65 | .PrecisionReduceFlag(true) |
| 65 | .ExtendCfgInfo("opFile.value", "sparse_segment_mean_apt"); | 66 | .ExtendCfgInfo("opFile.value", "sparse_segment_mean_apt"); |
| 66 | - this->AICore().AddConfig("ascend950", aicore_config); | 67 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicore_config); |
| 67 | - this->AICore().AddConfig("ascend350", aicore_config); | 68 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicore_config); |
| 68 | - this->AICore().AddConfig("ascend960dt", aicore_config); | 69 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicore_config); |
| 69 | - this->AICore().AddConfig("ascend960pr", aicore_config); | ||
| 70 | } | 70 | } |
| 71 | }; | 71 | }; |
| 72 | 72 | ||
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file sparse_to_dense_def.cpp | 12 | * \file sparse_to_dense_def.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -57,10 +58,9 @@ public: | |||
| 57 | .DynamicShapeSupportFlag(true) | 58 | .DynamicShapeSupportFlag(true) |
| 58 | .NeedCheckSupportFlag(false) | 59 | .NeedCheckSupportFlag(false) |
| 59 | .PrecisionReduceFlag(true); | 60 | .PrecisionReduceFlag(true); |
| 60 | - this->AICore().AddConfig("ascend950", aicore_config); | 61 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicore_config); |
| 61 | - this->AICore().AddConfig("ascend350", aicore_config); | 62 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicore_config); |
| 62 | - this->AICore().AddConfig("ascend960dt", aicore_config); | 63 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicore_config); |
| 63 | - this->AICore().AddConfig("ascend960pr", aicore_config); | ||
| 64 | } | 64 | } |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| @@ -11,5 +11,5 @@ | |||
| 11 | # 使用 sparse_to_dense.cpp 作为 kernel 入口 | 11 | # 使用 sparse_to_dense.cpp 作为 kernel 入口 |
| 12 | add_kernel_sources( | 12 | add_kernel_sources( |
| 13 | KERNEL_SRC sparse_to_dense.cpp | 13 | KERNEL_SRC sparse_to_dense.cpp |
| 14 | - COMPUTE_UNITS ascend950 ascend350 ascend960dt ascend960pr | 14 | + COMPUTE_UNITS dav_3510 dav_9201 dav_9202 |
| 15 | ) | 15 | ) |
| @@ -8,8 +8,8 @@ | |||
| 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 | +# DAV_3510及已有960平台按架构配置,其他平台保留原SoC项。 |
| 12 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr") | 12 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "dav_9201" "dav_9202") |
| 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 | 13 | # 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译 |
| 14 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35") | 14 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35") |
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE unsorted_segment_min ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES unsorted_segment_common) | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE unsorted_segment_min ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES unsorted_segment_common) |
| @@ -13,6 +13,7 @@ | |||
| 13 | * \brief unsorted_segment_min op host config | 13 | * \brief unsorted_segment_min op host config |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 16 | #include "register/op_def_registry.h" | 17 | #include "register/op_def_registry.h" |
| 17 | 18 | ||
| 18 | namespace ops { | 19 | namespace ops { |
| @@ -60,10 +61,9 @@ public: | |||
| 60 | .DynamicRankSupportFlag(true) | 61 | .DynamicRankSupportFlag(true) |
| 61 | .DynamicShapeSupportFlag(true) | 62 | .DynamicShapeSupportFlag(true) |
| 62 | .NeedCheckSupportFlag(false); | 63 | .NeedCheckSupportFlag(false); |
| 63 | - this->AICore().AddConfig("ascend950", aicoreConfig); | 64 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aicoreConfig); |
| 64 | - this->AICore().AddConfig("ascend350", aicoreConfig); | 65 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aicoreConfig); |
| 65 | - this->AICore().AddConfig("ascend960dt", aicoreConfig); | 66 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aicoreConfig); |
| 66 | - this->AICore().AddConfig("ascend960pr", aicoreConfig); | ||
| 67 | } | 67 | } |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | add_kernel_sources( | 12 | add_kernel_sources( |
| 13 | KERNEL_SRC unsorted_segment_min.cpp | 13 | KERNEL_SRC unsorted_segment_min.cpp |
| 14 | - COMPUTE_UNITS ascend950 ascend350 ascend960dt ascend960pr | 14 | + COMPUTE_UNITS dav_3510 dav_9201 dav_9202 |
| 15 | IMPL_MODE high_performance,high_precision,support_out_of_bound_index | 15 | IMPL_MODE high_performance,high_precision,support_out_of_bound_index |
| 16 | AUTO_SYNC false | 16 | AUTO_SYNC false |
| 17 | ) | 17 | ) |
| @@ -8,9 +8,9 @@ | |||
| 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 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "mc62" "ascend350" "ascend960dt" "ascend960pr" "ascend5162") | 11 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "mc62" "dav_9201" "dav_9202" "ascend5162") |
| 12 | 12 | ||
| 13 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35" "arch35") | 13 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35") |
| 14 | 14 | ||
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE avg_pool | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE avg_pool |
| 16 | ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES avg_pool_v2 pool_utils) | 16 | ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES avg_pool_v2 pool_utils) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file avg_pool_def.cpp | 12 | * \file avg_pool_def.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -45,10 +46,9 @@ public: | |||
| 45 | .NeedCheckSupportFlag(false) | 46 | .NeedCheckSupportFlag(false) |
| 46 | .PrecisionReduceFlag(true) | 47 | .PrecisionReduceFlag(true) |
| 47 | .ExtendCfgInfo("opFile.value", "avg_pool_apt"); | 48 | .ExtendCfgInfo("opFile.value", "avg_pool_apt"); |
| 48 | - this->AICore().AddConfig("ascend950", aiCoreConfig); | 49 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aiCoreConfig); |
| 49 | - this->AICore().AddConfig("ascend350", aiCoreConfig); | 50 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aiCoreConfig); |
| 50 | - this->AICore().AddConfig("ascend960dt", aiCoreConfig); | 51 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aiCoreConfig); |
| 51 | - this->AICore().AddConfig("ascend960pr", aiCoreConfig); | ||
| 52 | this->AICore().AddConfig("ascend5162", aiCoreConfig); | 52 | this->AICore().AddConfig("ascend5162", aiCoreConfig); |
| 53 | } | 53 | } |
| 54 | }; | 54 | }; |
| @@ -18,7 +18,7 @@ add_kernel_sources( | |||
| 18 | 18 | ||
| 19 | add_kernel_sources( | 19 | add_kernel_sources( |
| 20 | KERNEL_SRC avg_pool_apt.cpp | 20 | KERNEL_SRC avg_pool_apt.cpp |
| 21 | - COMPUTE_UNITS ascend950 ascend350 ascend960dt ascend960pr | 21 | + COMPUTE_UNITS dav_3510 dav_9201 dav_9202 |
| 22 | SIMPLIFIED_KEY 0 | 22 | SIMPLIFIED_KEY 0 |
| 23 | IMPL_MODE high_performance | 23 | IMPL_MODE high_performance |
| 24 | AUTO_SYNC false | 24 | AUTO_SYNC false |
| @@ -8,9 +8,9 @@ | |||
| 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 | -set(SUPPORT_COMPUTE_UNIT "ascend950" "mc62" "ascend350" "ascend960dt" "ascend960pr" "ascend5162") | 11 | +set(SUPPORT_COMPUTE_UNIT "dav_3510" "mc62" "dav_9201" "dav_9202" "ascend5162") |
| 12 | 12 | ||
| 13 | -set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35" "arch35") | 13 | +set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35") |
| 14 | 14 | ||
| 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE avg_pool_v2 | 15 | add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE avg_pool_v2 |
| 16 | ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES avg_pool) | 16 | ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE DEPENDENCIES avg_pool) |
| @@ -12,6 +12,7 @@ | |||
| 12 | * \file avg_pool_v2_def.cpp | 12 | * \file avg_pool_v2_def.cpp |
| 13 | * \brief | 13 | * \brief |
| 14 | */ | 14 | */ |
| 15 | +#include "op_common/op_host/util/op_arch_helper.h" | ||
| 15 | #include "register/op_def_registry.h" | 16 | #include "register/op_def_registry.h" |
| 16 | 17 | ||
| 17 | namespace ops { | 18 | namespace ops { |
| @@ -51,10 +52,9 @@ public: | |||
| 51 | .NeedCheckSupportFlag(false) | 52 | .NeedCheckSupportFlag(false) |
| 52 | .PrecisionReduceFlag(true) | 53 | .PrecisionReduceFlag(true) |
| 53 | .ExtendCfgInfo("opFile.value", "avg_pool_v2_apt"); | 54 | .ExtendCfgInfo("opFile.value", "avg_pool_v2_apt"); |
| 54 | - this->AICore().AddConfig("ascend950", aiCoreConfig); | 55 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, aiCoreConfig); |
| 55 | - this->AICore().AddConfig("ascend350", aiCoreConfig); | 56 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9201, aiCoreConfig); |
| 56 | - this->AICore().AddConfig("ascend960dt", aiCoreConfig); | 57 | + opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_9202, aiCoreConfig); |
| 57 | - this->AICore().AddConfig("ascend960pr", aiCoreConfig); | ||
| 58 | this->AICore().AddConfig("ascend5162", aiCoreConfig); | 58 | this->AICore().AddConfig("ascend5162", aiCoreConfig); |
| 59 | } | 59 | } |
| 60 | }; | 60 | }; |
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | add_kernel_sources( | 11 | add_kernel_sources( |
| 12 | KERNEL_SRC avg_pool_v2_apt.cpp | 12 | KERNEL_SRC avg_pool_v2_apt.cpp |
| 13 | - COMPUTE_UNITS ascend950 ascend350 mc62 ascend960dt ascend960pr | 13 | + COMPUTE_UNITS dav_3510 mc62 dav_9201 dav_9202 |
| 14 | SIMPLIFIED_KEY 0 | 14 | SIMPLIFIED_KEY 0 |
| 15 | IMPL_MODE high_performance,high_precision | 15 | IMPL_MODE high_performance,high_precision |
| 16 | AUTO_SYNC false | 16 | AUTO_SYNC false |