已关闭
[Requirement|需求建议]: matmul类算子原型迁移 #6171
jgx创建于  14 天前关闭于  9 天前
jgx
jgx成员
14 天前 创建

Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.

Backgroud(背景信息)

对 matmul 类算子的算子原型(OP 原型定义)进行迁移:将 BatchMatMul、BatchMatMulV2、MatMul、MatMulV2 等算子的 REG_OP 定义从公共头文件 common/inc/op_graph/op_nn_proto_extend.h 中移除,分别迁移到新增的独立目录头文件 matmul/mat_mul_v3/op_graph/mat_mul_proto_extend.h(定义 MatMul 与 MatMulV2)和 matmul/batch_mat_mul_v3/op_graph/batch_mat_mul_proto_extend.h(定义 BatchMatMul 与 BatchMatMulV2)

Origin(信息来源)

Ascend950

Benefit / Necessity (价值/作用)

Design(设计方案)

主要改动

删除公共头文件中的算子原型: 从 common/inc/op_graph/op_nn_proto_extend.h 中移除 BatchMatMul、BatchMatMulV2、MatMulV2 的 REG_OP 定义(约 120 行),使公共头文件不再承载 matmul 类算子原型。
新增 MatMul/MatMulV2 原型头文件: 新增 matmul/mat_mul_v3/op_graph/mat_mul_proto_extend.h,在其中定义 MatMul(含可选输入 bias 与属性 transpose_x1、transpose_x2)和 MatMulV2(含可选输入 bias、offset_w 与属性 offset_x),支持 float16、float32、int32、int8、int4、bfloat16、hifloat8 等类型。
新增 BatchMatMul/BatchMatMulV2 原型头文件: 新增 matmul/batch_mat_mul_v3/op_graph/batch_mat_mul_proto_extend.h,在其中定义 BatchMatMul(属性 adj_x1、adj_x2,支持 batch 维度广播)和 BatchMatMulV2(含可选输入 bias、offset_w 与属性 offset_x)。
更新插件引用: 在 common/src/framework/gemm_onnx_plugin.cpp 中新增 #include "matmul/mat_mul_v3/op_graph/mat_mul_proto_extend.h",使 ONNX 相关插件代码能继续使用迁移后的 MatMul 算子原型定义。

likedislike
jgxjgx成员
14 天前 添加了label:requirement
jgx
jgx成员
14 天前 评论:

/assign

likedislike
CANN-robotCANN-robot成员
14 天前 将 jgx12 设为负责人
jgxjgx成员
14 天前 修改了issue 的描述
CANN-robotCANN-robot成员
9 天前 关闭了 issue
CANN-robotCANN-robot成员
9 天前 添加了label:resolved