文件最后提交记录最后更新时间
新增算子attention_worker_combine和ffn_worker_batching Co-authored-by: sunwenlong<sunwenlong8@huawei.com> # message auto-generated for no-merge-commit merge: !1276 merge master into master 新增算子attention_worker_combine和ffn_worker_batching Created-by: LuckySun Commit-by: sunwenlong Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 新增attention_worker_combine和ffn_worker_batching的A2/A3实现 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> [#694](https://gitcode.com/cann/ops-transformer/issues/694) ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 使用了pytorch验证了算子的通路 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-transformer!12763 个月前
新增算子attention_worker_combine和ffn_worker_batching Co-authored-by: sunwenlong<sunwenlong8@huawei.com> # message auto-generated for no-merge-commit merge: !1276 merge master into master 新增算子attention_worker_combine和ffn_worker_batching Created-by: LuckySun Commit-by: sunwenlong Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 新增attention_worker_combine和ffn_worker_batching的A2/A3实现 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> [#694](https://gitcode.com/cann/ops-transformer/issues/694) ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 使用了pytorch验证了算子的通路 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-transformer!12763 个月前
common目录整改 Co-authored-by: hello_simida<wangyi206@huawei.com> # message auto-generated for no-merge-commit merge: !4870 merge feature/common_dir_fix_v2 into master common目录整改 Created-by: hello_simida Commit-by: hello_simida Merged-by: cann-robot Description: ## 描述 本次修改对 common/ 目录进行整理,分为两个阶段: - **Phase 1**: 将 common/include/kernel/ 重命名为 common/include/op_kernel/ - **Phase 2**: 将 common/include/tiling_base/common/src/tiling_base/ 合并到 common/include/op_host/common/src/op_host/ 相应的 CMake 配置和所有 #include 路径引用已同步更新。 影响范围: - 351 个文件修改(include 路径更新) - 8 个文件重命名(tiling_base → op_host) - 2 个 CMakeLists.txt 修改 + 多个 tests 目录 CMakeLists.txt 更新 ## 关联的Issue Closes #2246 ## 测试 - 编译验证通过:bash build.sh --pkg --soc=ascend910b --ops=all_gather_matmul_v2 -j16 - 编译产物成功生成 .run 包 ## 文档更新 无 ## 类型标签 - [x] ♻️ 重构 - [ ] 🐛 Bug 修复 - [ ] ✨ 新特性 - [ ] ⚡ 性能优化 - [ ] 🧪 测试 - [ ] 📦 构建/CI - [ ] 🔧 配置变更 - [ ] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-transformer!487026 天前
attention 重复安装头文件修改 Co-authored-by: chenglongyu<chenglongyu@huawei.com> # message auto-generated for no-merge-commit merge: !6020 merge repeat_clean_ins into master attention 重复安装头文件修改 Created-by: chenglongyu Commit-by: chenglongyu Merged-by: cann-robot Description: ## 描述 各算子的目录下各自维护的头文件存在命名重复的问题。各头文件加上算子名前缀做区分。 | 原头文件名称 | 新头文件名称 | 文件路径 | |-----------|-----------|---------| | common_header.h | sparse_flash_mla_grad_common_header.h | attention/sparse_flash_mla_grad/op_kernel/arch22/basic_modules/sparse_flash_mla_grad_common_header.h | | common_header.h | sparse_flash_attention_grad_common_header.h | attention/sparse_flash_attention_grad/basic_modules/sparse_flash_attention_grad_common_header.h | | common_header.h | nsa_selected_attention_grad_common_header.h | attention/nsa_selected_attention_grad/basic_modules/nsa_selected_attention_grad_common_header.h | | common_header.h | flash_attention_score_grad_common_header.h | attention/flash_attention_score_grad/op_kernel/arch22/basic_modules/flash_attention_score_grad_common_header.h | | common_utils.h | attention_worker_combine_common_utils.h | attention/attention_worker_combine/op_kernel/attention_worker_combine_common_utils.h | | **gm_to_l1_iterator.h** | **mla_preprocess_gm_to_l1_iterator.h** | attention/mla_preprocess/op_kernel/mla_preprocess_gm_to_l1_iterator.h | | **gm_to_ub_iterator.h** | **mla_preprocess_gm_to_ub_iterator.h** | attention/mla_preprocess/op_kernel/mla_preprocess_gm_to_ub_iterator.h | | kernel_common.hpp | rain_fusion_attention_kernel_common.hpp | attention/rain_fusion_attention/op_kernel/rain_fusion_attention_kernel_common.hpp | | kernel_common.hpp | fia_kernel_common.hpp | attention/fused_infer_attention_score/op_kernel/fia_kernel_common.hpp | | kernel_common.hpp | block_sparse_attention_kernel_common.hpp | attention/block_sparse_attention/op_kernel/block_sparse_attention_kernel_common.hpp | | **l0c_to_gm_iterator.h** | **mla_preprocess_l0c_to_gm_iterator.h** | attention/mla_preprocess/op_kernel/mla_preprocess_l0c_to_gm_iterator.h | | **l0c_to_l1_iterator.h** | **mla_preprocess_l0c_to_l1_iterator.h** | attention/mla_preprocess/op_kernel/mla_preprocess_l0c_to_l1_iterator.h | | **l0c_to_ub_iterator.h** | **mla_preprocess_l0c_to_ub_iterator.h** | attention/mla_preprocess/op_kernel/mla_preprocess_l0c_to_ub_iterator.h | | **l1_to_bt_iterator.h** | **mla_preprocess_l1_to_bt_iterator.h** | attention/mla_preprocess/op_kernel/mla_preprocess_l1_to_bt_iterator.h | | **l1_to_fb_iterator.h** | **mla_preprocess_l1_to_fb_iterator.h** | attention/mla_preprocess/op_kernel/mla_preprocess_l1_to_fb_iterator.h | | **l1_to_l0_iterator.h** | **mla_preprocess_l1_to_l0_iterator.h** | attention/mla_preprocess/op_kernel/mla_preprocess_l1_to_l0_iterator.h | | **l1_to_ub_iterator.h** | **mla_preprocess_l1_to_ub_iterator.h** | attention/mla_preprocess/op_kernel/mla_preprocess_l1_to_ub_iterator.h | | mla_common.h | prompt_flash_attention_mla_common.h | attention/prompt_flash_attention/op_kernel/arch22/prompt_flash_attention_mla_common.h | | mla_common.h | mla_preprocess_mla_common.h | attention/mla_preprocess/op_kernel/mla_preprocess_mla_common.h | | cube_op.h | sparse_flash_mla_grad_cube_op.h | attention/sparse_flash_mla_grad/op_kernel/arch22/basic_modules/sparse_flash_mla_grad_cube_op.h | | matmul.h | sparse_flash_mla_grad_matmul.h | attention/sparse_flash_mla_grad/op_kernel/arch22/basic_modules/sparse_flash_mla_grad_matmul.h | | vec_op.h | sparse_flash_mla_grad_vec_op.h | attention/sparse_flash_mla_grad/op_kernel/arch22/basic_modules/sparse_flash_mla_grad_vec_op.h | | cube_op.h | sparse_flash_attention_grad_cube_op.h | attention/sparse_flash_attention_grad/basic_modules/sparse_flash_attention_grad_cube_op.h | | matmul.h | sparse_flash_attention_grad_matmul.h | attention/sparse_flash_attention_grad/basic_modules/sparse_flash_attention_grad_matmul.h | | vec_op.h | sparse_flash_attention_grad_vec_op.h | attention/sparse_flash_attention_grad/basic_modules/sparse_flash_attention_grad_vec_op.h | ## 关联的Issue https://gitcode.com/cann/ops-transformer/issues/2680 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新特性 - [ ] ⚡ 性能优化 - [ ] ♻️ 重构 - [ ] 🧪 测试 - [ ] 📦 构建/CI - [ ] 🔧 配置变更 - [ ] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-transformer!60204 天前
新增算子attention_worker_combine和ffn_worker_batching Co-authored-by: sunwenlong<sunwenlong8@huawei.com> # message auto-generated for no-merge-commit merge: !1276 merge master into master 新增算子attention_worker_combine和ffn_worker_batching Created-by: LuckySun Commit-by: sunwenlong Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 新增attention_worker_combine和ffn_worker_batching的A2/A3实现 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> [#694](https://gitcode.com/cann/ops-transformer/issues/694) ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 使用了pytorch验证了算子的通路 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-transformer!12763 个月前
新增算子attention_worker_combine和ffn_worker_batching Co-authored-by: sunwenlong<sunwenlong8@huawei.com> # message auto-generated for no-merge-commit merge: !1276 merge master into master 新增算子attention_worker_combine和ffn_worker_batching Created-by: LuckySun Commit-by: sunwenlong Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 新增attention_worker_combine和ffn_worker_batching的A2/A3实现 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> [#694](https://gitcode.com/cann/ops-transformer/issues/694) ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 使用了pytorch验证了算子的通路 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-transformer!12763 个月前
doc Tools扫描错误修改 Co-authored-by: gitee-yanglulu<yanglulul@h-partners.com> # message auto-generated for no-merge-commit merge: !3348 merge master into master doc Tools扫描错误修改 Created-by: gitee-yanglulu Commit-by: gitee-yanglulu Merged-by: cann-robot Description: doc Tools扫描错误修改 See merge request: cann/ops-transformer!33482 个月前
README.md

AttentionWorkerCombine

产品支持情况

产品 是否支持
Ascend 950PR/Ascend 950DT ×
Atlas A3 训练系列产品/Atlas A3 推理系列产品
Atlas A2 训练系列产品/Atlas A2 推理系列产品
Atlas 200I/500 A2 推理产品 ×
Atlas 推理系列产品 ×
Atlas 训练系列产品 ×

功能说明

  • 算子功能:将多个计算单元处理的注意力token数据进行融合,结合专家权重对结果进行加权,输出最终的注意力融合结果,并更新层ID。

参数说明

参数名 输入/输出/属性 描述 数据类型 数据格式
schedule_context 输入 包含调度上下文信息。 INT8 ND
expert_scales 输入 表示专家权重。 FLOAT ND
layer_id 输入 当前的模型层ID。 INT32 ND
y 输出 最终的注意力合并结果。 FLOAT16,BFLOAT16 ND
next_layer_id 输出 下一个要处理的层ID。 INT32 ND
hidden_size 属性 token_data的隐藏维度大小,用于确定输出y的第二维大小。必要属性。 Int -
token_dtype 属性 指定schedule_context中token数据的原始精度类型,0表示FLOAT16,1表示BFLOAT16。 Int -
need_schedule 属性 指定是否等待token数据填充完成后再执行,0表示不等待,1表示等待。 Int -

约束说明

  • schedule_context为1D的Tensor。
  • expert_scales为2D的Tensor,[BatchSize, K]。
  • y为2D的Tensor,[BatchSize, HiddenSize],即第二维由属性hidden_size确定。
  • layer_id和next_layer_id为1D的Tensor。

调用说明

调用方式 样例代码 说明
图模式调用 test_geir_attention_worker_combine.cpp 通过算子IR构图方式调用AttentionWorkerCombine算子。