Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
1a03dd49
Unverified
Commit
1a03dd49
authored
Jul 02, 2025
by
Cyrus Leung
Committed by
GitHub
Jul 02, 2025
Browse files
[Bugfix] Fix dynamic rotary embedding (#20343)
Signed-off-by:
DarkLight1337
<
tlleungac@connect.ust.hk
>
parent
27b80176
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
vllm/model_executor/layers/rotary_embedding.py
vllm/model_executor/layers/rotary_embedding.py
+7
-4
No files found.
vllm/model_executor/layers/rotary_embedding.py
View file @
1a03dd49
...
@@ -1963,16 +1963,19 @@ def get_rope(
...
@@ -1963,16 +1963,19 @@ def get_rope(
scaling_factor
,
dtype
,
scaling_factor
,
dtype
,
mixed_b
)
mixed_b
)
elif
scaling_type
==
"dynamic"
:
elif
scaling_type
==
"dynamic"
:
scaling_factor
=
rope_scaling
[
"factor"
]
if
"alpha"
in
rope_scaling
:
scaling_alpha
=
rope_scaling
[
"alpha"
]
scaling_alpha
=
rope_scaling
[
"alpha"
]
if
scaling_alpha
:
rotary_emb
=
DynamicNTKAlphaRotaryEmbedding
(
rotary_emb
=
DynamicNTKAlphaRotaryEmbedding
(
head_size
,
rotary_dim
,
max_position
,
base
,
is_neox_style
,
head_size
,
rotary_dim
,
max_position
,
base
,
is_neox_style
,
scaling_alpha
,
dtype
)
scaling_alpha
,
dtype
)
else
:
elif
"factor"
in
rope_scaling
:
scaling_factor
=
rope_scaling
[
"factor"
]
rotary_emb
=
DynamicNTKScalingRotaryEmbedding
(
rotary_emb
=
DynamicNTKScalingRotaryEmbedding
(
head_size
,
rotary_dim
,
max_position
,
base
,
is_neox_style
,
head_size
,
rotary_dim
,
max_position
,
base
,
is_neox_style
,
scaling_factor
,
dtype
)
scaling_factor
,
dtype
)
else
:
raise
ValueError
(
"Dynamic rope scaling must contain either "
"'alpha' or 'factor' field"
)
elif
scaling_type
==
"yarn"
:
elif
scaling_type
==
"yarn"
:
scaling_factor
=
rope_scaling
[
"factor"
]
scaling_factor
=
rope_scaling
[
"factor"
]
original_max_position
=
rope_scaling
[
original_max_position
=
rope_scaling
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment