| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
format cpp Co-authored-by: yang-di52<yangdi52@huawei.com> # message auto-generated for no-merge-commit merge: !6784 merge issue_fix into master format cpp Created-by: yang-di52 Commit-by: yang-di52 Merged-by: cann-robot Description: ## 描述 批量刷新cpp代码格式 ## 关联的Issue [#3791](https://gitcode.com/cann/ops-nn/issues/3791) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:代码格式化 ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!6784 | 30 天前 | |
fix: comment out dlog_setlevel calls in UT tests for target operators Co-authored-by: liangyuhua<liangyuhua4@huawei.com> # message auto-generated for no-merge-commit merge: !8042 merge fix/comment-out-dlog-setlevel into master fix: comment out dlog_setlevel calls in UT tests for target operators Created-by: liangyuhua Commit-by: liangyuhua Merged-by: cann-robot Description: ## 描述 删除 11 个目标算子 UT 测试文件中所有 dlog_setlevel 调用(含已注释的),避免 UT 运行时修改全局日志级别影响其他用例,同时清理无用注释代码。修复 batch_norm_grad_v3 中变量名 workspace_size_holer 拼写错误为 workspace_size_holder。 涉及的算子及文件: | 模块 | 算子 | 文件 | 删除数量 | |------|------|------|---------| | activation | ConfusionSoftmaxGrad | test_confusion_softmax_grad_tiling.cpp | 6 | | activation | LogSoftmaxGrad | test_log_softmax_grad_tiling.cpp | 14 | | activation | SoftmaxGrad | test_softmax_grad_tiling.cpp | 12 | | index | BroadcastGradientArgs | test_broadcast_gradient_args_tiling.cpp | 32 | | norm | BatchNorm | test_batch_norm_tiling.cpp | 3 | | norm | BatchNormGrad | test_batch_norm_grad_tiling.cpp | 48 | | norm | BatchNormGradV3 | test_batch_norm_grad_v3_tiling.cpp | 44 | | norm | LayerNorm | test_layer_norm_tiling.cpp | 2 | | norm | LayerNormV3 | test_layer_norm_v3_tiling.cpp | 8 | | norm | RmsNormDynamicMxQuant | test_rms_norm_dynamic_mx_quant_infershape.cpp | 2 | | norm | SyncBatchNormGatherStats | test_sync_batch_norm_gather_stats_tiling.cpp | 12 | 共计 11 个文件,删除 183 处 dlog_setlevel 调用。 额外修复: - batch_norm_grad_v3 文件中 46 处变量名 workspace_size_holer 拼写错误修正为 workspace_size_holder - layer_norm_v3 文件 license header 从旧格式更新为标准格式 注:RmsNormGrad、SoftmaxV2、LogSoftmaxV2 的 dlog_setlevel 删除已通过前置 PR 合入 master,本 PR 不再重复修改。 ## 关联的Issue #4396 ## 测试 - [x] pre-commit 全部通过(clang-format + OAT + codespell 等,11 个文件手动扫描确认) - [x] 仅删除 dlog_setlevel 调用及修复变量名拼写,不影响测试逻辑 ## 文档更新 无需更新文档 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!8042 | 7 天前 | |
[Fix] Fix softmax family AR full_load binaryTmpLocalTensor buffer overflow Co-authored-by: zhuzixian-lr<zhuzixian1@h-partners.com> # message auto-generated for no-merge-commit merge: !7630 merge fix/softmax-grad-ar-binary-tmp-buffer into master [Fix] Fix softmax family AR full_load binaryTmpLocalTensor buffer overflow Created-by: zhuzixian-lr Commit-by: zhuzixian-lr Merged-by: cann-robot Description: ## 问题 softmax_grad、log_softmax_grad、confusion_softmax_grad 的 AR full_load tiling 中 BINARY_TMP_LOCAL_SHAPE = 512 写死,对应 kernel 中 AR_FULL_LOAD_BINARY_TMP_BYTES = 512。 当 r > 2*VL_FP32 时,buffer 实际需求为 ubFactor * outerLoopDstStride * sizeof(float),与 r 和 ubFactor 相关,512 字节远不够(最严重场景溢出 6.9 倍)。 ## 修改 1. **softmax_grad_tiling.h**: SoftmaxGradARTilingData 新增 binaryTmpSize 字段(影响 softmax_grad、log_softmax_grad、confusion_softmax_grad 三个算子) 2. **softmax_grad_tiling_ar_full_load.cpp**: 删除写死512,新增 FindNearestPower2,动态计算 binaryTmpPerRow,将 binaryTmpPerRow 放入 ubFactor 分母 3. **softmax_grad/log_softmax_grad/confusion_softmax_grad kernel**: 删除写死常量,使用 tl_->binaryTmpSize 4. **log_softmax_v2 kernel**: 删除写死常量,使用 tl_->binaryTmpSize(tiling 已由 #7550 修复) 5. 同步修改所有 UT 文件(op_host tiling data size、op_kernel tiling_def、test case) ## 验证 - 编译4个算子出包安装成功 - TTK测试13用例全部 MEM=PASS,TilingKey=1000(AR full_load) - torch_npu精度验证:softmax_grad/log_softmax_v2/log_softmax_grad 全部 PASS - op_host UT 20 tests PASSED - op_kernel UT 18 tests PASSED 关联PR: #7550 See merge request: cann/ops-nn!7630 | 6 天前 | |
Co-authored-by: Lizexin312<lizexin2@huawei.com> # message auto-generated for no-merge-commit merge: !1351 merge lzx_logsoftmax into master LogSoftmaxGrad算子支持Ascend950实现 Created-by: Lizexin312 Commit-by: Lizexin312 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> LogSoftmaxGrad算子支持Ascend950实现 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> [#910](https://gitcode.com/cann/ops-nn/issues/910) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ttk验证/本地example验证 ## 测试用例 std::vector<int64_t> gradOutputShape = {4, 2}; std::vector<int64_t> outputShape = {4, 2}; std::vector<int64_t> outShape = {4, 2}; void* gradOutputDeviceAddr = nullptr; void* outputDeviceAddr = nullptr; void* outDeviceAddr = nullptr; aclTensor* gradOutput = nullptr; aclTensor* output = nullptr; aclTensor* out = nullptr; std::vector<float> gradOutputHostData = {0, 1, 2, 3, 4, 5, 6, 7}; std::vector<float> outputHostData = {1, 1, 1, 2, 2, 2, 3, 3}; std::vector<float> outHostData = {0, 0, 0, 0, 0, 0, 0, 0}; ## 测试结果 result[0] is: -32.619381 result[1] is: -42.492508 result[2] is: -30.619381 result[3] is: -115.224899 result[4] is: -84.6686 result[5] is: -113.224899 result[6] is: -235.026443 result[7] is: -314.368591 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-nn!1351 | 5 个月前 |