| Files | Last commit | Last update |
|---|---|---|
/lgtm Co-authored-by: wuhaogl<wuhao305@h-partners.com> # message auto-generated for no-merge-commit merge: !537 merge master into master 适配最新cann版本,更新编译选项 Created-by: wuhaogl Commit-by: wuhaogl Merged-by: cann-robot Description: ## 描述 适配最新cann版本,更新编译选项 ## 关联的Issue 关联Issue https://gitcode.com/cann/ops-transformer/issues/314 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-transformer!537 | 10 months ago | |
Pre-Commit 规范整改 — 公共 Co-authored-by: gitcode_lijd<lijiandong20@huawei.com> # message auto-generated for no-merge-commit merge: !5305 merge refactor into master Pre-Commit 规范整改 — 公共 Created-by: gitcode_lijd Commit-by: gitcode_lijd Merged-by: cann-robot Description: pre-commit是一个Git Hooks框架,用于在 git commit时自动运行代码检查和格式化工具。: | Hook | 功能 | 说明 | |------|------|------| | **clang-format** | C/C++ 代码格式化 | 自动格式化代码,保持风格一致 | | **OAT Check** | 开源合规检查 | 检测许可证头、禁止二进制文件提交 | 本PR对于公共文件进行了pre-commit检查 See merge request: cann/ops-transformer!5305 | 3 months ago | |
Pre-Commit 规范整改 — 公共 Co-authored-by: gitcode_lijd<lijiandong20@huawei.com> # message auto-generated for no-merge-commit merge: !5305 merge refactor into master Pre-Commit 规范整改 — 公共 Created-by: gitcode_lijd Commit-by: gitcode_lijd Merged-by: cann-robot Description: pre-commit是一个Git Hooks框架,用于在 git commit时自动运行代码检查和格式化工具。: | Hook | 功能 | 说明 | |------|------|------| | **clang-format** | C/C++ 代码格式化 | 自动格式化代码,保持风格一致 | | **OAT Check** | 开源合规检查 | 检测许可证头、禁止二进制文件提交 | 本PR对于公共文件进行了pre-commit检查 See merge request: cann/ops-transformer!5305 | 3 months ago | |
fix(pre-commit): 全仓OAT合规整改——许可证/版权头存量修复与豁免策略对齐 Co-authored-by: gitcode_lijd<lijiandong20@huawei.com> # message auto-generated for no-merge-commit merge: !13363 merge fix_3 into master fix(pre-commit): 全仓OAT合规整改——许可证/版权头存量修复与豁免策略对齐 Created-by: gitcode_lijd Commit-by: gitcode_lijd Merged-by: cann-robot Description: 关联Issue https://gitcode.com/cann/ops-transformer/issues/5885 ## 描述 全仓 OAT 合规整改( pre-commit run oat-check --all-files 从 200 条问题清零): **1. OAT.xml 豁免策略对齐**(仅新增 6 行 filteritem,零删除): - experimental/.*:孵化目录豁免 license/copyright/binary 三类检查(含 swiglu_gated_mlp 等第三方 Apache-2.0 双版权贡献代码,策略上不归管) - *.jpg:文档图片豁免二进制拦截(与已有 *.png 一致) - LICENSE:许可证正文本身,豁免许可证头检查 - Third_Party_Open_Source_Software_Notice:第三方声明文件,豁免版权头检查 **2. 文件头修复(167 个源文件)**: - 旧版许可证头(redistribute it and/or modify. 句式,2026-03 入库、04-03 OAT 上线前时间差遗留)→ 标准 CANN V2 头 - 变体错别字:Copyend (c)、You can not use、in in compliance、free software; 分号、CANN 1.0 许可证等 - 无头文件补标准头(如 golden.py、executor_aclnnMoeFusedTopk.py) - 版权年保留各文件原有年份;CRLF/混合行尾文件逐字节保持原行尾,diff 仅头部 **3. 历史遗留原因**:存量问题多经网页端合并(不触发本地钩子)或 OAT 上线前入库积累。 ## 验证 - pre-commit run oat-check --all-files:9 个批次全部 0 issue,Passed - git pc HEAD~1 + 显式 pre-commit run --files 复核收敛,第 2 笔为 clang-format/ruff/end-of-files 自动修复 - py/sh 语法、OAT.xml XML 合法性校验通过 基线 master:d9d81a50a See merge request: cann/ops-transformer!13363 | 30 days ago | |
pre-commit 补充license Co-authored-by: gitcode_lijd<lijiandong20@huawei.com> # message auto-generated for no-merge-commit merge: !5437 merge err_msg into master pre-commit 补充license Created-by: gitcode_lijd Commit-by: gitcode_lijd Merged-by: cann-robot Description: # ops-transformer 仓库 License 合规整改总结 ## 背景 ops-transformer 仓库在 pre-commit 流程中引入了 OAT(Open Source Audit Tool)合规性检查,用于扫描提交文件是否包含合规的 CANN License 头。在实际提交过程中,OAT 检查发现多个文件缺少 License 头,导致 commit 被阻断。为此进行了两笔提交来完成整改。 ## 提交记录 | 序号 | Commit | 提交信息 | 修改文件数 | 变更量 | |------|--------|----------|-----------|--------| | 1 | 7ad5476c9 | pre-commit 规则修改 | 1 | +10 / -1 | | 2 | 84b25cd9d | 补充license | 94 | +4399 / -3521 | ## 提交一:pre-commit 规则修改 ### 修改内容 对 .pre-commit-config.yaml 做了两处修改: 1. **补充 CANN License 头** — 该文件本身缺少 License,导致 OAT 检查报错 License Header Invalid 2. **codespell 排除范围扩展** — 在 --skip 参数中新增 *.md,避免对 Markdown 文档进行拼写检查(文档中包含大量技术术语和中文内容,误报率高) ### 触发原因 首次提交时 OAT 扫描结果: [OAT] Found 1 compliance issue(s): - Invalid File Type: 0 - License Header Invalid: 1 → .pre-commit-config.yaml (NoLicenseHeader) ## 提交二:补充 License ### 统计概览 - **涉及文件**: 94 个 - **文件类型分布**: | 类型 | 数量 | License 格式 | |------|------|-------------| | .py | 62 | # 注释风格 | | .sh | 14 | # 注释风格 | | .cpp | 8 | /**/ 注释风格 | | .h | 5 | /**/ 注释风格 | | .yml | 4 | # 注释风格 | | .yaml | 1 | # 注释风格 | - **模块分布**: | 模块 | 文件数 | |------|--------| | attention | 37 | | experimental | 31 | | examples | 7 | | .gitcode | 5 | | tests | 3 | | posembedding | 3 | | mc2 | 3 | | mhc | 2 | | torch_extension | 1 | | scripts | 1 | | ffn | 1 | ### License 头格式 #### Hash 风格(.sh / .py / .yaml / .yml) # ----------------------------------------------------------------------------------------------------------- # Copyright (c) 2025 Huawei Technologies Co., Ltd. # This program is free software, you can redistribute it and/or modify it under the terms and conditions of # CANN Open Software License Agreement Version 2.0 (the "License"). # Please refer to the License for details. You may not use this file except in compliance with the License. # THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, # INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. # See LICENSE in the root of the software repository for the full text of the License. # ----------------------------------------------------------------------------------------------------------- #### C 风格(.cpp / .c / .h / .hpp) c /** * Copyright (c) 2025 Huawei Technologies Co., Ltd. * This program is free software, you can redistribute it and/or modify it under the terms and conditions of * CANN Open Software License Agreement Version 2.0 (the "License"). * Please refer to the License for details. You may not use this file except in compliance with the License. * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. * See LICENSE in the root of the software repository for the full text of the License. */ ### 处理规则 | 场景 | 处理方式 | |------|---------| | 普通文件无 License | 在文件顶部添加 License 头 | | 文件有 shebang(#!/bin/bash) | License 插入在 shebang 之后 | | 文件有编码声明(# -*- coding: utf-8 -*-) | License 插入在编码声明之后 | | License 最后一行与代码之间 | 保留一个空行分隔 | | C 风格 */ 后 | 保留一个空行分隔 | | 空 __init__.py(0 字节) | 不添加 License,保持原样 | | 已有小写 copyright 的文件 | 不重复添加(识别为已有 License) | ### 额外修复 #### 1. 双 License 清理 以下 3 个文件原本同时包含 CANN License 和 Apache 2.0 License,删除了 Apache 2.0 部分: - scripts/util/insert_op_info.py - examples/add_example/op_kernel_aicpu/add_example_aicpu.cpp - examples/add_example/op_kernel_aicpu/add_example_aicpu.h #### 2. 格式规范化 - 所有 C 风格文件 */ 后确保有空行 - 所有 Hash 风格文件 License 块 # --- 后确保有空行 - 修复了 2 个文件(golden.py、golden_src.py)License 后的空格行替换为真正的空行 ### 排除范围 以下目录/文件未做修改: - build/ — 构建产物 - .git/ — Git 内部文件 - third_party/ — 第三方依赖 - */3rd/ — 第三方子模块 - oat_reports/ — OAT 扫描报告 - torch_extension/build/ — 构建产物 - 空 __init__.py(0 字节)— Python 包标识文件,无需 License ## 验证结果 整改完成后,对提交中所有 94 个文件进行了 5 项检查: | 检查项 | 结果 | |--------|------| | 1. 是否包含 Copyright Huawei 标识 | 全部通过 | | 2. 是否存在重复 Copyright | 全部通过 | | 3. C 风格 */ 后是否有空行 | 全部通过 | | 4. Hash 风格 # --- 后是否有空行 | 全部通过 | | 5. shebang/encoding 是否保持在第 1 行 | 全部通过 | See merge request: cann/ops-transformer!5437 | 3 months ago | |
/lgtm Co-authored-by: wuhaogl<wuhao305@h-partners.com> # message auto-generated for no-merge-commit merge: !537 merge master into master 适配最新cann版本,更新编译选项 Created-by: wuhaogl Commit-by: wuhaogl Merged-by: cann-robot Description: ## 描述 适配最新cann版本,更新编译选项 ## 关联的Issue 关联Issue https://gitcode.com/cann/ops-transformer/issues/314 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-transformer!537 | 10 months ago | |
feat(graph): op_graph proto 聚合支持 guard 宏捕获 Co-authored-by: huang-chuhong<huangchuhong1@h-partners.com> # message auto-generated for no-merge-commit merge: !10286 merge feat/merge-proto-guard into master feat(graph): op_graph proto 聚合支持 guard 宏捕获 Created-by: huang-chuhong Commit-by: huang-chuhong Merged-by: cann-robot Description: ## 描述 ops_proto_transformer.h 聚合头生成脚本 merge_proto.py 旧正则只提取 REG_OP(...) ... OP_END_FACTORY_REG(...) 块,丢弃外层 #ifndef/#define/#endif 宏守卫,导致带 OPS_PROTO_DEF_ 宏的 proto.h 在聚合后宏丢失。同步 ops-nn 的正则逻辑修复该问题。 ## 改动 - 新增 attention/recurrent_gated_delta_rule/op_graph/ 目录(recurrent_gated_delta_rule_proto.h + CMakeLists.txt),定义图模式算子注册 - scripts/util/merge_proto.py 升级正则为 OP_DEF_PATTERN:用 guard 命名组捕获 REG_OP 前紧跟的 #ifndef/#define,用条件组 (?(guard)...#endif) 匹配配对 #endif,连同注释整段提取 - 新增 match_op_proto_extend 处理 *_proto_extend.h(一个文件含多个 REG_OP,去重) - merge_op_proto 分支处理 _proto.h 与 _proto_extend.h - 入参去重 list(dict.fromkeys(...)),避免重复 proto 导致聚合头重复定义 ## 关联的Issue #4430 ## 测试 - bash build.sh --pkg --jit 编译出包成功(ascend910b) - 解压 run 包验证 ops_proto_transformer.h:OPS_PROTO_DEF_RECURRENTGATEDDELTARULE 宏已完整进入聚合头(#ifndef → #define → REG_OP → #endif) - 回归验证:无 guard 的 proto.h(chunk_gated_delta_rule、flash_attention_score 等)仍只提取 REG_OP 块,向后兼容 - ruff format / ruff check / py_compile 通过,行宽 ≤120 ## 类型标签 - [ ] 🐛 Bug 修复 - [x] ✨ 新特性 - [ ] ⚡ 性能优化 - [ ] ♻️ 重构 - [ ] 🧪 测试 - [ ] 📦 构建/CI - [ ] 🔧 配置变更 - [ ] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-transformer!10286 | 2 months ago | |
Pre-Commit 规范整改 — 公共 Co-authored-by: gitcode_lijd<lijiandong20@huawei.com> # message auto-generated for no-merge-commit merge: !5305 merge refactor into master Pre-Commit 规范整改 — 公共 Created-by: gitcode_lijd Commit-by: gitcode_lijd Merged-by: cann-robot Description: pre-commit是一个Git Hooks框架,用于在 git commit时自动运行代码检查和格式化工具。: | Hook | 功能 | 说明 | |------|------|------| | **clang-format** | C/C++ 代码格式化 | 自动格式化代码,保持风格一致 | | **OAT Check** | 开源合规检查 | 检测许可证头、禁止二进制文件提交 | 本PR对于公共文件进行了pre-commit检查 See merge request: cann/ops-transformer!5305 | 3 months ago | |
支持线上CI编译960dt Co-authored-by: yangyajie<yangyajie3@huawei.com> # message auto-generated for no-merge-commit merge: !13423 merge master into master 支持线上CI编译960dt Created-by: yangyajie Commit-by: yangyajie Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 Bug修复 - [ ] ✨ 新特性 - [ ] ⚡ 性能优化 - [ ] ♻️ 重构 - [ ] 🧪 测试 - [ ] 📦 构建/CI - [ ] 🔧 配置变更 - [ ] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-transformer!13423 | 30 days ago |
| Files | Last commit | Last update |
|---|---|---|
| 10 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 30 days ago | ||
| 3 months ago | ||
| 10 months ago | ||
| 2 months ago | ||
| 3 months ago | ||
| 30 days ago |