Skip to content

Reformat models for the rope parameter args#953

Open
Goekdeniz-Guelmez wants to merge 92 commits into
ml-explore:mainfrom
Goekdeniz-Guelmez:reformat-models-foir-the-rope-paramter-input
Open

Reformat models for the rope parameter args#953
Goekdeniz-Guelmez wants to merge 92 commits into
ml-explore:mainfrom
Goekdeniz-Guelmez:reformat-models-foir-the-rope-paramter-input

Conversation

@Goekdeniz-Guelmez

Copy link
Copy Markdown
Contributor

for the transformers v5

@Goekdeniz-Guelmez

Copy link
Copy Markdown
Contributor Author

@angeloskath since im already on the house keeping, should I make the head dim argument on all models optional too? Maybe make the classes have correct input/output type definitions etc. mlx-lm-lora and other would benefit from it imo.

@angeloskath

Copy link
Copy Markdown
Member

Thanks @Goekdeniz-Guelmez that looks like a great start. We can migrate the head dim as well but let's finish the rope parameters migration.

I would make sure that if a head dim is optional the model uses it correctly eg self.head_dim = args.head_dim or ....

@Goekdeniz-Guelmez

Copy link
Copy Markdown
Contributor Author

@angeloskath agreed! Let's first get rope params merged. Should be mergeable now

@angeloskath

Copy link
Copy Markdown
Member

@Goekdeniz-Guelmez removing the defaults tends to break things 😉 Running the tests would save us a round-trip

@Goekdeniz-Guelmez

Copy link
Copy Markdown
Contributor Author

@angeloskath Done!

@angeloskath

Copy link
Copy Markdown
Member

Nice, sorry for the back and forth from my side now but shouldn't the other rope parameters also be moved from rope_parameters if that is present? ie rope_scaling etc.

@Goekdeniz-Guelmez

Copy link
Copy Markdown
Contributor Author

no worries! yes, that would make thinks easier

Goekdeniz-Guelmez and others added 5 commits March 17, 2026 14:06
- Increased default value of `rope_theta` from 10000.0 to 100000.0 in various model argument classes.
- Introduced `rope_scaling` and `rope_traditional` parameters in several models to enhance flexibility in rope parameter configurations.
- Ensured consistent handling of `rope_parameters` across models including `deepseek`, `exaone`, `gemma`, `glm`, `hunyuan`, `llama`, `qwen`, and others.
@Goekdeniz-Guelmez

Copy link
Copy Markdown
Contributor Author

@angeloskath shoudl have all the params in and tests passed too.

@Goekdeniz-Guelmez

Copy link
Copy Markdown
Contributor Author

will be added the new models and then its mergeable @angeloskath

@menisadi

menisadi commented Jul 6, 2026

Copy link
Copy Markdown

How does it compare to #1465 ?

@Goekdeniz-Guelmez

Copy link
Copy Markdown
Contributor Author

the existing model configs use the old version where the rope parameters where defined separately, the new one has them under the "rope_parameters" so every model config needs that update, #1465 this just fixes the registration definition of the tokeniser object itself

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.

3 participants