已合并
add tensor detail info for tools #219
好好说话95号创建于 1月31日
add tensor detail info for tools #219
已合并
好好说话95号创建于 1月31日
好好说话95号
好好说话95号成员
1月31日

描述

本 PR 新增对 sanitizer信息上报能力的支持,通过调用 __mstx_dfx_report_stub 指令,在运行时上报 Tensor 的关键元信息,包括地址(addr)、数据类型(databit)、存储空间(space)、块步长(BlockStride)和重复步长(RepeatStride)等。

支持的指令范围:
计算类指令:Add, Sub, Mul, Div, Max, Min, Not, And, Or, AddRelu, AddReluCast, AddDeqRelu, SubRelu, SubReluCast, MulAddDst, MulCast, FusedMulAdd, FusedMulAddRelu,Adds, Muls, Maxs, Mins, LeakyRelu, ShiftLeft, ShiftRight,Reciprocal, Sqrt, Rsqrt, Exp, Ln, Abs, Relu,BilinearInterpolation,Axpy,Cast,CastDeq,Compare,Reduce(Max/Min/Sum),Transpose等
搬运类指令:Copy, DataCopy, DataCopyPad等
上报协议设计如下:
// 公共 Tensor 描述
enum MstxTensorAddressSpace {
MSTX_TENSOR_AT_GM = 0,
MSTX_TENSOR_AT_UB,
MSTX_TENSOR_AT_L1,
MSTX_TENSOR_AT_L0A,
MSTX_TENSOR_AT_L0B,
MSTX_TENSOR_AT_L0C,
};
struct MstxTensorDesc {
MstxTensorAddressSpace space; // 存储空间(GM/UB/L1/L0等)
uint64_t addr; // 地址
uint64_t size; // 数据大小
uint8_t databit; // 数据比特数
};
// 计算类指令(以 VecUnary 为例)
struct MstxVecWrapper {
MstxMaskMode maskMode;
MstxVectorMask mask;
bool useMask;
uint32_t reserveBufSize; // 预留 buffer 大小(从尾部向前分配,如 8KB 或 0)
};
struct MstxVecUnaryDesc {
MstxTensorDesc dst;
MstxTensorDesc src;
MstxVecWrapper wrapper;
uint8_t repeatTimes;
uint32_t blockNum;
uint16_t dstBlockStride;
uint16_t srcBlockStride;
uint8_t dstRepeatStride;
uint8_t srcRepeatStride;
char apiName[64];
};
// 搬运类指令
struct MstxDataCopyDesc {
MstxTensorDesc dst;
MstxTensorDesc src;
uint16_t nBurst;
uint16_t lenBurst;
uint16_t srcStride;
uint16_t dstStride;
};
struct MstxDataCopyPadDesc {
MstxTensorDesc dst;
MstxTensorDesc src;
uint16_t nBurst;
uint32_t lenBurst;
uint16_t srcGap;
uint16_t dstGap;
uint8_t leftPad;
uint8_t rightPad;
};
所有上报数据通过 __mstx_dfx_report_stub(report_type, sizeof(desc), &desc) 统一接口提交。

关联的Issue

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 好好说话95号 的贡献)
CANN-robot
CANN-robot成员
1月31日 评论:

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

likedislike
CANN-robot
CANN-robot成员
1月31日 评论:

以下是根据您提交的修改文件推荐的Reviewer和Committer序列,需各模块评审通过后方可合入

Module List Reviewers Committers
impl/basic_api N/A chenyiyuan, wuyang_hw
likedislike
CANN-robotCANN-robot成员
1月31日 将chenyiyuan,wuyang_hw设为审查人
CANN-robotCANN-robot成员
1月31日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
1月31日 评论:

🔵 source code change are detected, tasks labels is removed in this pull request!

likedislike
此处折叠了335条消息 查看更多
zhugexun_sjtu
zhugexun_sjtu成员
2月9日 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
2月9日 添加了label:lgtm
CANN-robot
CANN-robot成员
2月9日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: chenyiyuan, xun_zhuge.
Reviewers who wrote a comment of /lgtm are: chenyiyuan, xun_zhuge.

likedislike
CANN-robotCANN-robot成员
2月9日 关闭了关联的issue
CANN-robotCANN-robot成员
2月9日 合入了pull request