Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
融合 inplace(split + ropegrad + concat) 等小算子,实现 inplace partial RopeGrad 其中inplace的意思是原地,就是直接在输入gm地址上做ropegrad,节省gm空间 其中partial的意思是部分,只对输入的尾轴的部分做RopeGrad,原本小算子实现是先把要做的部分 split取出来,做完ropeGrad后再concat回去 RopeGrad的实现基本上参考库上 rotary_position_embedding_grad
将 inplace(split + ropeGrad + concat) 等小算子合并为一个 算子,该操作在大模型中比较常见,主要目的是提升网络性能。
大模型旋转位置编码常见操作,提升整网性能。
partialDy = dy[..., start:end] assert(cos.shape[-1] == sin.shape[-1] == partialDy.shape[-1]) dy[..., start:end] = RopeGrad(partialDy, cos, sin)
Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
Backgroud(背景信息)
融合 inplace(split + ropegrad + concat) 等小算子,实现 inplace partial RopeGrad
其中inplace的意思是原地,就是直接在输入gm地址上做ropegrad,节省gm空间
其中partial的意思是部分,只对输入的尾轴的部分做RopeGrad,原本小算子实现是先把要做的部分 split取出来,做完ropeGrad后再concat回去
RopeGrad的实现基本上参考库上 rotary_position_embedding_grad
将 inplace(split + ropeGrad + concat) 等小算子合并为一个 算子,该操作在大模型中比较常见,主要目的是提升网络性能。
Benefit / Necessity (价值/作用)
大模型旋转位置编码常见操作,提升整网性能。
Design(设计方案)
partialDy = dy[..., start:end]
assert(cos.shape[-1] == sin.shape[-1] == partialDy.shape[-1])
dy[..., start:end] = RopeGrad(partialDy, cos, sin)