Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[WIP] RoPE refactor - #39827

Closed
zucchini-nlp wants to merge 4 commits into
huggingface:mainfrom
zucchini-nlp:rope-refactor
Closed

[WIP] RoPE refactor#39827
zucchini-nlp wants to merge 4 commits into
huggingface:mainfrom
zucchini-nlp:rope-refactor

Conversation

@zucchini-nlp

@zucchini-nlp zucchini-nlp commented Jul 31, 2025

Copy link
Copy Markdown
Member

What does this PR do?

Version 1

We want to support defining different RoPE params within one model, similar to how layer types defines different attention patterns. The reason: some models are already using global and local rope params (Gemma3, ModernBert), and we were forced to do monkey patching to support it

This PR is one option how it can be done. Note that it is very much breaking as the RoPE layers will be returning a dict of "cos/sin" when we have several RoPE params. Version 2 is available in #39847, and is less breaking imo

Open for discussion, personally I like version 2

@zucchini-nlp

Copy link
Copy Markdown
Member Author

Keeping the other design version as a cleaner and less breaking option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant