Addind RoPE to pytorch core #149534
Labels
enhancement
Not as big of a feature, but technically not a bug. Should be easy to fix
module: nn
Related to torch.nn
needs design
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
The RoPE python code is being copied and pasted over and over in multiple pytorch org repos. I propose we move the RoPE operation to pytorch core (e.g. under nn.functional) and also add a RotaryPositionalEmbeddings module. Some examples of code duplication:
pytorch/ao:
pytorch/benchmark:
pytorch/torchchat:
pytorch/torchtune:
pytorch/xla:
pytorch/pytorch:
pytorch/benchmarks/gpt_fast/model.py
Lines 280 to 292 in 518563d
pytorch/benchmarks/gpt_fast/mixtral_moe_model.py
Lines 293 to 305 in 518563d
cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki
The text was updated successfully, but these errors were encountered: