| Files | Last commit | Last update |
|---|---|---|
fix(codegen): Uniquify the LiteNPU kernel entry name by function hash Co-authored-by: Nikita Larichev<nikita.larichev@h-partners.com> # message auto-generated for no-merge-commit merge: !5598 merge v3_01_litenpu into master fix(codegen): Uniquify the LiteNPU kernel entry name by function hash Created-by: Nikita17 Commit-by: Nikita Larichev Merged-by: cann-robot Description: fix(codegen): Uniquify the LiteNPU kernel entry name by function hash Split out of https://gitcode.com/cann/pypto/merge_requests/5158 for reviewability. This is the only part of that PR that changes framework code, and it is independent of the rest of the series. Two kernels built in separate processes can receive the same generated entry symbol, because the function-id counter that feeds the magic name restarts per process. When their artifacts are combined into one offline model the second kernel silently overwrites the first. Appending the function hash to the entry name makes the symbol depend on the kernel body rather than on process-local state. Changes: - Append the function hash to the LiteNPU kernel entry name so distinct kernel bodies cannot share an entry symbol - Add a Kirin9030 test that builds the same-named kernel in two fresh subprocesses and asserts identical bodies keep one name while different bodies get different names ### Revision notes - **Since the previous revision:** the duplicated LiteNPU entry-name formula is now a single member, Function::GetMagicNameWithHash(), called from both codegen sites and the launcher. The interim framework/src/interface/utils/kernel_entry_name.{h,cpp} pair introduced by an earlier revision is deleted — Function already lives under interface/, so a member has the same layering and link properties as a free function there and needs no new file. The test's build driver is now a real module, kernel_entry_uniqueness_driver.py, copied per build with the operation passed as an argument, rather than a templated source string. - **Review feedback:** answers all three comments on this PR — reuse rather than a second formula, a copied driver rather than a generated one, and the helper as a member of Function. - **Against custom_pypto_20260717_rebased, the monolithic branch this series was split from:** adds test_kirin9030_kernel_entry_uniqueness.py (4 tests), absent there. ### Why this is needed at all Before this change the emitted LiteNPU entry symbol was TENSOR_default_loop_1_Unroll1_PATH0_hiddenfunc0_5_main — **byte-identical across unrelated kernels**. On device that mis-dispatched: a two-kernel pipeline failed precision at cosine 0.924405, because one kernel's binary shadowed the other inside the combined offline model. An upstream change complicates the picture and is worth naming, because it invites the wrong conclusion. 51ff0e528 *"feat(ir): Switch new_ir config to true"* (2026-08-12) flipped new_ir from False to True, moving kernels from the AST parser onto the PIL pipeline. The two pipelines name functions differently, so magic names **acquired** a per-kernel component they did not have before. That was a feature switch, not a naming fix. It does not make this change unnecessary. On the current pipeline, across the shipped demo set, 16 distinct magic names include **3 that are each shared by two or three different kernels**: | magic name | kernels sharing it | |---|---| | add_kernel_PATH0_hiddenfunc_5 | add, add_softmax_pipeline, mixed_ascendc_pypto | | softmax_kernel_PATH0_hiddenfunc_5 | softmax, add_softmax_pipeline | | pypto_add_kernel_PATH0_hiddenfunc_5 | mixed_ascendc_pypto, mixed_torch_pypto | The function id is _5 in every one — Program::Reset() rewinds the counter per process, so the id never disambiguates. Each operator of a multi-operator offline model is exported and built by its own process and the artifacts are combined afterwards, which is exactly the regime where those names meet. test_distinct_entry_names_differ_only_in_the_content_hash asserts the collision directly: two same-named kernels with different bodies share a magic name and are separated by the content hash alone. new_ir=False also remains a supported argument, and restores the fully generic name where the hash does all of the work. Related Issues: [#2869](https://gitcode.com/cann/pypto/issues/2869), [#5158](https://gitcode.com/cann/pypto/merge_requests/5158) See merge request: cann/pypto!5598 | 2 months ago | |
style(all): Apply additional clang-format corrections across codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4883 merge style-cpp into master style(all): Apply additional clang-format corrections across codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Apply additional clang-format corrections across codebase See merge request: cann/pypto!4883 | 4 months ago | |
fix(codegen): Fix operandWithMagic out-of-bounds initialization Co-authored-by: anyangle<anyangle@huawei.com> # message auto-generated for no-merge-commit merge: !5678 merge issue into master fix(codegen): Fix operandWithMagic out-of-bounds initialization Created-by: quadrate Commit-by: anyangle Merged-by: cann-robot Description: 1. PyPTO codegen 模块日志整改 2. [Issue:2824](https://gitcode.com/cann/pypto/issues/2824)问题修改 3. [Issue:3020](https://gitcode.com/cann/pypto/issues/3020)问题修改 See merge request: cann/pypto!5678 | 3 months ago | |
fix(codegen): Fix operandWithMagic out-of-bounds initialization Co-authored-by: anyangle<anyangle@huawei.com> # message auto-generated for no-merge-commit merge: !5678 merge issue into master fix(codegen): Fix operandWithMagic out-of-bounds initialization Created-by: quadrate Commit-by: anyangle Merged-by: cann-robot Description: 1. PyPTO codegen 模块日志整改 2. [Issue:2824](https://gitcode.com/cann/pypto/issues/2824)问题修改 3. [Issue:3020](https://gitcode.com/cann/pypto/issues/3020)问题修改 See merge request: cann/pypto!5678 | 3 months ago | |
refactor(build): Reuse the common compilation options from common cmake. Co-authored-by: Feiteng Zheng<zhengfeiteng1@h-partners.com> # message auto-generated for no-merge-commit merge: !5292 merge 20260728-intf-pub-2 into master refactor(build): Reuse the common compilation options from common cmake. Created-by: zhengfeiteng Commit-by: Feiteng Zheng Merged-by: cann-robot Description: 切换使用 cann/cmake 仓规定的 intf_pub。 - 通过CANN_GLIBCXX_USE_CXX11_ABI属性设置tile_fwk_calculator的_GLIBCXX_USE_CXX11_ABI Related Issue: #2650 See merge request: cann/pypto!5292 | 3 months ago | |
refactor(codegen): Delete invoke param offset Co-authored-by: Bee.Hujun<Bee.hujun@huawei.com> # message auto-generated for no-merge-commit merge: !4177 merge codegen/delete_locOffset into master refactor(codegen): Delete invoke param offset Created-by: cam_bxh Commit-by: Bee.Hujun Merged-by: cann-robot Description: 1. Delete invoke param offset See merge request: cann/pypto!4177 | 5 months ago | |
fix(codegen): Propagate parallel task exceptions instead of swallowing them Co-authored-by: anyangle<anyangle@huawei.com> # message auto-generated for no-merge-commit merge: !5266 merge compile_fix into master fix(codegen): Propagate parallel task exceptions instead of swallowing them Created-by: quadrate Commit-by: anyangle Merged-by: cann-robot Description: 1. 多线程 Codegen 确定性 Kernel 编译 Related Issue:[https://gitcode.com/cann/pypto/issues/2913](https://gitcode.com/cann/pypto/issues/2913) 2. Issue 背景:GenCode 内的 ExecuteParallelCompile 编译失败抛出 COMPILE_CODE_FAILED 被吞掉,leafDict[hash] = leaf 未执行,leafDict不完整。下游 ConstructCodeInfo → RunCompileAicoreKernelStage → RunEncodeStage 继续访问不完整的 leafDict,触发 std::unordered_map::at() 越界,抛出 F00003 RuntimeError: _Map_base::at 二次异常,掩盖了真实的编译错误 根因:codeGen在并行编译遇到错误抛出异常时,只记录日志,并不传播异常和终止剩余task,导致报错在第二现场F00003 RuntimeError: _Map_base::at处 解决方法:修改 ParallelExecuteAndWait,使其在 task 失败时记录错误、提前终止剩余 task、并在所有线程 join 后重新抛出首个 COMPILE_CODE_FAILED异常 修改前:  修改后:  See merge request: cann/pypto!5266 | 3 months ago | |
refactor(codegen): Delete invoke param offset Co-authored-by: Bee.Hujun<Bee.hujun@huawei.com> # message auto-generated for no-merge-commit merge: !4177 merge codegen/delete_locOffset into master refactor(codegen): Delete invoke param offset Created-by: cam_bxh Commit-by: Bee.Hujun Merged-by: cann-robot Description: 1. Delete invoke param offset See merge request: cann/pypto!4177 | 5 months ago | |
refactor(codegen): Delete invoke param offset Co-authored-by: Bee.Hujun<Bee.hujun@huawei.com> # message auto-generated for no-merge-commit merge: !4177 merge codegen/delete_locOffset into master refactor(codegen): Delete invoke param offset Created-by: cam_bxh Commit-by: Bee.Hujun Merged-by: cann-robot Description: 1. Delete invoke param offset See merge request: cann/pypto!4177 | 5 months ago | |
fix(codegen): Propagate parallel task exceptions instead of swallowing them Co-authored-by: anyangle<anyangle@huawei.com> # message auto-generated for no-merge-commit merge: !5266 merge compile_fix into master fix(codegen): Propagate parallel task exceptions instead of swallowing them Created-by: quadrate Commit-by: anyangle Merged-by: cann-robot Description: 1. 多线程 Codegen 确定性 Kernel 编译 Related Issue:[https://gitcode.com/cann/pypto/issues/2913](https://gitcode.com/cann/pypto/issues/2913) 2. Issue 背景:GenCode 内的 ExecuteParallelCompile 编译失败抛出 COMPILE_CODE_FAILED 被吞掉,leafDict[hash] = leaf 未执行,leafDict不完整。下游 ConstructCodeInfo → RunCompileAicoreKernelStage → RunEncodeStage 继续访问不完整的 leafDict,触发 std::unordered_map::at() 越界,抛出 F00003 RuntimeError: _Map_base::at 二次异常,掩盖了真实的编译错误 根因:codeGen在并行编译遇到错误抛出异常时,只记录日志,并不传播异常和终止剩余task,导致报错在第二现场F00003 RuntimeError: _Map_base::at处 解决方法:修改 ParallelExecuteAndWait,使其在 task 失败时记录错误、提前终止剩余 task、并在所有线程 join 后重新抛出首个 COMPILE_CODE_FAILED异常 修改前:  修改后:  See merge request: cann/pypto!5266 | 3 months ago | |
feat(codegen): Support KirinX90 LiteNPU Co-authored-by: zyingshu<zhangyingshu1@h-partners.com> # message auto-generated for no-merge-commit merge: !3691 merge 0528_master into master feat(codegen): Support KirinX90 LiteNPU Created-by: zyingshu Commit-by: zyingshu Merged-by: cann-robot Description: Related Issue: [[Requirement|需求建议]: pyPTO支持端侧kirinX90](https://gitcode.com/cann/pypto/issues/2027) Support KirinX90 LiteNPU See merge request: cann/pypto!3691 | 5 months ago | |
feat(Operation): Add pypto.conv_backward_input and its 2D implementation on A2/A3 Co-authored-by: hongyiliu111<liuhongyi1@huawei.com> Co-authored-by: xutianlong1<xutianlong1@huawei.com> Co-authored-by: wangshenhao<wangshenhao1@huawei.com> # message auto-generated for no-merge-commit merge: !5528 merge dev into master feat(Operation): Add pypto.conv_backward_input and its 2D implementation on A2/A3 Created-by: hongyiliu111 Commit-by: wangshenhao;hongyiliu111;xutianlong1 Merged-by: cann-robot Description: feat(Operation): Add pypto.conv_backward_input and its 2D implementation on A2/A3 Add pypto.conv_backward_input interface to compute the gradient of convolution with respect to the input tensor, and implement its 2D support spanning the frontend interface, backend operation implementation and MTE codegen Changes: - Add pypto.conv_backward_input frontend interface with parameter validation - Implement ConvBackwardInput 2D backend operation and codegen - Add UT/ST test cases for the 2D implementation See merge request: cann/pypto!5528 | 3 months ago | |
fix(codegen): Fix operandWithMagic out-of-bounds initialization Co-authored-by: anyangle<anyangle@huawei.com> # message auto-generated for no-merge-commit merge: !5678 merge issue into master fix(codegen): Fix operandWithMagic out-of-bounds initialization Created-by: quadrate Commit-by: anyangle Merged-by: cann-robot Description: 1. PyPTO codegen 模块日志整改 2. [Issue:2824](https://gitcode.com/cann/pypto/issues/2824)问题修改 3. [Issue:3020](https://gitcode.com/cann/pypto/issues/3020)问题修改 See merge request: cann/pypto!5678 | 3 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 2 months ago | ||
| 4 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 5 months ago | ||
| 3 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 3 months ago | ||
| 5 months ago | ||
| 3 months ago | ||
| 3 months ago |