| Files | Last commit | Last update |
|---|---|---|
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 | |
feat(pypto): Add pypto.experimental.auto_mix_partition 0/1 config Co-authored-by: bytecode<dubingjia1@huawei.com> # message auto-generated for no-merge-commit merge: !6648 merge automixdocs into master feat(pypto): Add pypto.experimental.auto_mix_partition 0/1 config Created-by: bytecode Commit-by: bytecode Merged-by: cann-robot Description: feat(pypto): Add pypto.experimental.auto_mix_partition 0/1 config The level-based auto_mix_partition config (off/default/high strings and the N>100 custom op-limit) is removed from pypto.set_pass_options. The auto CV Mix merging switch of the ReduceCopyMerge pass is now configured solely via pypto.experimental.auto_mix_partition(0/1), defaulting to disabled (0). The C++ ReduceCopyMerge level mapping (MapAutoMixPartitionToLimits) is kept unchanged. Changes: - Add pypto.experimental.auto_mix_partition(value) accepting only 0/1, other values raise ValueError - Remove the auto_mix_partition parameter from pypto.set_pass_options and its read-back key from pypto.get_pass_options - Converge the tile_fwk_config default to 0 and tighten the schema range to 0~1 - Update the interface UT (test_config_options.py) and the set_pass_options API doc - Remove the sg_set_atomic_scope description from the set_pass_options doc Related Issues: #3431 See merge request: cann/pypto!6648 | 2 months ago | |
feat(platform): Add Platform config Co-authored-by: 2501_92924845<niulinkai@huawei.com> # message auto-generated for no-merge-commit merge: !6063 merge platformconfig into master feat(platform): Add Platform config Created-by: 2501_92924845 Commit-by: 2501_92924845 Merged-by: cann-robot Description: 背景: 原始的platform信息并沿用了机器层面命名。 本 PR 对平台配置域做概念规范化,统一到三个标准概念: 1. soc_series:原 short_soc_version(ini 键 Short_SoC_version),如 Ascend950; 2. soc_version:芯片分 bin(ini 键 SoC_version,每个 soc_version 一个 ini 文件),如 Ascend950PR_9589; 3. NPU_ARCH:核架构名称(ini 键 NpuArch),如 3510/2201。 A2/A3/A5 属于整机(chip + host CPU/网卡/机箱)层面的机器概念,不再用于平台配置选择。 Changes: - platform_config 精简为实际交付的 13 个 soc_version ini(69 -> 13),规格与 CANN 9.2.0 包内文件一致;Ascend910_9363、Ascend950DT_9581X 按交付需求保留 - DPlatform 枚举适配真实 soc_version,不再自定义枚举值:删除与实际芯片不符的 ASCEND_950DT_9579/ASCEND_950PR_9582(对应真实 bin 为 Ascend950DT_9572/Ascend950PR_9589), 补充 ASCEND_910_9363/ASCEND_950DT_9581X - platform.h 新增 DPlatformToNPUArch(),统一 soc_version -> NPU_ARCH 映射 (910B 系列 -> 2201,950 系列 -> 3510,Kirin -> 3113/3003) - GetCyclesForPass 仿真器选择改为按 NPU_ARCH 判断(3510 -> "A5",其余 -> "A2A3"), 不再按 A2A3/A5 机器名前缀匹配;A2A3/A5 仅作为 cost model 内部实现类型名保留 - 默认 device_platform 统一为标准格式 Ascend910B2(config_manager.h / tile_fwk_config.json) - CMakeLists 安装清单与交付 ini 清单保持一致 - UT 同步更新:枚举映射、legacy 格式兼容、NPU_ARCH 映射、ini 规格加载用例, 新增 Ascend910_9363 / Ascend950DT_9581X 用例 兼容性: - 旧格式 device_platform(如 "ASCEND_910B2")仍可识别,自动归一化为标准 soc_version 并打印告警; 其中 ASCEND_950DT_9579 -> Ascend950DT_9572、ASCEND_950PR_9582 -> Ascend950PR_9589, 与其原先实际加载的 ini 规格保持一致 - ASCEND_910C4 为无效值,回落默认 Ascend910B2(与原行为一致) Tests: - TestDevicePlatformConfig(16 例)、TestConfigManager、CostModelTest 相关用例全部通过; See merge request: cann/pypto!6063 | 2 months ago | |
fix(ir): Sort ComputeIncast inputs by magic for deterministic ordering Co-authored-by: Catherie<mayuan33@huawei.com> # message auto-generated for no-merge-commit merge: !6592 merge fix/incast-magic-sort into master fix(ir): Sort ComputeIncast inputs by magic for deterministic ordering Created-by: Catherie Commit-by: Catherie Merged-by: cann-robot Description: fix(ir): Sort ComputeIncast inputs by magic for deterministic ordering std::unordered_set 的遍历序取决于其存储的 shared_ptr 元素的堆地址,而堆地址受 ASLR 影响在不同进程间不同。这导致 hiddenfunc 的入参顺序不确定,函数 hash 与生成的 CCE 文件名每次运行都会变化。 Changes: - 在 RootFunctionBuilder::ComputeIncast 中遍历前按 tensor magic 对所有输入排序, 保证 hiddenfunc 入参序跨进程确定 - test(ir): Add UT for ComputeIncast deterministic ordering —— 补充 test_compute_incast_deterministic_order:loop-body 段消费 6 个独立参数,通过 golden 快照与入参顺序断言验证 hiddenfunc 入参序恒为 magic 升序(修复前 8/8 次 运行用例失败并呈现随机排列,修复后跨进程稳定) See merge request: cann/pypto!6592 | 2 months ago | |
feat(pass): ooo consider VL padding, insert sync support cv mix mte case Co-authored-by: GBowen666<libowen58@huawei.com> # message auto-generated for no-merge-commit merge: !6293 merge master into master feat(pass): ooo consider VL padding, insert sync support cv mix mte case Created-by: GBowen666 Commit-by: GBowen666 Merged-by: cann-robot Description: Related Issue: [[Requirement|需求建议]:支持ooo调度考虑VL对齐地址分配问题,insert_sync支持aic/aiv物理同构核mte的event id分配](https://gitcode.com/cann/pypto/issues/3320) 1、feat(pass): ooo consider VL padding, insert sync support cv mix mte case See merge request: cann/pypto!6293 | 2 months ago | |
fix(operation): Add missing arch and format constraint checks for matmul/scaled_mm Co-authored-by: shi-dingkun<shidingkun1@huawei.com> # message auto-generated for no-merge-commit merge: !5865 merge fix/matmul-arch-and-format-constraint-check into master fix(operation): Add missing arch and format constraint checks for matmul/scaled_mm Created-by: shi-dingkun Commit-by: shi-dingkun Merged-by: cann-robot Description: 为 matmul/scaled_mm 补齐接口文档中缺失的业务约束检查以及文档针对多核切K功能的描述修正,并修正 FP4 UT。 ## 约束检查 | 约束 | 检查位置 | |---|---| | 输入→输出 dtype 组合表(基础/量化/反量化场景) | __validate_out_dtype | | A2/A3 不支持 DT_HF8 输入 | __validate_inputs | | DT_HF8 不支持 NZ 格式 | __validate_inputs | | A2/A3 不支持 trans_mode | __validate_trans_mode | | scale_a/scale_b 仅支持 ND 格式 | __validate_scaled_inputs | | matmul 拒绝 FP4 输入(仅 scaled_mm 支持) | __validate_matmul_fp4_input | ## FP4 UT 修正 test_fp4_packed_shape.py 重写为正规写法:独立 X/Y 矩阵,scaled_mm + scale tensors + DT_FP16 输出。 ## 测试 test_matmul_op.py 20/20 通过,test_fp4_packed_shape.py 1/1 通过。 Related Issues: #3213 See merge request: cann/pypto!5865 | 2 months 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): relax MX matmul physical shape checks Co-authored-by: fa<yangzf993@163.com> # message auto-generated for no-merge-commit merge: !6635 merge master into master fix(pypto_pro): relax MX matmul physical shape checks Created-by: fafafafafa Commit-by: fa 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!6635 | 2 months 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 | |
refactor(exported_custom_op): Rename the torch_custom_op package to torch_custom_op_litenpu Co-authored-by: Nikita Larichev<nikita.larichev@h-partners.com> # message auto-generated for no-merge-commit merge: !6511 merge v3_02a_rename_litenpu into master refactor(exported_custom_op): Rename the torch_custom_op package to torch_custom_op_litenpu Created-by: Nikita17 Commit-by: Nikita Larichev Merged-by: cann-robot Description: Requested on https://gitcode.com/cann/pypto/merge_requests/5600. This PR performs the rename on the files that already exist on master, so that the rest of the stack lands on the new name instead of renaming a directory it did not create. **API surface map for this whole series — every def with its signature, introducing PR and callers:** https://claude.ai/code/artifact/a42e70ca-5cf9-4a67-8eb3-b7d3c8e17f1a Changes: - Move python/pypto/extensions/torch_custom_op/ to python/pypto/extensions/torch_custom_op_litenpu/ (5 files) and python/tests/ut/torch_custom_op/ to python/tests/ut/torch_custom_op_litenpu/ (6 files). - Rewrite the 11 references to the old path: 5 from ... import statements, 2 importlib.import_module() calls, and 4 docstring references (the two package docstrings, a test-directory path, and a module path named in a test docstring). - Re-wrap extensions/__init__.py:9, which crosses the 120-column limit once the name is 8 characters longer. - Document what the _litenpu suffix scopes the package to: it names the deploy path, not a soc check inside the package. Nothing here inspects soc_version - it is forwarded verbatim to pypto.set_codegen_options. The constraint lives in pypto core, where the kernel must compile to exactly one object, and LiteNPU is the soc family structurally guaranteed to produce one. No packaging change: pyproject.toml already ships the subpackage through the pypto.extensions.* glob. No behaviour change. Review note: this is 11 file renames plus 11 reference rewrites, and GitCode renders it that way - 12 files changed, 18 insertions(+), 11 deletions(-). (Without rename detection the same change would read as 23 files and 1229/1222 lines, which is why the small numbers are the real ones.) Related Issues: [#2869](https://gitcode.com/cann/pypto/issues/2869), [#5158](https://gitcode.com/cann/pypto/merge_requests/5158) See merge request: cann/pypto!6511 | 2 months 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 |
|---|---|---|
| 4 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 4 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 3 months ago |