Merged
新增支持超大Tensor的Dump功能 #6371
jcmrn0930Add on Sep 23
新增支持超大Tensor的Dump功能 #6371
Merged
jcmrn0930Add on Sep 23
jcmrn0930
jcmrn0930Collaborators
Sep 23

描述

新增超大Tensor的Dump功能,tools仓修改show_kernel_debug_data的解析数据功能以及样例修改

关联的Issue

测试

文档更新

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for jcmrn0930's contribution.)
jcmrn0930jcmrn0930Collaborators
Sep 23 Created pull request, commit 68685eae
atomgit-bot
atomgit-bot
Sep 23 Comments:

变更摘要

本 PR 为 Dump 功能新增了对超大 Tensor 的支持。当单个 Tensor 的 TLV 长度超过 ringBufLen 时,asc_dump_impl 会在 __NPU_ARCH__ == 3510 且硬件受支持的前提下,改走新增的 asc_dump_super_tensor_impl,将 Tensor 按环缓冲容量分块写入。配套地在 asc_debug_types.h 中扩展了 DumpType 枚举与两个新的 TLV 结构体,并新增头文件实例化检查用例。

主要改动

  • 新增分块超大 Tensor Dump 流程: 新增 asc_dump_super_tensor_impl,按 get_super_tensor_payload_capacity 计算每块可容纳的 payload 容量,循环将 Tensor 按偏移切分写入,首块写 DumpSuperTensorTlv、后续块写 DumpSuperTensorBodyTlv,并同步更新写指针。
  • 扩展 Dump 类型与数据结构: 在 DumpType 中新增 DUMP_SUPER_TENSOR 与 DUMP_SUPER_TENSOR_BODY(附 static_assert 固定为 11、12),并新增 DumpSuperTensorTlv、DumpSuperTensorBodyTlv 两个结构体,后者携带 tensorLength、tensorOffset、dumpSize 等分块信息。
  • 改造 asc_dump_impl 的超限判定: 将 alignDumpLen、tlvLen 的计算改为 uint64_t 以避免溢出,当 tlvLen64 > blockInfo->ringBufLen 时在支持硬件上转调超大 Tensor 实现并返回,否则维持原有单块写入逻辑。
  • 泛化 TLV 写入接口: 将 set_dump_shape_info 与 set_dump_tlv_data 增加模板参数 Tlv,使其同时适用于 DumpTensorTlv 和新的超大 Tensor TLV 类型。
  • 新增硬件支持与容量/对齐计算辅助函数: 新增 is_super_tensor_hardware_supported(限定 GM、UB、L1、L0C、BIAS、FIXBUF)、get_super_tensor_payload_alignment(L0C 使用 16*16*sizeof(uint32_t),其余用 ASC_ONE_DATABLOCK_SIZE)及 get_super_tensor_payload_capacity。
  • 新增头文件实例化检查用例: 添加 super_tensor_dump.cpp,在 __NPU_ARCH__ == 3510 且非 `ASC
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 23 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Sep 23 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 23 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.
You can self-configure the PR merge rules for this repository. For more details, please refer to 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
impl/basic_api ✅ wuyang_hw, 诸葛洵 (2/2) ✅ wuyang_hw (1/1)
repo-cann/asc-devkit ✅ wuyang_hw, 诸葛洵 (2/2) ✅ wuyang_hw (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

jcmrn0930, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
83 messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
Sep 28 Removed label: ci-pipeline-failed
CANN-robotCANN-robotCollaborators
Sep 28 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 28 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 28 Added label: ci-pipeline-passed
CANN-robotCANN-robotCollaborators
Sep 28 Merged pull request