已合并
[fix]v220算子编译修复 #2303
zhoucy创建于 3月13日
[fix]v220算子编译修复 #2303
已合并
共 60 个文件变更+117-7
| @@ -20,7 +20,7 @@ import subprocess | |||
| 20 | from pathlib import Path | 20 | from pathlib import Path |
| 21 | 21 | ||
| 22 | CHANGES = "changes.txt" | 22 | CHANGES = "changes.txt" |
| 23 | -ALLOWED_EXTENSIONS = {'.py', '.h', '.cpp', '.hpp', '.sh'} | 23 | +ALLOWED_EXTENSIONS = {'.py', '.h', '.cpp', '.hpp', '.sh', '.cmake'} |
| 24 | MODULE_MAPS = { | 24 | MODULE_MAPS = { |
| 25 | 'common': 'hstu', | 25 | 'common': 'hstu', |
| 26 | 'cmake': 'hstu', | 26 | 'cmake': 'hstu', |
| @@ -67,6 +67,8 @@ fi | |||
| 67 | # vendor_name需要和aclnn中的CMakeLists.txt中的CUST_PKG_PATH值同步,不同步aclnn会调用失败; | 67 | # vendor_name需要和aclnn中的CMakeLists.txt中的CUST_PKG_PATH值同步,不同步aclnn会调用失败; |
| 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 69 | sed -i 's:"customize":"cust_op_by_addr":g' CMakePresets.json | 69 | sed -i 's:"customize":"cust_op_by_addr":g' CMakePresets.json |
| 70 | +sed -i "1i #define SUPPORT_950" ./op_host/embedding_update_by_address.cpp | ||
| 71 | +sed -i "1i #define SUPPORT_950" ./op_host/embedding_lookup_by_address.cpp | ||
| 70 | 72 | ||
| 71 | bash build.sh | 73 | bash build.sh |
| 72 | 74 | ||
| @@ -225,7 +225,9 @@ namespace ops { | |||
| 225 | this->AICore().AddConfig("ascend910b", aicConfig); | 225 | this->AICore().AddConfig("ascend910b", aicConfig); |
| 226 | this->AICore().AddConfig("ascend910", aicConfig); | 226 | this->AICore().AddConfig("ascend910", aicConfig); |
| 227 | this->AICore().AddConfig("ascend910_93", aicConfig); | 227 | this->AICore().AddConfig("ascend910_93", aicConfig); |
| 228 | + | ||
| 228 | this->AICore().AddConfig("ascend950", aicConfig); | 229 | this->AICore().AddConfig("ascend950", aicConfig); |
| 230 | + | ||
| 229 | } | 231 | } |
| 230 | }; | 232 | }; |
| 231 | 233 | ||
| @@ -208,7 +208,9 @@ namespace ops { | |||
| 208 | this->AICore().AddConfig("ascend910b", aicConfig); | 208 | this->AICore().AddConfig("ascend910b", aicConfig); |
| 209 | this->AICore().AddConfig("ascend910", aicConfig); | 209 | this->AICore().AddConfig("ascend910", aicConfig); |
| 210 | this->AICore().AddConfig("ascend910_93", aicConfig); | 210 | this->AICore().AddConfig("ascend910_93", aicConfig); |
| 211 | + | ||
| 211 | this->AICore().AddConfig("ascend950", aicConfig); | 212 | this->AICore().AddConfig("ascend950", aicConfig); |
| 213 | + | ||
| 212 | } | 214 | } |
| 213 | }; | 215 | }; |
| 214 | OP_ADD(EmbeddingUpdateByAddress); | 216 | OP_ADD(EmbeddingUpdateByAddress); |
| @@ -71,6 +71,7 @@ sed -i 's:"customize":"dense_embedding_codegen_lookup_function":g' CMakePresets. | |||
| 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 72 | line=`expr ${line} + 2` | 72 | line=`expr ${line} + 2` |
| 73 | sed -i "${line}s/True/False/g" CMakePresets.json | 73 | sed -i "${line}s/True/False/g" CMakePresets.json |
| 74 | +sed -i "1i #define SUPPORT_950" ./op_host/dense_embedding_codegen_lookup_function.cpp | ||
| 74 | 75 | ||
| 75 | # 增加LOG_CPP编译选项支持错误日志打印 | 76 | # 增加LOG_CPP编译选项支持错误日志打印 |
| 76 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt | 77 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt |
| @@ -333,7 +333,9 @@ public: | |||
| 333 | this->AICore().SetTiling(optiling::TilingFunc); | 333 | this->AICore().SetTiling(optiling::TilingFunc); |
| 334 | this->AICore().AddConfig("ascend910b"); | 334 | this->AICore().AddConfig("ascend910b"); |
| 335 | this->AICore().AddConfig("ascend910_93"); | 335 | this->AICore().AddConfig("ascend910_93"); |
| 336 | + | ||
| 336 | this->AICore().AddConfig("ascend950"); | 337 | this->AICore().AddConfig("ascend950"); |
| 338 | + | ||
| 337 | } | 339 | } |
| 338 | }; | 340 | }; |
| 339 | 341 | ||
| @@ -71,6 +71,7 @@ sed -i 's:"customize":"dense_embedding_codegen_lookup_function_grad":g' CMakePre | |||
| 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 72 | line=`expr ${line} + 2` | 72 | line=`expr ${line} + 2` |
| 73 | sed -i "${line}s/True/False/g" CMakePresets.json | 73 | sed -i "${line}s/True/False/g" CMakePresets.json |
| 74 | +sed -i "1i #define SUPPORT_950" ./op_host/dense_embedding_codegen_lookup_function_grad.cpp | ||
| 74 | 75 | ||
| 75 | # 增加LOG_CPP编译选项支持错误日志打印 | 76 | # 增加LOG_CPP编译选项支持错误日志打印 |
| 76 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt | 77 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt |
| @@ -335,7 +335,9 @@ public: | |||
| 335 | this->AICore().SetTiling(optiling::TilingFunc); | 335 | this->AICore().SetTiling(optiling::TilingFunc); |
| 336 | this->AICore().AddConfig("ascend910b"); | 336 | this->AICore().AddConfig("ascend910b"); |
| 337 | this->AICore().AddConfig("ascend910_93"); | 337 | this->AICore().AddConfig("ascend910_93"); |
| 338 | + | ||
| 338 | this->AICore().AddConfig("ascend950"); | 339 | this->AICore().AddConfig("ascend950"); |
| 340 | + | ||
| 339 | } | 341 | } |
| 340 | }; | 342 | }; |
| 341 | 343 | ||
| @@ -71,6 +71,7 @@ sed -i 's:"customize":"dense_to_jagged":g' CMakePresets.json | |||
| 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 72 | line=`expr ${line} + 2` | 72 | line=`expr ${line} + 2` |
| 73 | sed -i "${line}s/True/False/g" CMakePresets.json | 73 | sed -i "${line}s/True/False/g" CMakePresets.json |
| 74 | +sed -i "1i #define SUPPORT_950" ./op_host/dense_to_jagged.cpp | ||
| 74 | 75 | ||
| 75 | # 增加LOG_CPP编译选项支持错误日志打印 | 76 | # 增加LOG_CPP编译选项支持错误日志打印 |
| 76 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt | 77 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt |
| @@ -175,7 +175,9 @@ public: | |||
| 175 | this->AICore().AddConfig("ascend910b"); | 175 | this->AICore().AddConfig("ascend910b"); |
| 176 | this->AICore().AddConfig("ascend910_93"); | 176 | this->AICore().AddConfig("ascend910_93"); |
| 177 | this->AICore().AddConfig("ascend310p"); | 177 | this->AICore().AddConfig("ascend310p"); |
| 178 | + | ||
| 178 | this->AICore().AddConfig("ascend950"); | 179 | this->AICore().AddConfig("ascend950"); |
| 180 | + | ||
| 179 | } | 181 | } |
| 180 | }; | 182 | }; |
| 181 | 183 | ||
| @@ -72,6 +72,8 @@ line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | |||
| 72 | line=`expr ${line} + 2` | 72 | line=`expr ${line} + 2` |
| 73 | sed -i "${line}s/True/False/g" CMakePresets.json | 73 | sed -i "${line}s/True/False/g" CMakePresets.json |
| 74 | 74 | ||
| 75 | +sed -i "1i #define SUPPORT_950" ./op_host/disetangle_attention.cpp | ||
| 76 | + | ||
| 75 | # 增加LOG_CPP编译选项支持错误日志打印 | 77 | # 增加LOG_CPP编译选项支持错误日志打印 |
| 76 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt | 78 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt |
| 77 | 79 | ||
| @@ -319,7 +319,9 @@ public: | |||
| 319 | this->AICore().SetTiling(optiling::TilingFunc); | 319 | this->AICore().SetTiling(optiling::TilingFunc); |
| 320 | this->AICore().AddConfig("ascend910b"); | 320 | this->AICore().AddConfig("ascend910b"); |
| 321 | this->AICore().AddConfig("ascend910_93"); | 321 | this->AICore().AddConfig("ascend910_93"); |
| 322 | + | ||
| 322 | this->AICore().AddConfig("ascend950"); | 323 | this->AICore().AddConfig("ascend950"); |
| 324 | + | ||
| 323 | } | 325 | } |
| 324 | }; | 326 | }; |
| 325 | 327 | ||
| @@ -67,6 +67,8 @@ fi | |||
| 67 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 67 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
问题类型: 性能问题 问题描述: 当前方案对 58 个算子文件都添加了相同的 sed 命令,存在大量重复代码。如果未来需要添加新的芯片支持,需要在每个算子的 run.sh 中重复添加类似的 sed 命令,维护成本高且容易遗漏。 文件路径: cust_op/ascendc_op/ai_core_op/fused_lazy_adam/c310/run.sh 代码行号: 67 修改建议: 建议抽取公共的芯片配置逻辑到统一的构建脚本或 CMake 宏中,例如创建 chips_config.cmake 或在顶层 CMakeLists.txt 中统一管理芯片支持配置,各算子通过 include 或调用宏来继承配置,减少重复代码。 ![]() ![]() | |||
| 68 | sed -i 's:"customize":"mxrec_fused_lazy_adam":g' CMakePresets.json | 68 | sed -i 's:"customize":"mxrec_fused_lazy_adam":g' CMakePresets.json |
| 69 | 69 | ||
| 70 | +sed -i "1i #define SUPPORT_950" ./op_host/lazy_adam.cpp | ||
| 71 | + | ||
| 70 | # 增加LOG_CPP编译选项支持错误日志打印 | 72 | # 增加LOG_CPP编译选项支持错误日志打印 |
| 71 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt | 73 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt |
| 72 | 74 | ||
| @@ -234,7 +234,9 @@ public: | |||
| 234 | this->AICore().SetTiling(optiling::LazyAdamTilingFunc); | 234 | this->AICore().SetTiling(optiling::LazyAdamTilingFunc); |
| 235 | this->AICore().AddConfig("ascend910b"); | 235 | this->AICore().AddConfig("ascend910b"); |
| 236 | this->AICore().AddConfig("ascend910_93"); | 236 | this->AICore().AddConfig("ascend910_93"); |
| 237 | + | ||
| 237 | this->AICore().AddConfig("ascend950"); | 238 | this->AICore().AddConfig("ascend950"); |
| 239 | + | ||
| 238 | } | 240 | } |
| 239 | }; | 241 | }; |
| 240 | 242 | ||
| @@ -67,6 +67,8 @@ fi | |||
| 67 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 67 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 68 | sed -i 's:"customize":"mxrec_fused_agd":g' CMakePresets.json | 68 | sed -i 's:"customize":"mxrec_fused_agd":g' CMakePresets.json |
| 69 | 69 | ||
| 70 | +sed -i "1i #define SUPPORT_950" ./op_host/sgd.cpp | ||
| 71 | + | ||
| 70 | # 增加LOG_CPP编译选项支持错误日志打印 | 72 | # 增加LOG_CPP编译选项支持错误日志打印 |
| 71 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt | 73 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt |
| 72 | 74 | ||
| @@ -257,7 +257,9 @@ public: | |||
| 257 | .SetTiling(optiling::TilingFunc); | 257 | .SetTiling(optiling::TilingFunc); |
| 258 | this->AICore().AddConfig("ascend910b"); | 258 | this->AICore().AddConfig("ascend910b"); |
| 259 | this->AICore().AddConfig("ascend910_93"); | 259 | this->AICore().AddConfig("ascend910_93"); |
| 260 | + | ||
| 260 | this->AICore().AddConfig("ascend950"); | 261 | this->AICore().AddConfig("ascend950"); |
| 262 | + | ||
| 261 | } | 263 | } |
| 262 | }; | 264 | }; |
| 263 | 265 | ||
| @@ -71,6 +71,8 @@ fi | |||
| 71 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 71 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 72 | sed -i 's:"customize":"gather_for_rank1":g' CMakePresets.json | 72 | sed -i 's:"customize":"gather_for_rank1":g' CMakePresets.json |
| 73 | 73 | ||
| 74 | +sed -i "1i #define SUPPORT_950" ./op_host/gather_for_rank1.cpp | ||
| 75 | + | ||
| 74 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 76 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 75 | line=`expr ${line} + 2` | 77 | line=`expr ${line} + 2` |
| 76 | sed -i "${line}s/True/False/g" CMakePresets.json | 78 | sed -i "${line}s/True/False/g" CMakePresets.json |
| @@ -132,7 +132,9 @@ public: | |||
| 132 | this->AICore().AddConfig("ascend910b", aicore_config); | 132 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 133 | this->AICore().AddConfig("ascend910_93", aicore_config); | 133 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 134 | this->AICore().AddConfig("ascend310p", aicore_config); | 134 | this->AICore().AddConfig("ascend310p", aicore_config); |
| 135 | + | ||
| 135 | this->AICore().AddConfig("ascend950", aicore_config); | 136 | this->AICore().AddConfig("ascend950", aicore_config); |
| 137 | + | ||
| 136 | } | 138 | } |
| 137 | }; | 139 | }; |
| 138 | 140 | ||
| @@ -71,6 +71,9 @@ fi | |||
| 71 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 71 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 72 | sed -i 's:"customize":"hstu_dense_backward":g' CMakePresets.json | 72 | sed -i 's:"customize":"hstu_dense_backward":g' CMakePresets.json |
| 73 | 73 | ||
| 74 | +sed -i "1i #define SUPPORT_950" ./op_host/hstu_dense_backward.cpp | ||
| 75 | +sed -i "1i #define SUPPORT_950" ./op_host/hstu_jagged_backward.cpp | ||
| 76 | + | ||
| 74 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 77 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 75 | line=`expr ${line} + 2` | 78 | line=`expr ${line} + 2` |
| 76 | sed -i "${line}s/True/False/g" CMakePresets.json | 79 | sed -i "${line}s/True/False/g" CMakePresets.json |
| @@ -311,7 +311,9 @@ public: | |||
| 311 | this->AICore().SetTiling(optiling::TilingFunc); | 311 | this->AICore().SetTiling(optiling::TilingFunc); |
| 312 | this->AICore().AddConfig("ascend910b", aicore_config); | 312 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 313 | this->AICore().AddConfig("ascend910_93", aicore_config); | 313 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 314 | + | ||
| 314 | this->AICore().AddConfig("ascend950", aicore_config); | 315 | this->AICore().AddConfig("ascend950", aicore_config); |
| 316 | + | ||
| 315 | } | 317 | } |
| 316 | }; | 318 | }; |
| 317 | 319 | ||
| @@ -320,7 +320,9 @@ public: | |||
| 320 | this->AICore().SetTiling(optiling::TilingFuncJagged); | 320 | this->AICore().SetTiling(optiling::TilingFuncJagged); |
| 321 | this->AICore().AddConfig("ascend910b", aicore_config); | 321 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 322 | this->AICore().AddConfig("ascend910_93", aicore_config); | 322 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 323 | + | ||
| 323 | this->AICore().AddConfig("ascend950", aicore_config); | 324 | this->AICore().AddConfig("ascend950", aicore_config); |
| 325 | + | ||
| 324 | } | 326 | } |
| 325 | }; | 327 | }; |
| 326 | 328 | ||
| @@ -73,6 +73,8 @@ fi | |||
| 73 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 73 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 74 | sed -i 's:"customize":"hstu_dense_backward_fuxi":g' CMakePresets.json | 74 | sed -i 's:"customize":"hstu_dense_backward_fuxi":g' CMakePresets.json |
| 75 | 75 | ||
| 76 | +sed -i "1i #define SUPPORT_950" ./op_host/hstu_dense_backward_fuxi.cpp | ||
| 77 | + | ||
| 76 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 78 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 77 | line=`expr ${line} + 2` | 79 | line=`expr ${line} + 2` |
| 78 | sed -i "${line}s/True/False/g" CMakePresets.json | 80 | sed -i "${line}s/True/False/g" CMakePresets.json |
Mcust_op/ascendc_op/ai_core_op/hstu_dense_backward_fuxi/v220/op_host/hstu_dense_backward_fuxi.cpp+2-0
| @@ -335,7 +335,9 @@ public: | |||
| 335 | this->AICore().SetTiling(optiling::TilingFunc); | 335 | this->AICore().SetTiling(optiling::TilingFunc); |
| 336 | this->AICore().AddConfig("ascend910b", aicore_config); | 336 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 337 | this->AICore().AddConfig("ascend910_93", aicore_config); | 337 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 338 | + | ||
| 338 | this->AICore().AddConfig("ascend950", aicore_config); | 339 | this->AICore().AddConfig("ascend950", aicore_config); |
| 340 | + | ||
| 339 | } | 341 | } |
| 340 | }; | 342 | }; |
| 341 | 343 | ||
| @@ -81,11 +81,13 @@ line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | |||
| 81 | line=`expr ${line} + 2` | 81 | line=`expr ${line} + 2` |
| 82 | sed -i "${line}s/True/False/g" CMakePresets.json | 82 | sed -i "${line}s/True/False/g" CMakePresets.json |
| 83 | 83 | ||
| 84 | +sed -i "1i #define SUPPORT_950" ./op_kernel/hstu_common_const.h | ||
| 84 | sed -i "1i #define SUPPORT_950" ./op_kernel/matmul_constexpr.h | 85 | sed -i "1i #define SUPPORT_950" ./op_kernel/matmul_constexpr.h |
| 85 | sed -i "1i #define SUPPORT_950" ./op_kernel/hstu_dense_forward_jagged_kernel.h | 86 | sed -i "1i #define SUPPORT_950" ./op_kernel/hstu_dense_forward_jagged_kernel.h |
| 86 | sed -i "1i #define SUPPORT_950" ./op_kernel/hstu_paged_forward_kernel.h | 87 | sed -i "1i #define SUPPORT_950" ./op_kernel/hstu_paged_forward_kernel.h |
| 87 | sed -i "1i #define SUPPORT_950" ./op_host/hstu_jagged_forward.cpp | 88 | sed -i "1i #define SUPPORT_950" ./op_host/hstu_jagged_forward.cpp |
| 88 | sed -i "1i #define SUPPORT_950" ./op_host/hstu_paged_forward.cpp | 89 | sed -i "1i #define SUPPORT_950" ./op_host/hstu_paged_forward.cpp |
| 90 | +sed -i "1i #define SUPPORT_950" ./op_host/hstu_dense_forward.cpp | ||
| 89 | sed -i "1i #define SUPPORT_950" ./op_host/tiling_policy.cpp | 91 | sed -i "1i #define SUPPORT_950" ./op_host/tiling_policy.cpp |
| 90 | 92 | ||
| 91 | add_cmake_line="install(FILES \${CMAKE_CURRENT_SOURCE_DIR}/../../../v220/hstu_dense_forward.json DESTINATION packages/vendors/\${vendor_name}/op_impl/ai_core/tbe/\${vendor_name}_impl/dynamic)" | 93 | add_cmake_line="install(FILES \${CMAKE_CURRENT_SOURCE_DIR}/../../../v220/hstu_dense_forward.json DESTINATION packages/vendors/\${vendor_name}/op_impl/ai_core/tbe/\${vendor_name}_impl/dynamic)" |
| @@ -117,7 +117,9 @@ public: | |||
| 117 | this->AICore().AddConfig("ascend310p", aicore_config); | 117 | this->AICore().AddConfig("ascend310p", aicore_config); |
| 118 | this->AICore().AddConfig("ascend910b", aicore_config); | 118 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 119 | this->AICore().AddConfig("ascend910_93", aicore_config); | 119 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 120 | + | ||
这里是不是忘了在run.sh里声明hstu_dense_forward文件添加支持950命名空间 ![]() ![]() | |||
| 120 | this->AICore().AddConfig("ascend950", aicore_config); | 121 | this->AICore().AddConfig("ascend950", aicore_config); |
| 122 | + | ||
| 121 | } | 123 | } |
| 122 | }; | 124 | }; |
| 123 | 125 | ||
| @@ -128,7 +128,9 @@ public: | |||
| 128 | 128 | ||
| 129 | this->AICore().AddConfig("ascend910b", aicore_config); | 129 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 130 | this->AICore().AddConfig("ascend910_93", aicore_config); | 130 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 131 | + | ||
| 131 | this->AICore().AddConfig("ascend950", aicore_config); | 132 | this->AICore().AddConfig("ascend950", aicore_config); |
| 133 | + | ||
| 132 | } | 134 | } |
| 133 | }; | 135 | }; |
| 134 | 136 | ||
| @@ -148,7 +148,9 @@ public: | |||
| 148 | 148 | ||
| 149 | this->AICore().AddConfig("ascend910b", aicore_config); | 149 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 150 | this->AICore().AddConfig("ascend910_93", aicore_config); | 150 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 151 | + | ||
| 151 | this->AICore().AddConfig("ascend950", aicore_config); | 152 | this->AICore().AddConfig("ascend950", aicore_config); |
| 153 | + | ||
| 152 | } | 154 | } |
| 153 | }; | 155 | }; |
| 154 | 156 | ||
| @@ -80,6 +80,8 @@ fi | |||
| 80 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 80 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 81 | sed -i 's:"customize":"hstu_dense_forward_fuxi":g' CMakePresets.json | 81 | sed -i 's:"customize":"hstu_dense_forward_fuxi":g' CMakePresets.json |
| 82 | 82 | ||
| 83 | +sed -i "1i #define SUPPORT_950" ./op_host/hstu_dense_forward_fuxi.cpp | ||
| 84 | + | ||
| 83 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 85 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 84 | line=`expr ${line} + 2` | 86 | line=`expr ${line} + 2` |
| 85 | sed -i "${line}s/True/False/g" CMakePresets.json | 87 | sed -i "${line}s/True/False/g" CMakePresets.json |
| @@ -143,7 +143,9 @@ public: | |||
| 143 | this->AICore().AddConfig("ascend310p", aicore_config); | 143 | this->AICore().AddConfig("ascend310p", aicore_config); |
| 144 | this->AICore().AddConfig("ascend910b", aicore_config); | 144 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 145 | this->AICore().AddConfig("ascend910_93", aicore_config); | 145 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 146 | + | ||
| 146 | this->AICore().AddConfig("ascend950", aicore_config); | 147 | this->AICore().AddConfig("ascend950", aicore_config); |
| 148 | + | ||
| 147 | } | 149 | } |
| 148 | }; | 150 | }; |
| 149 | 151 | ||
| @@ -90,6 +90,8 @@ fi | |||
| 90 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 90 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 91 | sed -i 's:"customize":"in_linear_silu":g' CMakePresets.json | 91 | sed -i 's:"customize":"in_linear_silu":g' CMakePresets.json |
| 92 | 92 | ||
| 93 | +sed -i "1i #define SUPPORT_950" ./op_host/in_linear_silu.cpp | ||
| 94 | + | ||
| 93 | sed -i "1i\add_ops_compile_options(ALL OPTIONS -DCATLASS_ARCH=3510 -DCATLASS_BISHENG_ARCH=a5 -DIS_A5=1 -DENABLE_CV_COMM_VIA_SSBUF=true -DCATLASS_HOME=${CATLASS_HOME} -I${catlass_include_dir})" ./op_kernel/CMakeLists.txt | 95 | sed -i "1i\add_ops_compile_options(ALL OPTIONS -DCATLASS_ARCH=3510 -DCATLASS_BISHENG_ARCH=a5 -DIS_A5=1 -DENABLE_CV_COMM_VIA_SSBUF=true -DCATLASS_HOME=${CATLASS_HOME} -I${catlass_include_dir})" ./op_kernel/CMakeLists.txt |
| 94 | 96 | ||
| 95 | # 增加LOG_CPP编译选项支持错误日志打印 | 97 | # 增加LOG_CPP编译选项支持错误日志打印 |
| @@ -169,7 +169,9 @@ public: | |||
| 169 | this->AICore().SetTiling(optiling::TilingFunc); | 169 | this->AICore().SetTiling(optiling::TilingFunc); |
| 170 | this->AICore().AddConfig("ascend910b"); | 170 | this->AICore().AddConfig("ascend910b"); |
| 171 | this->AICore().AddConfig("ascend910_93"); | 171 | this->AICore().AddConfig("ascend910_93"); |
| 172 | + | ||
| 172 | this->AICore().AddConfig("ascend950"); | 173 | this->AICore().AddConfig("ascend950"); |
| 174 | + | ||
| 173 | } | 175 | } |
| 174 | }; | 176 | }; |
| 175 | 177 | ||
| @@ -68,6 +68,8 @@ fi | |||
| 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 69 | sed -i 's:"customize":"in_linear_silu_backward":g' CMakePresets.json | 69 | sed -i 's:"customize":"in_linear_silu_backward":g' CMakePresets.json |
| 70 | 70 | ||
| 71 | +sed -i "1i #define SUPPORT_950" ./op_host/in_linear_silu_backward.cpp | ||
| 72 | + | ||
| 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 73 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 72 | line=`expr ${line} + 2` | 74 | line=`expr ${line} + 2` |
| 73 | sed -i "${line}s/True/False/g" CMakePresets.json | 75 | sed -i "${line}s/True/False/g" CMakePresets.json |
| @@ -293,7 +293,9 @@ explicit InLinearSiluBackward(const char* name) : OpDef(name) | |||
| 293 | this->AICore().SetTiling(optiling::TilingFunc); | 293 | this->AICore().SetTiling(optiling::TilingFunc); |
| 294 | this->AICore().AddConfig("ascend910b"); | 294 | this->AICore().AddConfig("ascend910b"); |
| 295 | this->AICore().AddConfig("ascend910_93"); | 295 | this->AICore().AddConfig("ascend910_93"); |
| 296 | + | ||
| 296 | this->AICore().AddConfig("ascend950"); | 297 | this->AICore().AddConfig("ascend950"); |
| 298 | + | ||
| 297 | } | 299 | } |
| 298 | }; | 300 | }; |
| 299 | 301 | ||
| @@ -68,6 +68,8 @@ fi | |||
| 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 69 | sed -i 's:"customize":"index_select_for_rank1_backward":g' CMakePresets.json | 69 | sed -i 's:"customize":"index_select_for_rank1_backward":g' CMakePresets.json |
| 70 | 70 | ||
| 71 | +sed -i "1i #define SUPPORT_950" ./op_host/index_select_for_rank1_backward.cpp | ||
| 72 | + | ||
| 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 73 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 72 | line=`expr ${line} + 2` | 74 | line=`expr ${line} + 2` |
| 73 | sed -i "${line}s/True/False/g" CMakePresets.json | 75 | sed -i "${line}s/True/False/g" CMakePresets.json |
| @@ -135,7 +135,9 @@ public: | |||
| 135 | this->AICore().SetTiling(optiling::TilingFunc); | 135 | this->AICore().SetTiling(optiling::TilingFunc); |
| 136 | this->AICore().AddConfig("ascend910b"); | 136 | this->AICore().AddConfig("ascend910b"); |
| 137 | this->AICore().AddConfig("ascend910_93"); | 137 | this->AICore().AddConfig("ascend910_93"); |
| 138 | + | ||
| 138 | this->AICore().AddConfig("ascend950"); | 139 | this->AICore().AddConfig("ascend950"); |
| 140 | + | ||
| 139 | } | 141 | } |
| 140 | }; | 142 | }; |
| 141 | 143 | ||
| @@ -71,6 +71,8 @@ fi | |||
| 71 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 71 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 72 | sed -i 's:"customize":"jagged_to_padded_dense":g' CMakePresets.json | 72 | sed -i 's:"customize":"jagged_to_padded_dense":g' CMakePresets.json |
| 73 | 73 | ||
| 74 | +sed -i "1i #define SUPPORT_950" ./op_host/jagged_to_padded_dense.cpp | ||
| 75 | + | ||
| 74 | if [ "$ai_core" = "ai_core-Ascend310P3" ]; then | 76 | if [ "$ai_core" = "ai_core-Ascend310P3" ]; then |
| 75 | sed -i "1i #define SUPPORT_V200" ./op_kernel/jagged_to_padded_dense_kernel.h | 77 | sed -i "1i #define SUPPORT_V200" ./op_kernel/jagged_to_padded_dense_kernel.h |
| 76 | fi | 78 | fi |
| @@ -169,7 +169,9 @@ public: | |||
| 169 | this->AICore().AddConfig("ascend910b"); | 169 | this->AICore().AddConfig("ascend910b"); |
| 170 | this->AICore().AddConfig("ascend910_93"); | 170 | this->AICore().AddConfig("ascend910_93"); |
| 171 | this->AICore().AddConfig("ascend310p"); | 171 | this->AICore().AddConfig("ascend310p"); |
| 172 | + | ||
| 172 | this->AICore().AddConfig("ascend950"); | 173 | this->AICore().AddConfig("ascend950"); |
| 174 | + | ||
| 173 | } | 175 | } |
| 174 | }; | 176 | }; |
| 175 | 177 | ||
| @@ -68,6 +68,7 @@ fi | |||
| 68 | sed -i 's:"customize":"ln_mul":g' CMakePresets.json | 68 | sed -i 's:"customize":"ln_mul":g' CMakePresets.json |
| 69 | 69 | ||
| 70 | if [ "$ai_core" = "ai_core-Ascend950" ]; then | 70 | if [ "$ai_core" = "ai_core-Ascend950" ]; then |
| 71 | + sed -i "1i #define SUPPORT_950" ./op_host/ln_mul.cpp | ||
| 71 | sed -i "1i #define SUPPORT_950" ./op_kernel/ln_mul_kernel.h | 72 | sed -i "1i #define SUPPORT_950" ./op_kernel/ln_mul_kernel.h |
| 72 | fi | 73 | fi |
| 73 | 74 | ||
| @@ -142,7 +142,9 @@ public: | |||
| 142 | this->AICore().AddConfig("ascend910b", aicore_config); | 142 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 143 | this->AICore().AddConfig("ascend910_93", aicore_config); | 143 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 144 | this->AICore().AddConfig("ascend310p", aicore_config); | 144 | this->AICore().AddConfig("ascend310p", aicore_config); |
| 145 | + | ||
| 145 | this->AICore().AddConfig("ascend950", aicore_config); | 146 | this->AICore().AddConfig("ascend950", aicore_config); |
| 147 | + | ||
| 146 | } | 148 | } |
| 147 | }; | 149 | }; |
| 148 | 150 | ||
| @@ -68,6 +68,8 @@ fi | |||
| 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 69 | sed -i 's:"customize":"multislice_concat":g' CMakePresets.json | 69 | sed -i 's:"customize":"multislice_concat":g' CMakePresets.json |
| 70 | 70 | ||
| 71 | +sed -i "1i #define SUPPORT_950" ./op_host/multislice_concat.cpp | ||
| 72 | + | ||
| 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 73 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 72 | line=`expr ${line} + 2` | 74 | line=`expr ${line} + 2` |
| 73 | sed -i "${line}s/True/False/g" CMakePresets.json | 75 | sed -i "${line}s/True/False/g" CMakePresets.json |
| @@ -234,8 +234,10 @@ public: | |||
| 234 | this->SetInferShape(ge::InferShape); | 234 | this->SetInferShape(ge::InferShape); |
| 235 | this->SetInferDataType(ge::InferDataType); | 235 | this->SetInferDataType(ge::InferDataType); |
| 236 | this->AICore().SetTiling(optiling::TilingFunc); | 236 | this->AICore().SetTiling(optiling::TilingFunc); |
| 237 | - this->AICore().AddConfig("ascend950"); | ||
| 238 | this->AICore().AddConfig("ascend910b"); | 237 | this->AICore().AddConfig("ascend910b"); |
| 238 | + | ||
| 239 | + this->AICore().AddConfig("ascend950"); | ||
| 240 | + | ||
| 239 | } | 241 | } |
| 240 | }; | 242 | }; |
| 241 | 243 | ||
| @@ -69,6 +69,8 @@ fi | |||
| 69 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 69 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 70 | sed -i 's:"customize":"permute2d_sparse_data":g' CMakePresets.json | 70 | sed -i 's:"customize":"permute2d_sparse_data":g' CMakePresets.json |
| 71 | 71 | ||
| 72 | +sed -i "1i #define SUPPORT_950" ./op_host/permute2d_sparse_data.cpp | ||
| 73 | + | ||
| 72 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 74 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 73 | line=`expr ${line} + 2` | 75 | line=`expr ${line} + 2` |
| 74 | sed -i "${line}s/True/False/g" CMakePresets.json | 76 | sed -i "${line}s/True/False/g" CMakePresets.json |
| @@ -231,7 +231,9 @@ public: | |||
| 231 | this->AICore().AddConfig("ascend910"); | 231 | this->AICore().AddConfig("ascend910"); |
| 232 | this->AICore().AddConfig("ascend910b"); | 232 | this->AICore().AddConfig("ascend910b"); |
| 233 | this->AICore().AddConfig("ascend910_93"); | 233 | this->AICore().AddConfig("ascend910_93"); |
| 234 | + | ||
| 234 | this->AICore().AddConfig("ascend950"); | 235 | this->AICore().AddConfig("ascend950"); |
| 236 | + | ||
| 235 | } | 237 | } |
| 236 | }; | 238 | }; |
| 237 | 239 | ||
| @@ -68,6 +68,8 @@ fi | |||
| 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 69 | sed -i 's:"customize":"permute_pooled_embs":g' CMakePresets.json | 69 | sed -i 's:"customize":"permute_pooled_embs":g' CMakePresets.json |
| 70 | 70 | ||
| 71 | +sed -i "1i #define SUPPORT_950" ./op_host/permute_pooled_embs.cpp | ||
| 72 | + | ||
| 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 73 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 72 | line=`expr ${line} + 2` | 74 | line=`expr ${line} + 2` |
| 73 | sed -i "${line}s/True/False/g" CMakePresets.json | 75 | sed -i "${line}s/True/False/g" CMakePresets.json |
| @@ -153,7 +153,9 @@ public: | |||
| 153 | this->AICore().AddConfig("ascend910"); | 153 | this->AICore().AddConfig("ascend910"); |
| 154 | this->AICore().AddConfig("ascend910b"); | 154 | this->AICore().AddConfig("ascend910b"); |
| 155 | this->AICore().AddConfig("ascend910_93"); | 155 | this->AICore().AddConfig("ascend910_93"); |
| 156 | + | ||
| 156 | this->AICore().AddConfig("ascend950"); | 157 | this->AICore().AddConfig("ascend950"); |
| 158 | + | ||
| 157 | } | 159 | } |
| 158 | }; | 160 | }; |
| 159 | 161 | ||
| @@ -68,6 +68,8 @@ fi | |||
| 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 69 | sed -i 's:"customize":"relative_attn_bias_backward":g' CMakePresets.json | 69 | sed -i 's:"customize":"relative_attn_bias_backward":g' CMakePresets.json |
| 70 | 70 | ||
| 71 | +sed -i "1i #define SUPPORT_950" ./op_host/relative_attn_bias_backward.cpp | ||
| 72 | + | ||
| 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 73 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 72 | line=`expr ${line} + 2` | 74 | line=`expr ${line} + 2` |
| 73 | sed -i "${line}s/True/False/g" CMakePresets.json | 75 | sed -i "${line}s/True/False/g" CMakePresets.json |
| @@ -224,7 +224,9 @@ public: | |||
| 224 | this->AICore().SetTiling(optiling::TilingFunc); | 224 | this->AICore().SetTiling(optiling::TilingFunc); |
| 225 | this->AICore().AddConfig("ascend910b", aicore_config); | 225 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 226 | this->AICore().AddConfig("ascend910_93", aicore_config); | 226 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 227 | + | ||
| 227 | this->AICore().AddConfig("ascend950", aicore_config); | 228 | this->AICore().AddConfig("ascend950", aicore_config); |
| 229 | + | ||
| 228 | } | 230 | } |
| 229 | }; | 231 | }; |
| 230 | 232 | ||
| @@ -68,6 +68,8 @@ fi | |||
| 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 69 | sed -i 's:"customize":"relative_attn_bias_pos":g' CMakePresets.json | 69 | sed -i 's:"customize":"relative_attn_bias_pos":g' CMakePresets.json |
| 70 | 70 | ||
| 71 | +sed -i "1i #define SUPPORT_950" ./op_host/relative_attn_bias_pos.cpp | ||
| 72 | + | ||
| 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 73 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 72 | line=`expr ${line} + 2` | 74 | line=`expr ${line} + 2` |
| 73 | sed -i "${line}s/True/False/g" CMakePresets.json | 75 | sed -i "${line}s/True/False/g" CMakePresets.json |
| @@ -192,7 +192,9 @@ public: | |||
| 192 | this->AICore().AddConfig("ascend910b", aicore_config); | 192 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 193 | this->AICore().AddConfig("ascend910_93", aicore_config); | 193 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 194 | this->AICore().AddConfig("ascend310p", aicore_config); | 194 | this->AICore().AddConfig("ascend310p", aicore_config); |
| 195 | + | ||
| 195 | this->AICore().AddConfig("ascend950", aicore_config); | 196 | this->AICore().AddConfig("ascend950", aicore_config); |
| 197 | + | ||
| 196 | } | 198 | } |
| 197 | }; | 199 | }; |
| 198 | 200 | ||
| @@ -68,6 +68,8 @@ fi | |||
| 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 68 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 69 | sed -i 's:"customize":"relative_attn_bias_time":g' CMakePresets.json | 69 | sed -i 's:"customize":"relative_attn_bias_time":g' CMakePresets.json |
| 70 | 70 | ||
| 71 | +sed -i "1i #define SUPPORT_950" ./op_host/relative_attn_bias_time.cpp | ||
| 72 | + | ||
| 71 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 73 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 72 | line=`expr ${line} + 2` | 74 | line=`expr ${line} + 2` |
| 73 | sed -i "${line}s/True/False/g" CMakePresets.json | 75 | sed -i "${line}s/True/False/g" CMakePresets.json |
| @@ -227,7 +227,9 @@ public: | |||
| 227 | this->AICore().AddConfig("ascend910b", aicore_config); | 227 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 228 | this->AICore().AddConfig("ascend910_93", aicore_config); | 228 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 229 | this->AICore().AddConfig("ascend310p", aicore_config); | 229 | this->AICore().AddConfig("ascend310p", aicore_config); |
| 230 | + | ||
| 230 | this->AICore().AddConfig("ascend950", aicore_config); | 231 | this->AICore().AddConfig("ascend950", aicore_config); |
| 232 | + | ||
| 231 | } | 233 | } |
| 232 | }; | 234 | }; |
| 233 | 235 | ||
| @@ -65,6 +65,8 @@ sed -i 's:"/usr/local/Ascend/latest":"/usr/local/Ascend/ascend-toolkit/latest":g | |||
| 65 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 65 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 66 | sed -i 's:"customize":"reverse_sequence":g' CMakePresets.json | 66 | sed -i 's:"customize":"reverse_sequence":g' CMakePresets.json |
| 67 | 67 | ||
| 68 | +sed -i "1i #define SUPPORT_950" ./op_host/reverse_sequence.cpp | ||
| 69 | + | ||
| 68 | if [ "$ai_core" = "ai_core-Ascend310P3" ]; then | 70 | if [ "$ai_core" = "ai_core-Ascend310P3" ]; then |
| 69 | sed -i "1i #define SUPPORT_V200" ./op_kernel/reverse_sequence.cpp | 71 | sed -i "1i #define SUPPORT_V200" ./op_kernel/reverse_sequence.cpp |
| 70 | sed -i "1i #define SUPPORT_V200" ./op_host/reverse_sequence.cpp | 72 | sed -i "1i #define SUPPORT_V200" ./op_host/reverse_sequence.cpp |
| @@ -176,7 +176,9 @@ public: | |||
| 176 | this->AICore().SetTiling(optiling::TilingFunc); | 176 | this->AICore().SetTiling(optiling::TilingFunc); |
| 177 | this->AICore().AddConfig("ascend910b"); | 177 | this->AICore().AddConfig("ascend910b"); |
| 178 | this->AICore().AddConfig("ascend910_93"); | 178 | this->AICore().AddConfig("ascend910_93"); |
| 179 | + | ||
| 179 | this->AICore().AddConfig("ascend950"); | 180 | this->AICore().AddConfig("ascend950"); |
| 181 | + | ||
| 180 | } | 182 | } |
| 181 | }; | 183 | }; |
| 182 | 184 | ||
| @@ -65,6 +65,8 @@ sed -i 's:"/usr/local/Ascend/latest":"/usr/local/Ascend/ascend-toolkit/latest":g | |||
| 65 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 | 65 | # vendor_name字段值不能包含customize;包含会导致多算子部署场景CANN的vendors路径下config.ini文件内容截取错误 |
| 66 | sed -i 's:"customize":"segment_sum_csr":g' CMakePresets.json | 66 | sed -i 's:"customize":"segment_sum_csr":g' CMakePresets.json |
| 67 | 67 | ||
| 68 | +sed -i "1i #define SUPPORT_950" ./op_host/segment_sum_csr.cpp | ||
| 69 | + | ||
| 68 | if [ "$ai_core" = "ai_core-Ascend310P3" ]; then | 70 | if [ "$ai_core" = "ai_core-Ascend310P3" ]; then |
| 69 | sed -i "1i #define SUPPORT_V200" ./op_kernel/segment_sum_csr.cpp | 71 | sed -i "1i #define SUPPORT_V200" ./op_kernel/segment_sum_csr.cpp |
| 70 | sed -i "1i #define SUPPORT_V200" ./op_host/segment_sum_csr.cpp | 72 | sed -i "1i #define SUPPORT_V200" ./op_host/segment_sum_csr.cpp |
| @@ -131,7 +131,9 @@ public: | |||
| 131 | this->AICore().AddConfig("ascend910b", aicore_config); | 131 | this->AICore().AddConfig("ascend910b", aicore_config); |
| 132 | this->AICore().AddConfig("ascend910_93", aicore_config); | 132 | this->AICore().AddConfig("ascend910_93", aicore_config); |
| 133 | this->AICore().AddConfig("ascend310p", aicore_config); | 133 | this->AICore().AddConfig("ascend310p", aicore_config); |
| 134 | + | ||
| 134 | this->AICore().AddConfig("ascend950", aicore_config); | 135 | this->AICore().AddConfig("ascend950", aicore_config); |
| 136 | + | ||
| 135 | } | 137 | } |
| 136 | }; | 138 | }; |
| 137 | 139 | ||
| @@ -65,7 +65,7 @@ fi | |||
| 65 | sed -i 's:"customize":"select_dim1_to_permute":g' CMakePresets.json | 65 | sed -i 's:"customize":"select_dim1_to_permute":g' CMakePresets.json |
| 66 | 66 | ||
| 67 | # 添加C310编译选项 | 67 | # 添加C310编译选项 |
| 68 | -sed -i "1i #define SUPPORT_C310" ./op_host/select_dim1_to_permute.cpp | 68 | +sed -i "1i #define SUPPORT_950" ./op_host/select_dim1_to_permute.cpp |
| 69 | 69 | ||
| 70 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` | 70 | line=`awk '/ENABLE_SOURCE_PACKAGE/{print NR}' CMakePresets.json` |
| 71 | line=`expr ${line} + 2` | 71 | line=`expr ${line} + 2` |
| @@ -116,7 +116,7 @@ class SelectDim1ToPermute : public OpDef { | |||
| 116 | public: | 116 | public: |
| 117 | explicit SelectDim1ToPermute(const char* name) : OpDef(name) | 117 | explicit SelectDim1ToPermute(const char* name) : OpDef(name) |
| 118 | { | 118 | { |
| 119 | -#ifdef SUPPORT_C310 | 119 | +#ifdef SUPPORT_950 |
| 120 | this->Input("indices").ParamType(REQUIRED).DataType({ge::DT_INT32, ge::DT_INT64}).FormatList({ge::FORMAT_ND}); | 120 | this->Input("indices").ParamType(REQUIRED).DataType({ge::DT_INT32, ge::DT_INT64}).FormatList({ge::FORMAT_ND}); |
| 121 | this->Output("permute").ParamType(REQUIRED).Follow("indices", FollowType::DTYPE).FormatList({ge::FORMAT_ND}); | 121 | this->Output("permute").ParamType(REQUIRED).Follow("indices", FollowType::DTYPE).FormatList({ge::FORMAT_ND}); |
| 122 | 122 | ||
| @@ -130,8 +130,10 @@ public: | |||
| 130 | this->SetInferDataType(ge::InferDataType); | 130 | this->SetInferDataType(ge::InferDataType); |
| 131 | 131 | ||
| 132 | this->AICore().SetTiling(optiling::TilingFunc); | 132 | this->AICore().SetTiling(optiling::TilingFunc); |
| 133 | - this->AICore().AddConfig("ascend950"); | ||
| 134 | this->AICore().AddConfig("ascend910b"); | 133 | this->AICore().AddConfig("ascend910b"); |
| 134 | + | ||
| 135 | + this->AICore().AddConfig("ascend950"); | ||
| 136 | + | ||
| 135 | } | 137 | } |
| 136 | }; | 138 | }; |
| 137 | 139 | ||
| @@ -68,7 +68,8 @@ fi | |||
| 68 | sed -i 's:"customize":"token_mixing":g' CMakePresets.json | 68 | sed -i 's:"customize":"token_mixing":g' CMakePresets.json |
| 69 | 69 | ||
| 70 | # 添加C310编译选项 | 70 | # 添加C310编译选项 |
| 71 | -sed -i "1i #define SUPPORT_C310" ./op_kernel/token_mixing.cpp | 71 | +sed -i "1i #define SUPPORT_950" ./op_kernel/token_mixing.cpp |
| 72 | +sed -i "1i #define SUPPORT_950" ./op_host/token_mixing.cpp | ||
| 72 | 73 | ||
| 73 | # 增加LOG_CPP编译选项支持错误日志打印 | 74 | # 增加LOG_CPP编译选项支持错误日志打印 |
| 74 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt | 75 | sed -i "1 i include(../../../../cmake/func.cmake)" ./op_host/CMakeLists.txt |
| @@ -210,7 +210,9 @@ public: | |||
| 210 | 210 | ||
| 211 | this->AICore().SetTiling(optiling::TilingFunc); | 211 | this->AICore().SetTiling(optiling::TilingFunc); |
| 212 | this->AICore().AddConfig("ascend910b"); | 212 | this->AICore().AddConfig("ascend910b"); |
| 213 | + | ||
| 213 | this->AICore().AddConfig("ascend950"); | 214 | this->AICore().AddConfig("ascend950"); |
| 215 | + | ||
| 214 | } | 216 | } |
| 215 | }; | 217 | }; |
| 216 | 218 | ||
| @@ -193,7 +193,7 @@ private: | |||
| 193 | Add(addTmpLocal, xLocal, xTLocal, bshLength_); | 193 | Add(addTmpLocal, xLocal, xTLocal, bshLength_); |
| 194 | // shape | 194 | // shape |
| 195 | uint32_t meanShape[2] = {static_cast<uint32_t>(rowCount), 1}; | 195 | uint32_t meanShape[2] = {static_cast<uint32_t>(rowCount), 1}; |
| 196 | -#ifdef SUPPORT_C310 | 196 | +#ifdef SUPPORT_950 |
| 197 | uint32_t shape[2] = {static_cast<uint32_t>(rowCount), static_cast<uint32_t>(args->xDim2WithPadding)}; | 197 | uint32_t shape[2] = {static_cast<uint32_t>(rowCount), static_cast<uint32_t>(args->xDim2WithPadding)}; |
| 198 | 198 | ||
| 199 | uint32_t shape[2] = {static_cast<uint32_t>(rowCount), static_cast<uint32_t>(args->xDim2)}; | 199 | uint32_t shape[2] = {static_cast<uint32_t>(rowCount), static_cast<uint32_t>(args->xDim2)}; |


问题类型: 编码规范
问题描述: 在多个算子的 run.sh 脚本中,通过 sed 命令在文件头部插入#define SUPPORT_950 宏定义。这种修改方式会导致每次构建时都重新修改源文件,可能引起版本控制混乱和构建不一致性问题。
文件路径: cust_op/ascendc_op/ai_core_op/cust_op_by_addr/c310/run.sh
代码行号: 70
修改建议: 建议改用编译时宏定义方式,在 CMakeLists.txt 或编译命令中通过-D 参数传递 SUPPORT_950 宏,例如:add_definitions(-DSUPPORT_950) 或在 cmake 预设中配置 compile_definitions。这样避免修改源文件,保持源码纯净。