| Files | Last commit | Last update |
|---|---|---|
feat(codegen): Emit CCE opMagic/semanticLabel debug maps for TOOLKIT Co-authored-by: anyangle<anyangle@huawei.com> # message auto-generated for no-merge-commit merge: !7086 merge ide_codegen into master feat(codegen): Emit CCE opMagic/semanticLabel debug maps for TOOLKIT Created-by: quadrate Commit-by: anyangle Merged-by: cann-robot Description: Codegen适配 IDE(TOOLKIT)四联动场景:在生成 CCE 源码时补充调试映射能力,向 IDE 提供 CCE 代码位置与对应 TileOp 的 opMagic、semanticLabel 之间的关系,便于在调试过程中完成 CCE 与 TileOp 语义的关联跳转。 当 CFG_COMPILE_DEBUG_MODE 为 CFG_DEBUG_ALL 时,CodeGenNPU 在 CCE 生成完成后调用 tools/scripts/gen_cce_debug_map.py,扫描 CCE 输出目录并生成 cce_opmagic_map.json 与 cce_semantic_label.json。同时 InsertOpComment 会可选追加 [semanticLabel:...] 标记,供脚本解析。 另外,在compile_debug_mode模式下将 kernel_aicore 目录的绝对路径写入 run.data(key: kernel_aicore_path), 便于 IDE / 调试工具定位 CCE 源码目录。 Changes: - 新增 tools/scripts/gen_cce_debug_map.py,从 CCE 注释构建 opMagic / semanticLabel 映射表 - 在全量调试模式下由 CodeGenNPU::GenCode 调用调试映射脚本 - 扩展 InsertOpComment,在 opMagic 旁输出 semanticLabel - 新增 KEY_KERNEL_AICORE_PATH,并在 GenCode 阶段将 kernel_aicore 路径写入 run.data - 通过 MANIFEST.in / CMakeLists.txt 打包并安装该脚本 See merge request: cann/pypto!7086 | 11 days ago | |
feat(machine): Support host ctrlflow cache by jit Co-authored-by: qq_52905393<liuzhen180@huawei.com> # message auto-generated for no-merge-commit merge: !5741 merge dev-host-ctrl-jit into master feat(machine): Support host ctrlflow cache by jit Created-by: qq_52905393 Commit-by: qq_52905393 Merged-by: cann-robot Description: 1、支持通过 jit ready_on_host_tensors 配置 npu_name: cpu_name 传入配对关系,算子 kernel 传入值依赖 tensor 对应的 cpu tensor 2、支持传入值依赖 tensor 场景下在 host 侧做 controlflow cache See merge request: cann/pypto!5741 | 2 months ago | |
feat(machine): Support for 9201 Co-authored-by: qq_52905393<liuzhen180@huawei.com> # message auto-generated for no-merge-commit merge: !6940 merge dev-adapt-next into master feat(machine): Support for 9201 Created-by: qq_52905393 Commit-by: qq_52905393 Merged-by: cann-robot Description: 适配 9201 特性 See merge request: cann/pypto!6940 | 16 days ago | |
refactor(machine): Drop execute-path RUNTIME_SlotMarkNeedAlloc covered by path marking Co-authored-by: songyangyang18<songyangyang18@huawei.com> # message auto-generated for no-merge-commit merge: !6754 merge clean into master refactor(machine): Drop execute-path RUNTIME_SlotMarkNeedAlloc covered by path marking Created-by: songyangyang18 Commit-by: songyangyang18 Merged-by: cann-robot Description: ## 问题背景: Execute 图上的 NeedAlloc 标记曾用于修复非 assemble 算子(如 pypto.full), 产出的 assemble 目标漏发 RUNTIME_SlotMarkNeedAlloc 的问题。 目前,IR builder 会把所有非 assemble 生产者记录到 tensorConstructFunc_,PATH 级标记constructAssembleSlotList已经覆盖这些 slot,Execute 图上的标记因此变得冗余。 ## 删除的安全性: - 每个 PATH 只有一个 root,PATH 级标记在 PATH 入口发出,早于该 root 的 RUNTIME_RootAlloc。Execute 图标记的非参数 slot 都已被 PATH 标记过,且该标志是幂等的。 - Execute 图额外标记的只有 kernel 参数 slot。运行时 ResolveOutcastAddress 对这些 slot走外部 IO 分支,从不读取 NeedAlloc 标志,因此这些标记本身不起作用。 - 作用:参数 slot 不再计入 constructAssembleNeedAllocRuntimeSlots,totalAssembleOutcastSlot 不再为它们多预留 InnerTemporal slot。 ## 问题样例: 下面的算子,out会被错误纳入assemble outcast内存分配,去掉excute路径,恢复正常。 @pypto.frontend.jit(**_JIT) def _k_out_compute_then_assemble(src: _T, out: _T): pypto.set_vec_tile_shapes(TILE, TILE) out[:] = pypto.mul(src.view([BS, HIDDEN], [0, 0]), 2.0) for i in pypto.loop(N_ROW, name="NA_OCA", idx_name="i"): pypto.set_vec_tile_shapes(TILE, TILE) v = src.view([TILE, HIDDEN], [i * TILE, 0]) pypto.assemble(pypto.mul(v, 4.0), [i * TILE, 0], out) See merge request: cann/pypto!6754 | 1 month ago | |
fix(config|frontend): Refresh JIT options when global config changes Co-authored-by: zhaojunhan<zhaojunhan1@huawei.com> # message auto-generated for no-merge-commit merge: !7567 merge fix/jit-config-refresh into master fix(config|frontend): Refresh JIT options when global config changes Created-by: nanguag Commit-by: zhaojunhan Merged-by: cann-robot Description: ## 问题 同一个 JIT kernel 在不同静态 shape 下重新编译时,可能继续使用首次创建 KernelModule 时读取的配置: - 全局 compile_monitor_enable 从 2 改为 0 后,后续编译仍输出监控信息。 - 全局 runtime_debug_mode 按 3 → 0 → 3 切换时,dump 开关未随配置变化。 ## 修改 - 每次调用 JIT kernel 时读取当前全局配置,刷新未在 @pypto.jit 中显式指定的 compile_monitor_enable 和 runtime_debug_mode;JIT 显式参数保持更高优先级。 - 将这两个配置值纳入 KernelModule 缓存键,使配置变化后创建使用新配置的模块。 - 移除三个 dump 入口对 runtime_debug_mode 首次读取结果的静态缓存。 ## 验证 使用不同静态 shape 触发重新编译: - Host DFX 用例:compile_monitor_enable 从 2 改为 0,监控输出从 178 行降为 0 行,2/2 断言通过。 - Debug DFX 用例:runtime_debug_mode 按 3 → 0 → 3 切换,三次编译分别产生 7、0、7 个 dump 文件,3/3 断言通过。 在当前测试环境中,需设置 PTO_TILE_LIB_CODE_PATH=/home/zjh/pto-isa,以使用与 PyPTO 匹配的 PTO 头文件。 ## 性能 固定 shape、复用已编译 kernel 的测量显示:刷新配置使 Python 调用路径增加约 8 µs/次;完整 NPU 调用观察到约 15 µs/次的差值,其中包含设备调度波动。 See merge request: cann/pypto!7567 | 11 days 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 | |
feat(pass): Add pipeall debug, fix SeqSchedule loop, update kirin tests Co-authored-by: GBowen666<libowen58@huawei.com> # message auto-generated for no-merge-commit merge: !6958 merge master into master feat(pass): Add pipeall debug, fix SeqSchedule loop, update kirin tests Created-by: GBowen666 Commit-by: GBowen666 Merged-by: cann-robot Description: Related Issue: [[Requirement|需求建议]: 新增 enable_pipe_all 全同步调试开关,修复 SeqSchedule 死循环,适配 Kirin(LiteNPU)编译链并更新 Kirin UT 用例](https://gitcode.com/cann/pypto/issues/3585) 1、feat(pass): Add pipeall debug, fix SeqSchedule loop, update kirin tests See merge request: cann/pypto!6958 | 1 month ago | |
feat(pass): Add pipeall debug, fix SeqSchedule loop, update kirin tests Co-authored-by: GBowen666<libowen58@huawei.com> # message auto-generated for no-merge-commit merge: !6958 merge master into master feat(pass): Add pipeall debug, fix SeqSchedule loop, update kirin tests Created-by: GBowen666 Commit-by: GBowen666 Merged-by: cann-robot Description: Related Issue: [[Requirement|需求建议]: 新增 enable_pipe_all 全同步调试开关,修复 SeqSchedule 死循环,适配 Kirin(LiteNPU)编译链并更新 Kirin UT 用例](https://gitcode.com/cann/pypto/issues/3585) 1、feat(pass): Add pipeall debug, fix SeqSchedule loop, update kirin tests See merge request: cann/pypto!6958 | 1 month ago | |
feat(machine): Support for 9201 Co-authored-by: qq_52905393<liuzhen180@huawei.com> # message auto-generated for no-merge-commit merge: !6940 merge dev-adapt-next into master feat(machine): Support for 9201 Created-by: qq_52905393 Commit-by: qq_52905393 Merged-by: cann-robot Description: 适配 9201 特性 See merge request: cann/pypto!6940 | 16 days ago | |
fix(machine): Add value depend check for ifstmt Co-authored-by: qq_52905393<liuzhen180@huawei.com> # message auto-generated for no-merge-commit merge: !7361 merge dev-fix-host-ctrl into master fix(machine): Add value depend check for ifstmt Created-by: qq_52905393 Commit-by: qq_52905393 Merged-by: cann-robot Description: 检测值依赖和 insert wait_aicore_start 的时候,增加 ifstmt 的检测 See merge request: cann/pypto!7361 | 23 days ago | |
feat(machine): Support for 9201 Co-authored-by: qq_52905393<liuzhen180@huawei.com> # message auto-generated for no-merge-commit merge: !6940 merge dev-adapt-next into master feat(machine): Support for 9201 Created-by: qq_52905393 Commit-by: qq_52905393 Merged-by: cann-robot Description: 适配 9201 特性 See merge request: cann/pypto!6940 | 16 days 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(Machine): Add FedProf and AicpuProf for machine profiling Co-authored-by: Jie Yin<yinjie27@huawei.com> # message auto-generated for no-merge-commit merge: !6980 merge pgo-framework into master feat(Machine): Add FedProf and AicpuProf for machine profiling Created-by: yinjie27_ Commit-by: Jie Yin Merged-by: cann-robot Description: feat(Machine): Add FedProf and AicpuProf for machine profiling Rework the machine-side profiling data path around a unified host profiler (FedProf). The old free-function dump machinery is replaced by a class-owned design; profiling buffers are allocated once at device init and addressed directly through DeviceArgs, so device cores no longer rely on the sharedBuffer slot to locate their per-core prof data. Changes: - Add the FedProf singleton: owns per-core prof buffers, the AICPU launch-round prof buffer, the dump thread and JSON dumping; split into fed_prof.{h,cpp}, fed_prof_aicpu_prof.cpp and fed_prof_io_json.{h,cpp}; remove dump_device_perf.* and runtime/runner/device_perf.* - Add DeviceArgs::perCoreProfAddr / aicpuProfAddr; per-core prof slots are addressed as perCoreProfAddr + idx * FED_PROF_PER_CORE_PROF_ALIGNED_SIZE, and aicore entry/dfx/drco, the AICPU task manager, AICoreHAL and the ESL model are updated accordingly; SHAK_BUF_PER_CORE_PROF_INDEX is removed - Allocate per-core prof data as a single contiguous 512B-aligned block at device init (DeviceDfx::Init -> FedProf::PerCoreProfAllocateData), gated by DUMP_DEVICE_PERF / HostProf / runtime debug mode, idempotent and released together with the AICPU prof buffer - Add AICPU launch-round profiling (FedProfAicpuProf): dump thread, swimlane JSON and machine_perf_trace.py integration, output via KEY_AICPU_PERF_GRAPH_PATH - Reorganize device headers: add aikernel_profile.h (prof structures and sizes) and aikernel_launch.h (KernelArgs/KernelSharedBuffer/TaskEntry/ParallelDevTask moved out of aicpu_common.h); rename aicpu_perf.h to aikernel_profile_aicpu.h and update the CMake install list - Update UT/ST cases, the ESL model hook and launcher call sites to the new interfaces Commits: - feat(Machine): Add FedProf as the profiler - feat(Machine): Add AicpuProf for profiling - feat(Machine): Normalize AicpuProf - feat(Machine): Normalize profiling allocation See merge request: cann/pypto!6980 | 1 month 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 |
| Files | Last commit | Last update |
|---|---|---|
| 11 days ago | ||
| 2 months ago | ||
| 16 days ago | ||
| 1 month ago | ||
| 11 days ago | ||
| 4 months ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 16 days ago | ||
| 23 days ago | ||
| 16 days ago | ||
| 3 months ago | ||
| 1 month ago | ||
| 4 months ago |