CANN/pyasc Dump检查点功能
asc.language.basic.dump_acc_chk_point【免费下载链接】pyasc本项目为Python用户提供算子编程接口支持在昇腾AI处理器上加速计算接口与Ascend C一一对应并遵守Python原生语法。项目地址: https://gitcode.com/cann/pyascasc.language.basic.dump_acc_chk_point(tensor: LocalTensor, index: int, count_off: int, dump_size: int) → Noneasc.language.basic.dump_acc_chk_point(tensor: GlobalTensor, index: int, count_off: int, dump_size: int) → None基于算子工程开发的算子可以使用该接口 Dump 指定 Tensor 的内容。 同时支持打印自定义的附加信息仅支持 uint32_t 类型的信息 例如用于打印当前执行位置、行号等调试信息。 与 dump_tensor 不同的是该接口支持指定 Tensor 的偏移位置进行 Dump适用于精细化调试和问题定位。对应的 Ascend C 函数原型template typename T __aicore__ inline void DumpAccChkPoint( const LocalTensorT tensor, uint32_t index, uint32_t countOff, uint32_t dumpSize); template typename T __aicore__ inline void DumpAccChkPoint( const GlobalTensorT tensor, uint32_t index, uint32_t countOff, uint32_t dumpSize);参数说明tensor 需要 Dump 的 Tensor支持 LocalTensor 和 GlobalTensor。index Dump 检查点索引编号用于区分不同 Dump 位置。count_off 自定义附加信息仅支持 uint32_t 类型通常用于记录行号、 步骤编号等调试信息。dump_size Dump 的元素个数从 Tensor 指定偏移位置开始连续 Dump。约束说明该接口主要用于调试和问题定位建议仅在 Debug 场景下使用。附加信息 count_off 仅支持 uint32_t 类型。Dump 行为可能影响性能不建议在性能敏感路径中频繁调用。调用示例x_local asc.LocalTensor( dtypeasc.float16, posasc.TPosition.VECIN, addr0, tile_size512, ) x_gm asc.GlobalTensor() x_gm.set_global_buffer(x) asc.dump_acc_chk_point(tensorx_local, index0, count_off1, dump_size5) asc.dump_acc_chk_point(tensorx_gm, index0, count_off1, dump_size5)【免费下载链接】pyasc本项目为Python用户提供算子编程接口支持在昇腾AI处理器上加速计算接口与Ascend C一一对应并遵守Python原生语法。项目地址: https://gitcode.com/cann/pyasc创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考