-
-
Notifications
You must be signed in to change notification settings - Fork 11.8k
[Bugfix] In LongRoPE, decide short vs long based on max_model_len #27431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DarkLight1337
merged 10 commits into
vllm-project:main
from
MatthewBonanni:fix_longrope
Oct 28, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
17d618b
decide short vs long at init time
MatthewBonanni 8718cec
add warning
MatthewBonanni afa2d96
default to original_max_position_embeddings
MatthewBonanni e643427
fix getter
MatthewBonanni fd899fb
fix
MatthewBonanni 684e475
warn only once
MatthewBonanni c12231c
Merge branch 'main' into fix_longrope
MatthewBonanni e0d20e8
Merge branch 'main' into fix_longrope
MatthewBonanni 09c38a5
fix test
MatthewBonanni a16110f
Merge branch 'main' into fix_longrope
DarkLight1337 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this not belong above where
derived_max_model_lenis calculated?It could come after the first
rope_scalingcheck?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to override the default
max_model_lentooriginal_max_position_embeddingswhile still allowing the user to manually specify amax_model_lenwhich is larger than this value. I had originally written the code as modifyingderived_max_model_len, but (as I read it)derived_max_model_lenis really intended to bemax_position_embeddings, because of the later check in line 2143:https://github.com/vllm-project/vllm/pull/27431/files/684e475735f9594a784dd62aa14e0845884872db#diff-998c640befaf137b9af825f29f4e6e47d273caab1fd04093c97df24b18f5c417L2134
If
max_model_lenis manually set to a value exceedingderived_max_model_len, it will throw an error. Hopefully I'm understanding your question correctly?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for explaining, I think I understand now!