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
1cabfcef
Unverified
Commit
1cabfcef
authored
Sep 30, 2024
by
Jee Jee Li
Committed by
GitHub
Sep 30, 2024
Browse files
[Misc] Adjust max_position_embeddings for LoRA compatibility (#8957)
parent
be76e5aa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
vllm/worker/model_runner.py
vllm/worker/model_runner.py
+9
-2
No files found.
vllm/worker/model_runner.py
View file @
1cabfcef
...
@@ -1037,9 +1037,17 @@ class GPUModelRunnerBase(ModelRunnerBase[TModelInputForGPU]):
...
@@ -1037,9 +1037,17 @@ class GPUModelRunnerBase(ModelRunnerBase[TModelInputForGPU]):
assert
supports_lora
(
assert
supports_lora
(
self
.
model
self
.
model
),
f
"
{
self
.
model
.
__class__
.
__name__
}
does not support LoRA yet."
),
f
"
{
self
.
model
.
__class__
.
__name__
}
does not support LoRA yet."
if
supports_multimodal
(
self
.
model
):
if
supports_multimodal
(
self
.
model
):
logger
.
warning
(
"Regarding multimodal models, vLLM currently "
logger
.
warning
(
"Regarding multimodal models, vLLM currently "
"only supports adding LoRA to language model."
)
"only supports adding LoRA to language model."
)
# It's necessary to distinguish between the max_position_embeddings
# of VLMs and LLMs.
if
hasattr
(
self
.
model
.
config
,
"max_position_embeddings"
):
max_pos_embeddings
=
self
.
model
.
config
.
max_position_embeddings
else
:
max_pos_embeddings
=
(
self
.
model
.
config
.
text_config
.
max_position_embeddings
)
self
.
lora_manager
=
LRUCacheWorkerLoRAManager
(
self
.
lora_manager
=
LRUCacheWorkerLoRAManager
(
self
.
scheduler_config
.
max_num_seqs
,
self
.
scheduler_config
.
max_num_seqs
,
...
@@ -1049,8 +1057,7 @@ class GPUModelRunnerBase(ModelRunnerBase[TModelInputForGPU]):
...
@@ -1049,8 +1057,7 @@ class GPUModelRunnerBase(ModelRunnerBase[TModelInputForGPU]):
self
.
device
,
self
.
device
,
self
.
model
.
embedding_modules
,
self
.
model
.
embedding_modules
,
self
.
model
.
embedding_padding_modules
,
self
.
model
.
embedding_padding_modules
,
max_position_embeddings
=
self
.
model
.
config
.
max_position_embeddings
=
max_pos_embeddings
,
max_position_embeddings
,
)
)
self
.
model
=
self
.
lora_manager
.
create_lora_manager
(
self
.
model
)
self
.
model
=
self
.
lora_manager
.
create_lora_manager
(
self
.
model
)
...
...
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