提交记录/
新增grouped_broadcast自定义算子以及
共 55 个文件变更+7804-0
Acustom_op/grouped_broadcast/CMakeLists.txt+58-0
| @@ -0,0 +1,58 @@ | |||
| 1 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 2 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 3 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 4 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 5 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 6 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 7 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 8 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 9 | +# ---------------------------------------------------------------------------------------------------------- | ||
| 10 | + | ||
| 11 | +cmake_minimum_required(VERSION 3.16.0) | ||
| 12 | +project(grouped_broadcast_op_prj) | ||
| 13 | +find_package(ASC REQUIRED) | ||
| 14 | + | ||
| 15 | +# ============================================================================= | ||
| 16 | +# 架构代际配置 | ||
| 17 | +# arch22: ascend910b -> grouped_broadcast_arch22.cpp | ||
| 18 | +# ============================================================================= | ||
| 19 | + | ||
| 20 | +set(ARCH22_COMPUTE_UNITS ascend910b ascend910_93) | ||
| 21 | + | ||
| 22 | +# 如果用户未指定,则编译所有支持的芯片 | ||
| 23 | +if(NOT DEFINED ASCEND_COMPUTE_UNIT OR ASCEND_COMPUTE_UNIT STREQUAL "") | ||
| 24 | + set(ASCEND_COMPUTE_UNIT ${ARCH22_COMPUTE_UNITS}) | ||
| 25 | +endif() | ||
| 26 | + | ||
| 27 | +set(package_name grouped_broadcast_custom) | ||
| 28 | + | ||
| 29 | +npu_op_package(${package_name} | ||
| 30 | + TYPE RUN | ||
| 31 | + CONFIG | ||
| 32 | + INSTALL_PATH ${CMAKE_BINARY_DIR} | ||
| 33 | +) | ||
| 34 | + | ||
| 35 | + | ||
| 36 | +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/op_host") | ||
| 37 | + add_subdirectory(op_host) | ||
| 38 | +endif() | ||
| 39 | + | ||
| 40 | +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/op_kernel") | ||
| 41 | + add_subdirectory(op_kernel) | ||
| 42 | +endif() | ||
| 43 | + | ||
| 44 | +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/op_graph") | ||
| 45 | + add_subdirectory(op_graph) | ||
| 46 | +endif() | ||
| 47 | + | ||
| 48 | +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/framework") | ||
| 49 | + add_subdirectory(framework) | ||
| 50 | +endif() | ||
| 51 | + | ||
| 52 | +# ============================================================================= | ||
| 53 | +# IMPORTANT: cmake's default 'all' target does NOT build 'binary'! | ||
| 54 | +# To build kernel binary, use one of: | ||
| 55 | +# 1. bash build.sh --soc=<soc> (Recommended) | ||
| 56 | +# 2. cmake --build . --target all binary package | ||
| 57 | +# ============================================================================= | ||
| 58 | +message(WARNING "cmake 'make' does NOT build kernel binary by default. Use: bash build.sh --soc=<soc>") | ||
Acustom_op/grouped_broadcast/README.md+220-0
Acustom_op/grouped_broadcast/build.sh+258-0
Acustom_op/grouped_broadcast/framework/CMakeLists.txt+11-0
Acustom_op/grouped_broadcast/framework/onnx_plugin/CMakeLists.txt+14-0
Acustom_op/grouped_broadcast/framework/onnx_plugin/MoE_Norm_FP16_plugin.cc+423-0
Acustom_op/grouped_broadcast/op_api/aclnn_grouped_broadcast.cpp+217-0
Acustom_op/grouped_broadcast/op_api/aclnn_grouped_broadcast.h+42-0
Acustom_op/grouped_broadcast/op_api/grouped_broadcast.cpp+139-0
Acustom_op/grouped_broadcast/op_api/grouped_broadcast.h+23-0
Acustom_op/grouped_broadcast/op_graph/CMakeLists.txt+26-0
Acustom_op/grouped_broadcast/op_graph/grouped_broadcast_proto.h+48-0
Acustom_op/grouped_broadcast/op_host/CMakeLists.txt+149-0
Acustom_op/grouped_broadcast/op_host/arch22/grouped_broadcast_tiling.cpp+226-0
Acustom_op/grouped_broadcast/op_host/grouped_broadcast_def.cpp+108-0
Acustom_op/grouped_broadcast/op_host/grouped_broadcast_def.cpp.bak+495-0
Acustom_op/grouped_broadcast/op_host/grouped_broadcast_infershape.cpp+52-0
Acustom_op/grouped_broadcast/op_kernel/CMakeLists.txt+37-0
Acustom_op/grouped_broadcast/op_kernel/arch22/grouped_broadcast.h+249-0
Acustom_op/grouped_broadcast/op_kernel/arch22/grouped_broadcast_tiling_data.h+38-0
评论
登录后可参与评论