| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
refactor: 统一头文件 include guard 为 #pragma once 并添加 CI lint 规则 Co-authored-by: Zhang Hua<1302896824@qq.com> # message auto-generated for no-merge-commit merge: !173 merge unify-include-guards into master refactor: 统一头文件 include guard 为 #pragma once 并添加 CI lint 规则 Created-by: zhanghua145 Commit-by: Zhang Hua Merged-by: cann-robot Description: ## 描述 统一仓库中所有头文件的 include guard 风格为 #pragma once,解决当前 #ifndef/#define/#endif 与 #pragma once 混用导致的风格不一致问题。 ## 关联 Issue 关联 Issue #162 ## 变更内容 ### 1. 统一现有头文件(125 个文件,+456/-698) | 类别 | 数量 | 说明 | |------|------|------| | #ifndef → #pragma once | 215 个 | 传统宏保护替换为 #pragma once | | 补充 #pragma once | 1 个 | cgerc_kernel_impl.h 原先缺少 include guard | | agent 模板同步 | 2 个 | 模板文件同步转换 | | **净减少行数** | **242 行** | 456 行增加,698 行删除 | ### 2. 添加 CI lint 检查脚本 新增 scripts/ci/check_pragma_once.sh,用于检查 PR 中新增/修改的 .h/.hpp 文件是否使用 #pragma once。 **调用方式**(与现有 scripts/ci/run_example.sh 一致,接收 PR 文件列表): bash bash scripts/ci/check_pragma_once.sh <pr_filelist.txt> pr_filelist.txt 格式为每行一个文件路径(相对仓库根目录),仅检查 .h/.hpp 文件,其他文件类型自动跳过。 **检查规则**: - 必须使用 #pragma once,拒绝 #ifndef include guard 和无 guard 的文件 - 自动跳过第三方目录(.opencode/、asc-devkit/ 等) ## ⚠️ 需要维护者操作:接入 CI 流水线 本 PR 提供了 scripts/ci/check_pragma_once.sh 检查脚本,但**尚未接入 CI 流水线**。需要维护者在 GitCode 平台侧的流水线配置中新增一个步骤,在编译前调用该脚本。 建议的接入方式(参考现有 run_example.sh 的调用模式): yaml # CI 流水线中新增 lint 步骤(在编译步骤之前) - name: check-pragma-once script: | # pr_filelist.txt 由平台自动生成,包含 PR 变更文件列表 bash scripts/ci/check_pragma_once.sh pr_filelist.txt 在维护者接入流水线之前,该脚本也可通过以下方式手动使用: - **本地验证**:bash scripts/ci/check_pragma_once.sh <文件列表> - **pre-commit hook**:已集成到 .pre-commit-config.yaml(需开发者自行安装 pre-commit) ## 关于 Issue 中提到的 3 个缺少 guard 的头文件 Issue #162 提到有 3 个头文件缺少标准 include guard。经逐 commit 追溯历史,原始 3 个文件为: | # | 文件 | 当前状态 | |---|------|----------| | 1 | blas/gerc/cgerc/arch22/cgerc_kernel_impl.h | 仍存在,**本次已修复** | | 2 | blas/cgerc/cgerc_kernel_impl.h | 已被删除(cgerc 目录重构,迁移至 blas/gerc/cgerc/arch22/) | | 3 | blas/common/kernel_launch/aclblas_kernel_do.h | 已被删除(commit cc4d43c "del common kernel launch header") | 第 2、3 个文件已在其他 PR 的重构过程中被删除,因此本次只需修复第 1 个文件。 ## 未修改的 #ifndef 仓库中剩余约 114 处 #ifndef 均为**条件编译**(非 include guard),保持不变: - #ifndef __CCE_AICORE__ — 区分 Host/Device 编译目标 - #ifndef TEST_DEVICE_ID — 测试设备 ID 默认值 - #ifndef __force_inline__ — 编译器特性检测 - #ifndef ACLBLAS_OPERATION_DECLARED — 枚举声明保护 这些是功能性的编译条件判断,不属于 include guard,不在本次修改范围内。 ## 验证 - [x] 测试通过(bash build.sh --run --soc=ascend950,ops_blas + ops_blasLt 均成功)  - [x] 所有项目头文件(358 个)均已使用 #pragma once - [x] 无遗漏的 include guard 宏 - [x] CI lint 脚本测试通过(正确拒绝 #ifndef guard,放行 #pragma once,仅检查 PR 变更文件) ## 类型标签 - [ ] Bug 修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他:代码风格统一重构 See merge request: cann/ops-blas!173 | 3 个月前 | |
Feat: 新增面向arch35的aclblasAxpyEx接口 Co-authored-by: xutianze<xutianze2@huawei.com> # message auto-generated for no-merge-commit merge: !223 merge aclblasAxpyEx into master Feat: 新增面向arch35的aclblasAxpyEx接口 Created-by: xutianze Commit-by: xutianze Merged-by: cann-robot Description: ## 描述 新增面向 arch35(Ascend 950)的 aclblasAxpyEx 接口,实现 BLAS Level-1 AXPY 操作 y := alpha*x + y 的扩展版本,支持 FP16/BF16/FP32 多数据类型。 ### 实现方法 - **SIMD 连续路径**(incx==1 && incy==1):TBuf + DataCopy + Axpy(FP32)/ SIMD VF RegBase UNPACK/PACK(FP16/BF16) - **SIMT 跨步路径**(incx!=1 || incy!=1):__simt_vf__ + asc_vf_call,块级连续+线程级交错混合分布 - **多 dtype 分发**:以 xType 为 key 实例化不同模板参数 - **性能优化**:FP16/BF16 使用 VF 内 UNPACK/PACK 消除 UB 间 Cast(-29.7%/-33.8%);自适应核数优化小规模场景(-6.5%);SIMT 尾轮均衡降低核间不均衡(-42%~-52%) ### 交付物清单(18 文件) **算子代码(5 个)**: - blas/axpy_ex/arch35/axpy_ex_host.cpp — Host 侧实现(参数校验 + Tiling 计算 + 异步 launch) - blas/axpy_ex/arch35/axpy_ex_kernel.asc — Kernel 侧实现(SIMD + SIMT 双路径) - blas/axpy_ex/arch35/axpy_ex_kernel.h — kernel_do 函数签名声明 - blas/axpy_ex/arch35/axpy_ex_tiling_data.h — TilingData 结构体 - blas/axpy_ex/README.md — 算子文档 **公共 API(1 个)**: - include/cann_ops_blas.h — 新增 aclblasAxpyEx 声明 **测试代码(6 个)**: - test/axpy_ex/CMakeLists.txt — CMake 配置 - test/axpy_ex/axpy_ex_param.h — 参数结构体(含 alpha_null 标记机制) - test/axpy_ex/axpy_ex_golden.h — CPU golden(CBLAS saxpy + Cast) - test/axpy_ex/arch35/axpy_ex_npu_wrapper.h — NPU wrapper(alpha nullptr/device/host 三分支) - test/axpy_ex/arch35/axpy_ex_test.cpp — GTest 入口 - test/axpy_ex/arch35/axpy_ex_test.csv — CSV 用例表(78 行) **公共模块(5 个)**: - test/utils/dtype_compat.h — 新增公共 Cast 辅助函数 - test/frame/csv_loader.h — 新增 parseDataType 公共函数 - test/frame/verify.h — MereMareStrategy 扩展 INF mismatch 检测 - test/scalex/scalex_golden.h — 重构,Cast 函数移至公共模块 - test/scalex/scalex_param.h — 重构,parseDataType 移至公共模块 ## 关联的Issue [#242](https://gitcode.com/cann/ops-blas/issues/242) ## 测试 ### 精度测试 - ST 通过率:79/79(100%),含 1 个 NullHandle + 78 个 CSV 参数化用例 - 覆盖场景:FP32/FP16/BF16 全 dtype、正/负/混合步长、alpha Host/Device、NaN/INF 特殊值、大 shape(n=1048576) - 精度标准:MERE_MARE,FP32: 2^-13, FP16: 2^-10, BF16: 2^-7 - scalex 回归验证:90/90 通过,公共模块修改无回归 ### 性能测试 - SIMD FP32 1M:带宽利用率 39.2% - SIMD FP16 1M:经 UNPACK/PACK 优化后提速 29.7% - SIMD BF16 1M:经 UNPACK/PACK 优化后提速 33.8% - SIMT FP32 1M incx=2:带宽利用率 68.1%,VEC 88-91% - 小规模 1K:自适应核数优化提速 6.5% - SIMT 核间不均衡:经尾轮均衡从 57% 降至 29% ### 代码检视 - 3.1 检视通过,4.2 最终检视通过,无 HIGH 问题 - OAT 合规扫描通过(17 文件,0 问题) ## 文档更新 - 新增 blas/axpy_ex/README.md:算子功能描述、接口签名、参数说明、约束条件、调用示例 - 更新 include/cann_ops_blas.h:新增 aclblasAxpyEx API 声明 ## 类型标签 - [x] 新特性 See merge request: cann/ops-blas!223 | 3 个月前 | |
refactor: 统一头文件 include guard 为 #pragma once 并添加 CI lint 规则 Co-authored-by: Zhang Hua<1302896824@qq.com> # message auto-generated for no-merge-commit merge: !173 merge unify-include-guards into master refactor: 统一头文件 include guard 为 #pragma once 并添加 CI lint 规则 Created-by: zhanghua145 Commit-by: Zhang Hua Merged-by: cann-robot Description: ## 描述 统一仓库中所有头文件的 include guard 风格为 #pragma once,解决当前 #ifndef/#define/#endif 与 #pragma once 混用导致的风格不一致问题。 ## 关联 Issue 关联 Issue #162 ## 变更内容 ### 1. 统一现有头文件(125 个文件,+456/-698) | 类别 | 数量 | 说明 | |------|------|------| | #ifndef → #pragma once | 215 个 | 传统宏保护替换为 #pragma once | | 补充 #pragma once | 1 个 | cgerc_kernel_impl.h 原先缺少 include guard | | agent 模板同步 | 2 个 | 模板文件同步转换 | | **净减少行数** | **242 行** | 456 行增加,698 行删除 | ### 2. 添加 CI lint 检查脚本 新增 scripts/ci/check_pragma_once.sh,用于检查 PR 中新增/修改的 .h/.hpp 文件是否使用 #pragma once。 **调用方式**(与现有 scripts/ci/run_example.sh 一致,接收 PR 文件列表): bash bash scripts/ci/check_pragma_once.sh <pr_filelist.txt> pr_filelist.txt 格式为每行一个文件路径(相对仓库根目录),仅检查 .h/.hpp 文件,其他文件类型自动跳过。 **检查规则**: - 必须使用 #pragma once,拒绝 #ifndef include guard 和无 guard 的文件 - 自动跳过第三方目录(.opencode/、asc-devkit/ 等) ## ⚠️ 需要维护者操作:接入 CI 流水线 本 PR 提供了 scripts/ci/check_pragma_once.sh 检查脚本,但**尚未接入 CI 流水线**。需要维护者在 GitCode 平台侧的流水线配置中新增一个步骤,在编译前调用该脚本。 建议的接入方式(参考现有 run_example.sh 的调用模式): yaml # CI 流水线中新增 lint 步骤(在编译步骤之前) - name: check-pragma-once script: | # pr_filelist.txt 由平台自动生成,包含 PR 变更文件列表 bash scripts/ci/check_pragma_once.sh pr_filelist.txt 在维护者接入流水线之前,该脚本也可通过以下方式手动使用: - **本地验证**:bash scripts/ci/check_pragma_once.sh <文件列表> - **pre-commit hook**:已集成到 .pre-commit-config.yaml(需开发者自行安装 pre-commit) ## 关于 Issue 中提到的 3 个缺少 guard 的头文件 Issue #162 提到有 3 个头文件缺少标准 include guard。经逐 commit 追溯历史,原始 3 个文件为: | # | 文件 | 当前状态 | |---|------|----------| | 1 | blas/gerc/cgerc/arch22/cgerc_kernel_impl.h | 仍存在,**本次已修复** | | 2 | blas/cgerc/cgerc_kernel_impl.h | 已被删除(cgerc 目录重构,迁移至 blas/gerc/cgerc/arch22/) | | 3 | blas/common/kernel_launch/aclblas_kernel_do.h | 已被删除(commit cc4d43c "del common kernel launch header") | 第 2、3 个文件已在其他 PR 的重构过程中被删除,因此本次只需修复第 1 个文件。 ## 未修改的 #ifndef 仓库中剩余约 114 处 #ifndef 均为**条件编译**(非 include guard),保持不变: - #ifndef __CCE_AICORE__ — 区分 Host/Device 编译目标 - #ifndef TEST_DEVICE_ID — 测试设备 ID 默认值 - #ifndef __force_inline__ — 编译器特性检测 - #ifndef ACLBLAS_OPERATION_DECLARED — 枚举声明保护 这些是功能性的编译条件判断,不属于 include guard,不在本次修改范围内。 ## 验证 - [x] 测试通过(bash build.sh --run --soc=ascend950,ops_blas + ops_blasLt 均成功)  - [x] 所有项目头文件(358 个)均已使用 #pragma once - [x] 无遗漏的 include guard 宏 - [x] CI lint 脚本测试通过(正确拒绝 #ifndef guard,放行 #pragma once,仅检查 PR 变更文件) ## 类型标签 - [ ] Bug 修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他:代码风格统一重构 See merge request: cann/ops-blas!173 | 3 个月前 | |
refactor: 统一头文件 include guard 为 #pragma once 并添加 CI lint 规则 Co-authored-by: Zhang Hua<1302896824@qq.com> # message auto-generated for no-merge-commit merge: !173 merge unify-include-guards into master refactor: 统一头文件 include guard 为 #pragma once 并添加 CI lint 规则 Created-by: zhanghua145 Commit-by: Zhang Hua Merged-by: cann-robot Description: ## 描述 统一仓库中所有头文件的 include guard 风格为 #pragma once,解决当前 #ifndef/#define/#endif 与 #pragma once 混用导致的风格不一致问题。 ## 关联 Issue 关联 Issue #162 ## 变更内容 ### 1. 统一现有头文件(125 个文件,+456/-698) | 类别 | 数量 | 说明 | |------|------|------| | #ifndef → #pragma once | 215 个 | 传统宏保护替换为 #pragma once | | 补充 #pragma once | 1 个 | cgerc_kernel_impl.h 原先缺少 include guard | | agent 模板同步 | 2 个 | 模板文件同步转换 | | **净减少行数** | **242 行** | 456 行增加,698 行删除 | ### 2. 添加 CI lint 检查脚本 新增 scripts/ci/check_pragma_once.sh,用于检查 PR 中新增/修改的 .h/.hpp 文件是否使用 #pragma once。 **调用方式**(与现有 scripts/ci/run_example.sh 一致,接收 PR 文件列表): bash bash scripts/ci/check_pragma_once.sh <pr_filelist.txt> pr_filelist.txt 格式为每行一个文件路径(相对仓库根目录),仅检查 .h/.hpp 文件,其他文件类型自动跳过。 **检查规则**: - 必须使用 #pragma once,拒绝 #ifndef include guard 和无 guard 的文件 - 自动跳过第三方目录(.opencode/、asc-devkit/ 等) ## ⚠️ 需要维护者操作:接入 CI 流水线 本 PR 提供了 scripts/ci/check_pragma_once.sh 检查脚本,但**尚未接入 CI 流水线**。需要维护者在 GitCode 平台侧的流水线配置中新增一个步骤,在编译前调用该脚本。 建议的接入方式(参考现有 run_example.sh 的调用模式): yaml # CI 流水线中新增 lint 步骤(在编译步骤之前) - name: check-pragma-once script: | # pr_filelist.txt 由平台自动生成,包含 PR 变更文件列表 bash scripts/ci/check_pragma_once.sh pr_filelist.txt 在维护者接入流水线之前,该脚本也可通过以下方式手动使用: - **本地验证**:bash scripts/ci/check_pragma_once.sh <文件列表> - **pre-commit hook**:已集成到 .pre-commit-config.yaml(需开发者自行安装 pre-commit) ## 关于 Issue 中提到的 3 个缺少 guard 的头文件 Issue #162 提到有 3 个头文件缺少标准 include guard。经逐 commit 追溯历史,原始 3 个文件为: | # | 文件 | 当前状态 | |---|------|----------| | 1 | blas/gerc/cgerc/arch22/cgerc_kernel_impl.h | 仍存在,**本次已修复** | | 2 | blas/cgerc/cgerc_kernel_impl.h | 已被删除(cgerc 目录重构,迁移至 blas/gerc/cgerc/arch22/) | | 3 | blas/common/kernel_launch/aclblas_kernel_do.h | 已被删除(commit cc4d43c "del common kernel launch header") | 第 2、3 个文件已在其他 PR 的重构过程中被删除,因此本次只需修复第 1 个文件。 ## 未修改的 #ifndef 仓库中剩余约 114 处 #ifndef 均为**条件编译**(非 include guard),保持不变: - #ifndef __CCE_AICORE__ — 区分 Host/Device 编译目标 - #ifndef TEST_DEVICE_ID — 测试设备 ID 默认值 - #ifndef __force_inline__ — 编译器特性检测 - #ifndef ACLBLAS_OPERATION_DECLARED — 枚举声明保护 这些是功能性的编译条件判断,不属于 include guard,不在本次修改范围内。 ## 验证 - [x] 测试通过(bash build.sh --run --soc=ascend950,ops_blas + ops_blasLt 均成功)  - [x] 所有项目头文件(358 个)均已使用 #pragma once - [x] 无遗漏的 include guard 宏 - [x] CI lint 脚本测试通过(正确拒绝 #ifndef guard,放行 #pragma once,仅检查 PR 变更文件) ## 类型标签 - [ ] Bug 修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他:代码风格统一重构 See merge request: cann/ops-blas!173 | 3 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 个月前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 3 个月前 |