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
b8b0ccbd
Unverified
Commit
b8b0ccbd
authored
Mar 08, 2025
by
Jee Jee Li
Committed by
GitHub
Mar 08, 2025
Browse files
[Bugfix] Make the deviceprofiler include LoRA memory. (#14469)
Signed-off-by:
Jee Jee Li
<
pandaleefree@gmail.com
>
parent
c908a07f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
vllm/worker/model_runner.py
vllm/worker/model_runner.py
+29
-29
No files found.
vllm/worker/model_runner.py
View file @
b8b0ccbd
...
...
@@ -1111,41 +1111,41 @@ class GPUModelRunnerBase(ModelRunnerBase[TModelInputForGPU]):
with
DeviceMemoryProfiler
(
self
.
device
)
as
m
:
time_before_load
=
time
.
perf_counter
()
self
.
model
=
get_model
(
vllm_config
=
self
.
vllm_config
)
if
self
.
lora_config
:
assert
supports_lora
(
self
.
model
),
f
"
{
self
.
model
.
__class__
.
__name__
}
does not support LoRA yet."
if
supports_multimodal
(
self
.
model
):
logger
.
warning
(
"Regarding multimodal models, vLLM currently "
"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
.
scheduler_config
.
max_num_seqs
,
self
.
scheduler_config
.
max_num_batched_tokens
,
self
.
vocab_size
,
self
.
lora_config
,
self
.
device
,
self
.
model
.
embedding_modules
,
self
.
model
.
embedding_padding_modules
,
max_position_embeddings
=
max_pos_embeddings
,
)
self
.
model
=
self
.
lora_manager
.
create_lora_manager
(
self
.
model
)
time_after_load
=
time
.
perf_counter
()
self
.
model_memory_usage
=
m
.
consumed_memory
logger
.
info
(
"Model loading took %.4f GB and %.6f seconds"
,
self
.
model_memory_usage
/
float
(
2
**
30
),
time_after_load
-
time_before_load
)
if
self
.
lora_config
:
assert
supports_lora
(
self
.
model
),
f
"
{
self
.
model
.
__class__
.
__name__
}
does not support LoRA yet."
if
supports_multimodal
(
self
.
model
):
logger
.
warning
(
"Regarding multimodal models, vLLM currently "
"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
.
scheduler_config
.
max_num_seqs
,
self
.
scheduler_config
.
max_num_batched_tokens
,
self
.
vocab_size
,
self
.
lora_config
,
self
.
device
,
self
.
model
.
embedding_modules
,
self
.
model
.
embedding_padding_modules
,
max_position_embeddings
=
max_pos_embeddings
,
)
self
.
model
=
self
.
lora_manager
.
create_lora_manager
(
self
.
model
)
if
self
.
prompt_adapter_config
:
self
.
prompt_adapter_manager
=
LRUCacheWorkerPromptAdapterManager
(
self
.
scheduler_config
.
max_num_seqs
,
...
...
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