| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(loss/quant/norm): 四算子接入 ascend960dt 平台 + cross_entropy pre-allocation Co-authored-by: zoujiamin<zoujiamin1@huawei.com> # message auto-generated for no-merge-commit merge: !11745 merge squash/960dt-one-commit into master feat(loss/quant/norm): 四算子接入 ascend960dt 平台 + cross_entropy pre-allocation Created-by: zoujiamin123 Commit-by: zoujiamin Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。-->CrossEntropySumExpAndIndexLogit在960上开启pre-allocation优化、SigmoidCrossEntropyWithLogitsGradV2、Renorm、GroupedDynamicMxQuantWithDualAxis 三个个算子接入 ascend960dt 平台 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000-->https://gitcode.com/cann/ops-nn/issues/7021 ## 测试 <!--描述进行了哪些测试来验证你的改动。-->全量st测试通过、冒烟验证无问题 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!11745 | 7 天前 | |
[style] 修复 20 处 ruff E7 语句违规:多余分号 / == None / not ... in Co-authored-by: NUAAwqy<162230229@nuaa.edu.cn> # message auto-generated for no-merge-commit merge: !11492 merge fix/issue-6385-ruff-e7-statement-violations into master [style] 修复 20 处 ruff E7 语句违规:多余分号 / == None / not ... in Created-by: NUAA_wqy Commit-by: NUAAwqy Merged-by: cann-robot Description: ## 描述 仓库自身 .pre-commit-config.yaml 的 ruff-check(rev v0.14.14,args 仅 --output-format github --fix,未关闭任何规则)默认启用 E4/E7/E9/F 系列。main 上执行 console $ python -m ruff check --isolated --select E703,E711,E713 . 会报 20 条,本 MR 全部修掉: - **E703 语句末尾多余分号(10 处)**:norm/batch_norm_v3/tests/ut/op_kernel/batch_norm_v3_data/gen_golden_data.py(8 处)、optim/advance_step/tests/ut/op_kernel/advance_step_data/gen_data.py(2 处)。同一段里紧邻的赋值语句都没有分号,只有这几行有,属于书写不一致。 - **E711 与 None 用 == 比较(5 处)**:if self.bias == None(matmul/fused_quant_mat_mul 的 2 个 ST executor)、if input_data.kwargs.get("bias"/"quant_scale", None) == None(quant/dequant_swiglu_quant 的 ST executor,2 处)、if ignore_index == None(loss/cross_entropy_loss 的 ST executor)。左值都是普通 Python 对象(tensor / dict.get 结果 / int),改成 is None 后取值不变,符合 PEP 8 对单例比较的要求。 - **E713 not x in y(5 处)**:集中在 scripts/kernel/binary_script/parser_ini.py,改成 x not in y,与 not (x in y) 完全等价。 改动范围:7 个文件、20 行,+20 / -20,无逻辑变更、无接口变更。 ## 变更类型 - [ ] 🐛 Bug修复 - [ ] ✨ 新特性 - [ ] 🚀 性能优化 - [ ] 📝 文档更新 - [x] 📋 其他,请描述:代码风格 / lint 清理(ruff E703/E711/E713) ## 关联的Issue #6385 ## 测试 已完成的测试用例和场景: 1. python -m ruff check --isolated --select E703,E711,E713 .:改动前 20 条(10 + 5 + 5),改动后 All checks passed!; 2. 7 个改动文件逐个 python -m py_compile,全部通过; 3. git diff 逐行核对:git diff --stat 为 7 files changed, 20 insertions(+), 20 deletions(-),每处只改了分号 / ==→is / not a in b→a not in b; 4. 语义核对:not a in b 与 a not in b 完全等价;x == None 的 x 均为普通对象(tensor、dict.get() 返回值、int),不含 numpy 逐元素比较,is None 结果一致。 补充的UT用例:无(纯 lint 修正,不引入逻辑) 说明:本 MR **未**纳入同批的 E712(77 处)与 E741(11 处)。diff_res = np.isclose(...) 是逐元素布尔数组,diff_res != True 不能简单改成 not diff_res(会触发 numpy truth value 歧义),需单独评估;E741 是把 gen_golden_data_simple(n, c, l, dtype) 的形参 l 改名,会牵涉调用方,属更大范围改动。本地无 NPU / CANN 工具链,未运行 ST/UT 用例。 ## 文档更新 NA ## 合入检查 - [x] 已阅读 CONTRIBUTING.md,commit message 含类型标签与 DCO 签名(Signed-off-by) - [x] 代码/文档遵循项目整体风格,改动最小且聚焦于该 Issue - [x] 已完成本地验证,验证方法见“测试”章节 ## DCO Signed-off-by: NUAAwqy <162230229@nuaa.edu.cn> See merge request: cann/ops-nn!11492 | 7 天前 |