Closed
[Bug-Report|缺陷反馈]: OneHot 910 kernel 冗余裸指令代码 #1082
AlfengYuanAdd on  Mar 27Closed at  Mar 27
AlfengYuan
AlfengYuanCollaborators
Mar 27 Create

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

一、问题描述 (必填)

 template <typename T1, typename T2, typename T3>	 
 __aicore__ inline void OneHotMix<T1, T2, T3>::CopyOut(LocalTensor<T3>& srcTensor, int64_t offset, int32_t copyLength)	 
 {	 
     if constexpr ((IsSameType<T3, int64_t>::value) || (IsSameType<T3, int4>::value)) {	 
         if ASCEND_IS_AIV {	 
             copy_ubuf_to_gm_align_v2(	 
                 (__gm__ int8_t*)outputGm[offset].GetPhyAddr(), (__ubuf__ int8_t*)srcTensor.GetPhyAddr(), 0, 
                 static_cast<uint16_t>(1), static_cast<uint32_t>(copyLength * sizeof(T3)), 0, 0, 0); 
         } 
     } else { 
         DataCopyPad( 
             outputGm[offset], srcTensor, 
             {static_cast<uint16_t>(1), static_cast<uint32_t>(copyLength * sizeof(T3)), 0, 0, 0}); 
     } 
 }
 

DataCopyPad 支持全数据类型,上面的if分支纯冗余代码

二、环境信息 (可选)

三、重现步骤 (可选)

白盒检视

四、预期结果 (可选)

删除冗余代码,精度不变,性能不变

💡 备注(选填)

已充分验证,单算子,aclnn接口,geir,二级冒烟

likedislike
AlfengYuanAlfengYuanCollaborators
Mar 27 Added label: bug-report
AlfengYuanAlfengYuanCollaborators
Mar 27 Modify description of issue
AlfengYuan
AlfengYuanCollaborators
Mar 27 Comments:

/assign

likedislike
CANN-robotCANN-robotCollaborators
Mar 27 Assign alfengyuan as responsible person
AlfengYuanAlfengYuanCollaborators
Mar 27 Associated pull request
CANN-robotCANN-robotCollaborators
Mar 27 Close issue
AlfengYuanAlfengYuanCollaborators
Mar 27 changed custom state from 进行中 to 已完成
CANN-robotCANN-robotCollaborators
Mar 27 Added label: Accepted
CANN-robotCANN-robotCollaborators
Mar 27 Added label: resolved