Pull Request has been successfully merged by CANN-robot.
(Thank you for Inspiron_st's contribution.)变更摘要
本 PR 主要修复 debug dump 数据相关 bug:将此前依赖 pto 命名空间下的泛型打印工具 pto::GetDTypeName<...> 与 pto::PrintValue<pto::PrintFormat::Width8_Precision4> 的代码生成逻辑,替换为独立的 __pypto_dtype_name<...> 与 __pypto_print_val 辅助函数,并在 JIT 编译与算子编译流程中补充对自定义头文件 _pypto_tprint.h 的拷贝与引用注入,确保 dump 代码在最终生成的 kernel.cpp/impl 文件中能够正确编译。
主要改动
- 替换 dump 代码生成中的类型名与数值打印函数:
framework/src/interface/pypto_pro/backend/backend_cce_ops.cpp中MakeDebugDumpTileCodegenCCE生成的内容由pto::GetDTypeName<...>()改为__pypto_dtype_name<...>(),由pto::PrintValue<pto::PrintFormat::Width8_Precision4>(...)改为__pypto_print_val(...),覆盖 Acc Tile 与 Tile Window 两类调试输出路径。 - 同步更新对应单元测试断言:
framework/tests/ut/interface/src/pypto_pro/backend/test_backend_cce_ops.cpp中DebugDumpTileFullAndWindow与DebugDumpAccTileUsesWorkspace用例的期望字符串由pto::PrintValue<pto::PrintFormat::Width8_Precision4>调整为__pypto_dtype_name与__pypto_print_val。 - JIT 产物写入时自动携带 dump 辅助头文件:
python/pypto_pro/runtime/jit.py的_write_codegen_artifacts在内容含__pypto_dtype_name或__pypto_print_val时,将opc/_pypto_tprint.h拷贝到构建目录,并在首个#include <pto/pto-inst.hpp>后注入#include "_pypto_tprint.h"。 - 算子编译流程补充头文件分发并避免重复 include:
python/pypto_pro/runtime/opc/pypto_compile.py中generate_binary_headers在kernel.cpp已引用_pypto_tprint.h时将该头文件拷贝到二进制目录;pypto_compile_op在检测到TPRINT(、__pypto_dtype_name或__pypto_print_val时拷贝头文件,并仅在未包含时注入#include "_pypto_tprint.h"。


Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/pypto | ✅ gaoxiang618, congqiannan (2/2) | ✅ gaoxiang618, congqiannan (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
u010986451, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/approve


The MR can not be merged, because of CodeReview discussion not resolved
If you want to solve this problem, you can click here to do it in the FAQs.


修复dump 数据bug