文件最后提交记录最后更新时间
doc Tools工具扫描问题修改 Co-authored-by: gitee-yanglulu<yanglulul@h-partners.com> # message auto-generated for no-merge-commit merge: !3443 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!34431 个月前
add interleave rope doc Co-authored-by: xieshengwei1024<xieshengwei3@huawei.com> # message auto-generated for no-merge-commit merge: !2860 merge master into master add interleave rope doc Created-by: xieshengwei1024 Commit-by: xieshengwei1024 Merged-by: cann-robot Description: ## 描述 补充aclnnInterleaveRope ## 关联的Issue 关联Issue#1255 ## 测试 无需测试 ## 文档更新 新增aclnnInterleaveRope.md文档 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新特性 - [ ] ⚡ 性能优化 - [ ] ♻️ 重构 - [ ] 🧪 测试 - [ ] 📦 构建/CI - [ ] 🔧 配置变更 - [x] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-transformer!28602 个月前
fix: add add_graph_plugin_sources() to enable proto generation for 6 operators Co-authored-by: cao-ren-lei<caorenlei@huawei.com> Co-authored-by: wangxun21<wangxun21@huawei.com> # message auto-generated for no-merge-commit merge: !5231 merge cherry-pick-4905-op_proto into master fix: add add_graph_plugin_sources() to enable proto generation for 6 operators Created-by: wangxun21 Commit-by: wangxun21;cao-ren-lei Merged-by: cann-robot Description: ## 描述 为6个算子的 op_graph CMakeLists.txt 添加 add_graph_plugin_sources() 调用,启用 proto 文件生成。 改动原因:上述6个算子的 op_graph 目录下缺少 add_graph_plugin_sources() 调用,导致编译时无法生成对应的 proto 文件。 改动方法:在各算子的 op_graph/CMakeLists.txt 中添加 add_graph_plugin_sources() 函数调用。 受影响的算子: - apply_rotary_pos_emb - attention_update - interleave_rope - rotary_position_embedding - rotary_position_embedding_grad - ring_attention_update ## 关联的Issue Fixes #2387 ## 测试 原 MR #4905 已通过 CI 流水线验证(ci-pipeline-passed、api-check-pass)。 ## 文档更新 无 ## 类型标签 - [x] 🐛 Bug 修复 See merge request: cann/ops-transformer!523115 天前
common目录结构整改 Co-authored-by: hello_simida<wangyi206@huawei.com> # message auto-generated for no-merge-commit merge: !5133 merge master into master common目录结构整改 Created-by: hello_simida Commit-by: hello_simida Merged-by: cann-robot Description: ## 描述 完成 common 目录结构调整,并适配所有 CMake 和源码引用路径。 ## 关联的Issue Closes #2369 ## 测试 - 已通过单算子编译验证:bash build.sh --pkg --soc=ascend910b --ops=all_gather_matmul_v2 - build_out/ 已成功生成 .run 包 ## 文档更新 无 ## 类型标签 - [ ] 🐛 Bug 修复 - [ ] ✨ 新特性 - [ ] ⚡ 性能优化 - [x] ♻️ 重构 - [ ] 🧪 测试 - [ ] 📦 构建/CI - [ ] 🔧 配置变更 - [ ] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-transformer!513314 天前
将blockDim修改为numBlocks Co-authored-by: tianqiguang<tianqiguang@huawei.com> # message auto-generated for no-merge-commit merge: !1401 merge master into master 将blockDim修改为numBlocks Created-by: tianqiguang Commit-by: tianqiguang Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 将blockDim修改为numBlocks,使得含义更明显 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-transformer!14013 个月前
修改extern引用为通过头文件引用 Co-authored-by: songkai111<songkai16@huawei.com> # message auto-generated for no-merge-commit merge: !4029 merge master into master 修改extern引用为通过头文件引用 Created-by: songkai111 Commit-by: songkai111 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [x] ✨ 新特性 - [ ] ⚡ 性能优化 - [ ] ♻️ 重构 - [ ] 🧪 测试 - [ ] 📦 构建/CI - [ ] 🔧 配置变更 - [ ] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-transformer!40291 个月前
更新license Co-authored-by: PerrySkywalker<wangmingkang1@huawei.com> # message auto-generated for no-merge-commit merge: !568 merge lic into master 更新license Created-by: PerrySkywalker Commit-by: PerrySkywalker Merged-by: cann-robot Description: ## 描述 更新license <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-transformer!5685 个月前
doc Tools工具扫描问题修改 Co-authored-by: gitee-yanglulu<yanglulul@h-partners.com> # message auto-generated for no-merge-commit merge: !3432 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!34322 个月前
README.md

InterleaveRope

产品支持情况

产品 是否支持
Ascend 950PR/Ascend 950DT ×
Atlas A3 训练系列产品/Atlas A3 推理系列产品
Atlas A2 训练系列产品/Atlas A2 推理系列产品
Kirin X90 处理器系列产品
Kirin 9030 处理器系列产品

功能说明

  • 算子功能:针对单输入 x 进行旋转位置编码。

  • 计算公式:

    q=reshape(x,[B,N,S,D//2,2])⋅transpose(−1,−2)⋅reshape([B,N,S,D])q = \text{reshape}(x, [B, N, S, D//2, 2]) \cdot \text{transpose}(-1, -2) \cdot \text{reshape}([B, N, S, D])

    qembed=q⋅cos+RotateHalf(q)⋅sin⁡q_{\text{embed}} = q \cdot \text{cos} + \text{RotateHalf}(q) \cdot \sin

    其中:RotateHalf(q) 表示将 q 的 D 维后半部分元素移至前半部分并乘以 -1,后半部分用前半部分的值。

    RotateHalf(q)i={−qi+D//2if i<D//2qi+D//2otherwise\text{RotateHalf}(q)_{\text{i}} = \begin{cases} -q_{i+D//2} & \text{if } i < D//2 \\ q_{i+D//2} & \text{otherwise} \end{cases}

参数说明

参数名 输入/输出/属性 描述 数据类型 数据格式
x 输入 表示待处理张量,对应公式中的 x。 FLOAT16、BFLOAT16 ND
cos 输入 表示 RoPE 旋转位置的余弦分量,对应公式中的 cos。 FLOAT16、BFLOAT16 ND
sin 输入 表示 RoPE 旋转位置的正弦分量,对应公式中的 sin。 FLOAT16、BFLOAT16 ND
y 输出 表示旋转编码后的结果,对应公式中的 q_embed。 FLOAT16、BFLOAT16 ND
  • Kirin X90/Kirin 9030 处理器系列产品: 不支持BFLOAT16。

约束说明

  • 该接口支持推理场景下使用。
  • x,y 要求为 4 维张量,shape 为(B,N,S,D)。
  • cos,sin 要求为 4 维张量,shape 为(B,N,S,D),S 可以为 1 或与 x 的 S 相同,数据类型、数据格式与 x 一致。
  • 输入x、cos、sin 的 D 维度必须等于 64。
  • cos、sin 的 N 维度必须等于 1。
  • x、cos、sin、y 都不支持非连续的 Tensor。

调用说明

调用方式 调用样例 说明
aclnn调用 test_aclnn_interleave_rope 通过aclnnInterleaveRope接口方式调用InterleaveRope算子。