Proposal
L2 norm on QK has been used in DeltaNet, Gated DeltaNet, KDA, and related models. However, this computation takes a non-negligible portion of the total running time, especially in backward where it recomputes the L2 norm to save activations. Since QK are often outputs of a short convolution, it would be interesting to fuse the L2 norm into the short convolution so that we avoid an additional kernel launch and activation recomputation or storage.
Rationale
No response
Proposal
L2 norm on QK has been used in DeltaNet, Gated DeltaNet, KDA, and related models. However, this computation takes a non-negligible portion of the total running time, especially in backward where it recomputes the L2 norm to save activations. Since QK are often outputs of a short convolution, it would be interesting to fuse the L2 norm into the short convolution so that we avoid an additional kernel launch and activation recomputation or storage.
Rationale
No response