| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix(pre-commit): 全仓代码规范整改——attention 4/4 Co-authored-by: gitcode_lijd<lijiandong20@huawei.com> # message auto-generated for no-merge-commit merge: !13597 merge fix_3 into master fix(pre-commit): 全仓代码规范整改——attention 4/4 Created-by: gitcode_lijd Commit-by: gitcode_lijd Merged-by: cann-robot Description: 关联Issue https://gitcode.com/cann/ops-transformer/issues/5939 ## 描述 全仓代码规范整改系列——attention 拆分 **4/4**(第 4 批 23 个算子目录:quant_sparse_flash_mla ~ swin_attention_score_quant,按目录字母序均分)。基于仓库 pre-commit 门禁对存量代码做一次性规范收敛: - clang-format 按 .clang-format 统一格式(列宽 120、指针左对齐 T* p、引用对齐 T& r 等) - 行尾空白、文件末尾换行修复 - 规模:488 个文件,+12112/-11969 行,纯格式化改动语义等价,无逻辑变更 - op_graph/*_proto.h、op_host/*_def.cpp、op_api/aclnn*.h 等接口文件及 OWNERS 不在本 PR 改动范围 ## 关联的Issue https://gitcode.com/cann/ops-transformer/issues/5939(全仓整改总跟踪) ## 测试 - pre-commit 全部钩子本地通过 - CI 流水线(compile/UT)验证 See merge request: cann/ops-transformer!13597 | 1 个月前 | |
fix(pre-commit): 全仓代码规范整改——attention 4/4 Co-authored-by: gitcode_lijd<lijiandong20@huawei.com> # message auto-generated for no-merge-commit merge: !13597 merge fix_3 into master fix(pre-commit): 全仓代码规范整改——attention 4/4 Created-by: gitcode_lijd Commit-by: gitcode_lijd Merged-by: cann-robot Description: 关联Issue https://gitcode.com/cann/ops-transformer/issues/5939 ## 描述 全仓代码规范整改系列——attention 拆分 **4/4**(第 4 批 23 个算子目录:quant_sparse_flash_mla ~ swin_attention_score_quant,按目录字母序均分)。基于仓库 pre-commit 门禁对存量代码做一次性规范收敛: - clang-format 按 .clang-format 统一格式(列宽 120、指针左对齐 T* p、引用对齐 T& r 等) - 行尾空白、文件末尾换行修复 - 规模:488 个文件,+12112/-11969 行,纯格式化改动语义等价,无逻辑变更 - op_graph/*_proto.h、op_host/*_def.cpp、op_api/aclnn*.h 等接口文件及 OWNERS 不在本 PR 改动范围 ## 关联的Issue https://gitcode.com/cann/ops-transformer/issues/5939(全仓整改总跟踪) ## 测试 - pre-commit 全部钩子本地通过 - CI 流水线(compile/UT)验证 See merge request: cann/ops-transformer!13597 | 1 个月前 | |
docs(attention): 增加Attention算子Ascend IR图模式资料与GEIR调用示例 Co-authored-by: huang-chuhong<huangchuhong1@h-partners.com> # message auto-generated for no-merge-commit merge: !13207 merge docs/attention-ascendir-geir into master docs(attention): 增加Attention算子Ascend IR图模式资料与GEIR调用示例 Created-by: huang-chuhong Commit-by: huang-chuhong Merged-by: cann-robot Description: ## 描述 为 4 个 Attention 算子(flash_attention_score、flash_attention_score_grad、fused_infer_attention_score、sparse_flash_attention)补充 Ascend IR(GEIR)图模式资料与 GE 构图调用示例。 ### 改动原因 4 个算子此前仅有 aclnn 调用方式的文档与示例,缺少 Ascend IR(图模式)资料:sparse_flash_attention 无 op_graph IR 定义头文件,所有算子均无 GE 构图调用示例,README 缺图模式调用入口,无法指导用户通过 Ascend IR 构图方式调用算子。 ### 改动方法 1. **新增 op_graph IR 定义头文件** : - sparse_flash_attention/op_graph/sparse_flash_attention_proto.h(与 CANN 包 fusion_ops.h 及仓库 op def 一致) 2. **新增 GE 图模式调用示例 ×4**(GE 构图 + Session::RunGraph + CPU 参考实现数值校验): - test_geir_flash_attention_score.cpp(SBH fp32) - test_geir_flash_attention_score_grad.cpp(SBH fp16,含正向中间量构造与反向 golden) - test_geir_fused_infer_attention_score.cpp(BNSD fp16,key/value 动态输入用 create_dynamic_input_byindex_* 按 IR 定义位置注册) - test_geir_sparse_flash_attention.cpp(MLA-absorb TND fp16) 3. **Ascendir 文档 ×4**:sparse IR 定义改引 op_graph proto.h 并同步 REG_OP;4 份调用示例补充完整 GEIR 代码;FIA 文档注明动态输入需按 IR 定义位置注册(create_dynamic_input_byindex_*);修正跨文档相对链接。 4. **README ×4**:补充图模式(Ascend IR)调用入口。 ## 关联的Issue #5735 ## 测试 - Ascend950PR 实测:bash build.sh --pkg --soc=ascend950 --ops=flash_attention_score,flash_attention_score_grad,fused_infer_attention_score,sparse_flash_attention -j24 编译安装后,4 个示例 bash build.sh --run_example <op> graph 编译+运行+数值校验全部 PASS(FA 误差 1e-8 级、FAG 2e-6 级、FIA 2.9e-4、SFA 在 fp16 归约噪声内且 softmax 统计量与 CPU 参考吻合至 1e-4) - 文档相对链接全量校验有效;代码行宽均 ≤120 字符 - 不涉及算子功能逻辑变更 ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新特性 - [ ] ⚡ 性能优化 - [ ] ♻️ 重构 - [ ] 🧪 测试 - [ ] 📦 构建/CI - [ ] 🔧 配置变更 - [x] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-transformer!13207 | 1 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 |