| Files | Last commit | Last update |
|---|---|---|
test(ds_v32): Remove dead UT files without test cases Co-authored-by: chengding888<chengding1@hisilicon.com> # message auto-generated for no-merge-commit merge: !6894 merge master into master test(ds_v32): Remove dead UT files without test cases Created-by: chengding888 Commit-by: chengding888 Merged-by: cann-robot Description: PR 应该避免没有描述信息,描述信息的最重要的作用是描述修改意图,应该清晰明了。例如:标题中包含了 fix 标签,如果没有描述信息,就需要Review人员猜测PR具体修复了哪些内容,或者怀疑修改的必要性。如果PR和特定的Issue相关,可以单独包含一行 Related Issue: 放到描述信息最后。 下面是一个典型的PR描述信息: The origin issue template brings too many noise, it's not suitable for git message. eg: comments are not removed, labels are redundant as the PR tile already contains the tag. The guide gives a clear suggestion on how to write the PR body. Related Issue: #1234,#5678 更多描述信息见:[Commit Message 规范](../docs/zh/contribute/pull-request.md#commit-message) See merge request: cann/pypto!6894 | 1 month ago | |
feat(pass): Remove slice false label Co-authored-by: 2501_92924845<niulinkai@huawei.com> # message auto-generated for no-merge-commit merge: !7696 merge slice1120 into master feat(pass): Remove slice false label Created-by: 2501_92924845 Commit-by: 2501_92924845 Merged-by: cann-robot Description: 背景 Slice 已默认开启。为让示例、测试和用户代码使用一致的编译路径,本 PR 下架 Python 侧及cpp侧的 enable_slice 开关,并清理用例中显式开启或关闭 Slice 的配置。 主要改动 - 移除 Python set_pass_options() 中的 enable_slice 参数及 get_pass_options() 中的对应字段。通过通用配置字典传入该选项时会报错。 - 清理示例、PyPTO Pro 和测试中的 Slice 覆盖配置,移除 pytest 启动时的强制开启逻辑。Gather、Matmul、TransData 和 Distributed ST 等用例恢复使用框架默认配置。 - 修复 ReplaceTensor 在 DDR VIEW 重绑定后未同步更新 COPY_IN 偏移的问题。将写入同一输出的 ASSEMBLE 之间的依赖 token 转移到实际写操作,保留 Conv1D 权重补零与有效权重写入的顺序。补充偏移回归测试,以及 token 搬移成功和拒绝分支的 UT。 See merge request: cann/pypto!7696 | 3 days ago | |
feat(pass): Remove slice false label Co-authored-by: 2501_92924845<niulinkai@huawei.com> # message auto-generated for no-merge-commit merge: !7696 merge slice1120 into master feat(pass): Remove slice false label Created-by: 2501_92924845 Commit-by: 2501_92924845 Merged-by: cann-robot Description: 背景 Slice 已默认开启。为让示例、测试和用户代码使用一致的编译路径,本 PR 下架 Python 侧及cpp侧的 enable_slice 开关,并清理用例中显式开启或关闭 Slice 的配置。 主要改动 - 移除 Python set_pass_options() 中的 enable_slice 参数及 get_pass_options() 中的对应字段。通过通用配置字典传入该选项时会报错。 - 清理示例、PyPTO Pro 和测试中的 Slice 覆盖配置,移除 pytest 启动时的强制开启逻辑。Gather、Matmul、TransData 和 Distributed ST 等用例恢复使用框架默认配置。 - 修复 ReplaceTensor 在 DDR VIEW 重绑定后未同步更新 COPY_IN 偏移的问题。将写入同一输出的 ASSEMBLE 之间的依赖 token 转移到实际写操作,保留 Conv1D 权重补零与有效权重写入的顺序。补充偏移回归测试,以及 token 搬移成功和拒绝分支的 UT。 See merge request: cann/pypto!7696 | 3 days ago | |
feat(ir): Harden io_text resume for fusion kernels Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !7820 merge feat/io_text_resume_ab_issue4 into master feat(ir): Harden io_text resume for fusion kernels Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: ## 一、背景 融合算子(moe、attention 等)在 checkpoint → load → resume 场景下出现三类问题: 1. dumper 会为掩码元素写出 inf/nan 浮点字面量,而 loader 的词法规则只接受十进制/科学计数法,导致 **load 直接失败**; 2. 文本加载时创建的 Operation 对象没有挂到宿主 function 的 operations_ 中,后续 pass 重建语句后,tensor 的 producer/consumer 集合可能保留悬空指针,触发 **CompareOp use-after-free**; 3. resume 一致性校验缺少“与历史编号无关”的文本比较能力,@id、!opid、派生名后缀、#memId 等历史相关标签会导致同一结构文本不相等,难以判断 resume 是否真正一致。 本 PR 对应其中的 A(非有限字面量)、B(文本 op 所有权)以及 ISSUE-4 的比较接口,不包含 tile scope、token/alias/inplace 等后续改动。 ## 二、改动 ### A. 非有限浮点字面量(io_text_loader.cpp / io_text_dumper_attr.cpp) - loader 的 TokFloat 正则支持 inf、-inf、+inf、nan(含符号); - dumper 仅在 std::isfinite(value) 为真时补 .0,避免把 inf/nan 写成 inf.0 之类不可回读的形式。 效果:dumper 写出的非有限字面量可以被 loader 原样读回,round-trip 稳定。 ### B. 文本 op 所有权(function.h / io_text_loader.cpp) - Function 新增 AddOperationPtr(std::shared_ptr<Operation>); - ParseStmtV0TensorOp 创建 Operation 后立即挂到 hostFunc_。 效果:文本加载的 op 生命周期由宿主 function 持有,pass 重建语句时不再留下悬空 producer/consumer,消除 CompareOp use-after-free。 ### ISSUE-4 比较接口(python/pypto/ir.py) 新增两个公开接口: - ir.normalize_ir_text(text):仅归一化历史相关标签 - @id、!opid 重编号; - 派生名数字后缀(如 f_1 / f_9、%x_0_1)折叠; - #memId(n) 归一为 #memId(*); - 不改结构、不改属性值。 - ir.text_equal(lhs, rhs):对两份文本先归一化再比较。 推荐用法: 用 ir.text_equal(direct_text, resume_text) 替换 ==; 说明:该接口用于 resume/round-trip 的一致性判定,不改变 IR 本身的编号生成规则(ISSUE-4 的编号策略仍按既定方案延后)。 See merge request: cann/pypto!7820 | 23 hours ago | |
feat(operation|pass)Adapt pre-stage quant for Kirin9030/KirinX90 Co-authored-by: fangrui_32<fangrui30@h-partners.com> # message auto-generated for no-merge-commit merge: !7180 merge master into master feat(operation|pass)Adapt pre-stage quant for Kirin9030/KirinX90 Created-by: fangrui_32 Commit-by: fangrui_32 Merged-by: cann-robot Description: Related issues:[[Requirement|需求建议]: Adapt pre-stage quant for Kirin9030/KirinX90](https://gitcode.com/cann/pypto/issues/3663) See merge request: cann/pypto!7180 | 3 days ago | |
fix(operation): Intercepting invalid scalar types for Rightshift, Leftshift and Gcd in python op Co-authored-by: 杨志邈<yangzhimiao@huawei.com> # message auto-generated for no-merge-commit merge: !7417 merge master into master fix(operation): Intercepting invalid scalar types for Rightshift, Leftshift and Gcd in python op Created-by: yangzhimiao Commit-by: 杨志邈 Merged-by: cann-robot Description: python测也需要拦截非整形的输入,以免从python impl的类型转换掩盖问题 关联issue:[#3799](https://gitcode.com/cann/pypto/issues/3799) See merge request: cann/pypto!7417 | 21 days ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
fix(pypto_pro):fix bug of img2ColConfig and convTile load Co-authored-by: Zehai<wangzehai3@huawei.com> # message auto-generated for no-merge-commit merge: !7805 merge fix_img2colConfig into master fix(pypto_pro):fix bug of img2ColConfig and convTile load Created-by: Zehai Commit-by: Zehai Merged-by: cann-robot Description: 1.修复img2ColConfig中的padding参数的错误 Changes:将padding从编译期常量修改为运行期参数 2.修复convTile load中cin向上cin0对齐的错误 Changes:将cin从向上cin0对齐修改为非cin0对齐 See merge request: cann/pypto!7805 | 21 hours ago | |
fix(tests): Delete unused simulator add test case Co-authored-by: chai-hw<chaizhengtong@huawei.com> # message auto-generated for no-merge-commit merge: !5957 merge delete_ut into master fix(tests): Delete unused simulator add test case Created-by: chai-hw Commit-by: chai-hw Merged-by: cann-robot Description: 删除无用ut See merge request: cann/pypto!5957 | 2 months ago | |
fix(exported_custom_op): Annotate output types and discover pypto nodes in nested onnx graphs Co-authored-by: Nikita Larichev<nikita.larichev@h-partners.com> # message auto-generated for no-merge-commit merge: !6848 merge prototype/nested-graph-discovery-3502 into master fix(exported_custom_op): Annotate output types and discover pypto nodes in nested onnx graphs Created-by: Nikita17 Commit-by: Nikita Larichev Merged-by: cann-robot Description: Fixes #3502. The filed defect is one of four seams that break the export of a scripted model with a pypto op inside a conditional: 1. **Root-only discovery.** find_pypto_nodes returns **0** on a nested model before and **1** after; zero nodes means no .so, so atc fails with E13010. Still root-only at node_reader.py:44 on master. 2. **onnx.checker rejects the nested export** — the synthesized output declares no type. 3. **A second root-only scan** in the GE standard-domain rewrite, leaving 2 empty-domain nodes in the subgraphs — the GE mixed-domain failure condition. 4. **Silently skipped opset stamping**, masked because torch writes ('pypto', 1) and our default is also 1. ## Why seam 2 needs the whole type Torch stamps the root output's type from the trace, so flat exports were always complete. Nested, it becomes a subgraph output nothing stamps, and the model output's type is merged from the If branch types — where a standard-op branch supplies the shape and no element type, so neither half suffices alone. Both nested topologies fail on the base commit. The annotation reads the op's own infer funcs, asking infer_shape twice under dynamic_axes and declaring only the dimensions that hold still. ## Changes 17 files, +1385 / -84. Four production files: - onnx/node_reader.py — one shared walk, iter_all_onnx_nodes, recursing on **attribute type** rather than op_type, so it covers containers nobody has enumerated yet. - onnx/export.py — annotate each output from the op's own infer funcs; warn rather than raise when an operand defeats it. - common/discovery.py and export/onnx_export.py — reuse that walk instead of a second root-only scan. - A demo at examples/03_advanced/exported_custom_op_litenpu/onnx/nested_control_flow/, shaped if A then add else if B then sub else mul. ## Verification of the exported behaviour A 6-topology by 2-axes matrix exports under onnx.checker — flat through depth 3, all-pypto branches included, static and dynamic_axes: **12 of 12 pass**, discovered-node count correct in every cell, nested cells failing on the base commit. Both UT suites pass with nothing lost by name: extension 339 to 342, tools 275 unchanged. On a 910B3 box with CANN 9.2.0, through a fresh build_ci.py install of this tip: the demo reaches ATC run success, markers balanced 3 of 3, .omc 62,450 bytes, and GE dispatches all 3 ops from below the root graph, 2 of them two levels down. The flat add floor still passes. A 3-cell A/B there shows GE never reads the declared shape: it is declared for onnx.checker, which gates whether a file is written. Related Issues: [#3502](https://gitcode.com/cann/pypto/issues/3502) See merge request: cann/pypto!6848 | 15 days ago | |
fix(exported_custom_op): Annotate output types and discover pypto nodes in nested onnx graphs Co-authored-by: Nikita Larichev<nikita.larichev@h-partners.com> # message auto-generated for no-merge-commit merge: !6848 merge prototype/nested-graph-discovery-3502 into master fix(exported_custom_op): Annotate output types and discover pypto nodes in nested onnx graphs Created-by: Nikita17 Commit-by: Nikita Larichev Merged-by: cann-robot Description: Fixes #3502. The filed defect is one of four seams that break the export of a scripted model with a pypto op inside a conditional: 1. **Root-only discovery.** find_pypto_nodes returns **0** on a nested model before and **1** after; zero nodes means no .so, so atc fails with E13010. Still root-only at node_reader.py:44 on master. 2. **onnx.checker rejects the nested export** — the synthesized output declares no type. 3. **A second root-only scan** in the GE standard-domain rewrite, leaving 2 empty-domain nodes in the subgraphs — the GE mixed-domain failure condition. 4. **Silently skipped opset stamping**, masked because torch writes ('pypto', 1) and our default is also 1. ## Why seam 2 needs the whole type Torch stamps the root output's type from the trace, so flat exports were always complete. Nested, it becomes a subgraph output nothing stamps, and the model output's type is merged from the If branch types — where a standard-op branch supplies the shape and no element type, so neither half suffices alone. Both nested topologies fail on the base commit. The annotation reads the op's own infer funcs, asking infer_shape twice under dynamic_axes and declaring only the dimensions that hold still. ## Changes 17 files, +1385 / -84. Four production files: - onnx/node_reader.py — one shared walk, iter_all_onnx_nodes, recursing on **attribute type** rather than op_type, so it covers containers nobody has enumerated yet. - onnx/export.py — annotate each output from the op's own infer funcs; warn rather than raise when an operand defeats it. - common/discovery.py and export/onnx_export.py — reuse that walk instead of a second root-only scan. - A demo at examples/03_advanced/exported_custom_op_litenpu/onnx/nested_control_flow/, shaped if A then add else if B then sub else mul. ## Verification of the exported behaviour A 6-topology by 2-axes matrix exports under onnx.checker — flat through depth 3, all-pypto branches included, static and dynamic_axes: **12 of 12 pass**, discovered-node count correct in every cell, nested cells failing on the base commit. Both UT suites pass with nothing lost by name: extension 339 to 342, tools 275 unchanged. On a 910B3 box with CANN 9.2.0, through a fresh build_ci.py install of this tip: the demo reaches ATC run success, markers balanced 3 of 3, .omc 62,450 bytes, and GE dispatches all 3 ops from below the root graph, 2 of them two levels down. The flat add floor still passes. A 3-cell A/B there shows GE never reads the declared shape: it is declared for onnx.checker, which gates whether a file is written. Related Issues: [#3502](https://gitcode.com/cann/pypto/issues/3502) See merge request: cann/pypto!6848 | 15 days ago | |
fix(build): Flush gcov data for pytest-forked subprocess coverage Co-authored-by: chengding888<chengding1@hisilicon.com> # message auto-generated for no-merge-commit merge: !6148 merge master into master fix(build): Flush gcov data for pytest-forked subprocess coverage Created-by: chengding888 Commit-by: chengding888 Merged-by: cann-robot Description: ## 背景 Python UT 通过 --forked(pytest-forked)并行执行用例,子进程以 os._exit() 退出,会跳过 atexit 钩子,导致 gcov 的 __gcov_exit 不被调用、.gcda 覆盖率数据不落盘。因此 --gcov 无法统计到由 Python UT 触发的 C++ 覆盖率(issue #2705)。 ## 解决方案 1. **python/tests/ut/conftest.py**:新增 pytest_runtest_teardown 钩子,当环境变量 PYPTO_GCOV_FLUSH=1 时手动调用 __gcov_dump(),把内存中的计数器写入 .gcda;并补充 duration_estimate 装饰器。 2. **build_ci.py**:--gcov 时注入 PYPTO_GCOV_FLUSH=1。 3. **cmake/intf.cmake**:gcov 模式追加链接选项 -Wl,--export-dynamic,-u,__gcov_dump,--whole-archive,-lgcov,--no-whole-archive。仅加 -u,__gcov_dump 时 _gcov_dump.o 不会被 lgcov.a 拉入,__gcov_dump 保持未定义,ctypes.CDLL(None) 找不到该符号,必须用 --whole-archive 强制拉入。 4. **cmake/scripts/gen_coverage.py**:lcov >= 2.0 时追加 --ignore-errors inconsistent,将 lcov 2.3.1 对 pybind11.cpp 的 mismatched end line 由 ERROR 降级为 WARNING,避免覆盖率生成失败。 5. **tools/scripts/pre_commit_check.sh**: - 修正覆盖率开关(--py_cov → --gcov)、clang 失败退出码、GTEST_FILTER 保存/恢复、覆盖率标签等; - 移除本地增量覆盖率门禁:本地 gen_coverage.py --increment 与 CI 的 get_ai_inc_cov.py(addlcov) 是两套独立实现,增量覆盖率无法保证与 CI 一致,门禁统一由 CI 兜底。 ## 验证 - bash tools/scripts/pre_commit_check.sh --full 全部通过(gnu / clang+ASan / Python / costmodel 仿真,耗时约 4779s)。 - 确认 Python UT 触发场景下 C++ 覆盖率数据(.gcda)可正常落盘并被 --gcov 统计。 Related Issue: #2705 See merge request: cann/pypto!6148 | 2 months ago | |
fix(machine): fix log quality issues in machine module. Co-authored-by: chai-hw<chaizhengtong@huawei.com> # message auto-generated for no-merge-commit merge: !5679 merge pyptolog_fix into master fix(machine): fix log quality issues in machine module. Created-by: chai-hw Commit-by: chai-hw Merged-by: cann-robot Description: PyPTO machine 模块日志整改 See merge request: cann/pypto!5679 | 3 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 1 month ago | ||
| 3 days ago | ||
| 3 days ago | ||
| 23 hours ago | ||
| 3 days ago | ||
| 21 days ago | ||
| 4 months ago | ||
| 21 hours ago | ||
| 2 months ago | ||
| 15 days ago | ||
| 15 days ago | ||
| 2 months ago | ||
| 3 months ago |