| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix(test): resolve A2 platform test segfaults by fixing cleanup order and FLT_TRUE_MIN compatibility Co-authored-by: Zhang Hua<1302896824@qq.com> # message auto-generated for no-merge-commit merge: !184 merge fix/fill-h-flt-true-min into master fix(test): resolve A2 platform test segfaults by fixing cleanup order and FLT_TRUE_MIN compatibility Created-by: zhanghua145 Commit-by: Zhang Hua Merged-by: cann-robot Description: ## 描述 修复 A2(ascend910_93)平台编译不通过以及BLAS 算子测试 Segmentation fault问题。 **根因**:A2 编译器不支持 FLT_TRUE_MIN;测试清理阶段 aclrtDestroyStream 在 aclblasDestroy 之前调用,而 aclblasDestroy 内部调用 aclrtSynchronizeStream(h->stream),导致在已销毁的 stream 上执行同步操作,在 A2 平台触发 segfault。 **修复内容**: 1. 将 16 个测试文件中的清理顺序统一改为 aclblasDestroy → aclrtDestroyStream(含 blas_test.h 框架和 15 个独立测试文件) 2. 将 fill.h 中 FLT_TRUE_MIN 替换为 std::numeric_limits<float>::denorm_min()(A2 编译器不支持 FLT_TRUE_MIN) **影响范围**:仅修改 test/ 目录下 16 个文件,不涉及算子源码和库代码。 ## 关联的Issue [#176](https://gitcode.com/cann/ops-blas/issues/176) ## 测试 在 A2 Docker 环境中使用 bash build.sh --soc=ascend910_93 --run 全量构建测试通过,覆盖全部算子测试。  在 A5 Docker 环境中使用 bash build.sh --soc=ascend950 --run 全量构建测试通过,覆盖全部算子测试。  ## 文档更新 无 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-blas!184 | 8 天前 | |
修复6个算子的代码结构问题 Co-authored-by: xutianze<xutianze2@huawei.com> # message auto-generated for no-merge-commit merge: !178 merge refactor/six-ops-cleanup into master 修复6个算子的代码结构问题 Created-by: xutianze Commit-by: xutianze Merged-by: cann-robot Description: ## 描述 修复 6 个算子的代码结构问题,包括冗余 include、重复定义的核心数获取函数、不准确的错误信息、wrapper 中缺少返回值校验,以及纯搬运算子的 TQue/TQueBind 冗余开销。 ### 修改内容 **公共函数提取** - 在 host_utils.h 中新增公共 GetAivCoreCount 函数,供所有算子复用 **sswap (#169)** - 删除冗余 include(acl/acl.h、cann_ops_blas_common.h) - 替换本地 GetVectorCoreCount 为公共 GetAivCoreCount - 错误信息改为 "GetAivCoreCount failed" - wrapper 补全 aclrtSynchronizeDevice 和 aclrtMemcpy D2H 返回值校验 - kernel 使用 TBuf 替代 TQueBind,消除队列管理开销 **sgemv (#168)** - 删除冗余 include(acl/acl.h、cann_ops_blas_common.h) - 替换本地 GetVectorCoreCount 为公共 GetAivCoreCount - 错误信息改为 "GetAivCoreCount failed" **stpmv (#170)** - 删除冗余 include(acl/acl.h、cann_ops_blas_common.h) - 替换本地 GetVectorCoreCount 为公共 GetAivCoreCount - 错误信息改为 "GetAivCoreCount failed" **stpttr (#171)** - 删除冗余 include(acl/acl.h、cann_ops_blas_common.h) - wrapper 补全 aclrtSynchronizeDevice 和 aclrtMemcpy D2H 返回值校验 - kernel 使用 TBuf 替代 TQue,消除队列管理开销 **strttp (#172)** - 删除冗余 include(acl/acl.h、cann_ops_blas_common.h) - wrapper 补全 aclrtSynchronizeDevice 和 aclrtMemcpy D2H 返回值校验 - kernel 使用 TBuf 替代 TQue,消除队列管理开销 **sgeqrf_batched (#173)** - 删除冗余 include(acl/acl.h、cann_ops_blas_common.h、tiling/platform/platform_ascendc.h) - 替换本地 GetAivCoreCount 为公共版本 - 错误信息改为 "GetAivCoreCount failed" - wrapper 补全 aclrtSynchronizeDevice 返回值校验 ### 性能优化效果 对纯搬运算子使用 TBuf 替代 TQue/TQueBind,消除队列管理开销(AllocTensor/EnQue/DeQue/FreeTensor): | 算子 | 测试用例 | 优化前 (us) | 优化后 (us) | 提升 | |------|---------|------------|------------|------| | sswap | n=8192 | 12.75 | 9.57 | **24.9%** | | stpttr | n=10240 | 969.06 | 663.04 | **31.6%** | | strttp | n=10240 | 975.03 | 672.45 | **31.0%** | **stpmv 未优化**:使用双缓冲流水线(CopyIn/Compute/CopyOut 三阶段重叠),TQue 提供了真正的流水线并行收益,替换为 TBuf 会丢失重叠。 ## 关联的Issue - [#168](https://gitcode.com/cann/ops-blas/issues/168) - sgemv 算子 host 代码冗余 - [#169](https://gitcode.com/cann/ops-blas/issues/169) - sswap 算子 host 代码冗余及 wrapper 缺少返回值校验 - [#170](https://gitcode.com/cann/ops-blas/issues/170) - stpmv 算子 host 代码冗余 - [#171](https://gitcode.com/cann/ops-blas/issues/171) - stpttr 算子 host 代码冗余及 wrapper 缺少返回值校验 - [#172](https://gitcode.com/cann/ops-blas/issues/172) - strttp 算子 host 代码冗余及 wrapper 缺少返回值校验 - [#173](https://gitcode.com/cann/ops-blas/issues/173) - sgeqrf_batched 算子 host 代码冗余及 wrapper 缺少返回值校验 ## 测试 Ascend 950PR 实板验证,6 个算子全部通过(0 失败,0 跳过): - sswap: 42/42 - sgemv: 64/64 - stpmv: 65/65 - stpttr: 56/56 - strttp: 56/56 - sgeqrf_batched: 42/42 ## 文档更新 无 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-blas!178 | 7 天前 |