Merged
修复dump 数据bug #5436
Inspiron_stAdd on Aug 13
修复dump 数据bug #5436
Merged
Inspiron_stAdd on Aug 13
Inspiron_st
Aug 13

修复dump 数据bug

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for Inspiron_st's contribution.)
Inspiron_stInspiron_st
Aug 13 Created pull request, commit 7d24fb74
atomgit-bot
atomgit-bot
Aug 13 Comments:

变更摘要

本 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"。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Aug 13 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Aug 13 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Aug 13 Comments:

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 /approve or /lgtm
  • Commenting /approve implies 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. 👍

likedislike
172 messages are collapsed here。 See more
congqiannan
congqiannanCollaborators
Aug 21 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Aug 21 Added label: lgtm
CANN-robot
CANN-robotCollaborators
Aug 21 Comments:

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.

likedislike
poorwillpoorwillCollaborators
Aug 21 Resolved final issue
CANN-robotCANN-robotCollaborators
Aug 21 Merged pull request