Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
客户使用aclnnMatmulWeightNz这个算子提供的案例
self: [32, 5120] mat2: [8704, 5120] out : [32, 8704] 数学语义是典型线性层计算:
out = self @ mat2.T 也就是:
[32, 5120] x [5120, 8704] -> [32, 8704] 验证过程中使用了 aclnnTransMatmulWeightGetWorkspaceSize/aclnnTransMatmulWeight 将 weight 预处理成 NZ 格式,再调用 aclnnMatmulWeightNzGetWorkspaceSize/aclnnMatmulWeightNz 做矩阵乘。问题集中在两点:
MatmulWeightNz 对 mat2 的逻辑 shape 仍然参与矩阵乘法校验。 将原始 [N, K] weight 作为转置视图 [K, N] 使用时,aclCreateTensor 的 view_shape、view_strides、storage_shape 必须同时正确。
可以参考案例:https://2012labs.huawei.com/#/commando/series/1299536108870422528/detail
你好,这是nn仓的算子,后续会转到nn仓处理
/assign
Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
Backgroud(背景信息)
客户使用aclnnMatmulWeightNz这个算子提供的案例
self: [32, 5120]
mat2: [8704, 5120]
out : [32, 8704]
数学语义是典型线性层计算:
out = self @ mat2.T
也就是:
[32, 5120] x [5120, 8704] -> [32, 8704]
验证过程中使用了 aclnnTransMatmulWeightGetWorkspaceSize/aclnnTransMatmulWeight 将 weight 预处理成 NZ 格式,再调用 aclnnMatmulWeightNzGetWorkspaceSize/aclnnMatmulWeightNz 做矩阵乘。问题集中在两点:
MatmulWeightNz 对 mat2 的逻辑 shape 仍然参与矩阵乘法校验。
将原始 [N, K] weight 作为转置视图 [K, N] 使用时,aclCreateTensor 的 view_shape、view_strides、storage_shape 必须同时正确。
可以参考案例:https://2012labs.huawei.com/#/commando/series/1299536108870422528/detail
Benefit / Necessity (价值/作用)
Design(设计方案)