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
c2c661af
Unverified
Commit
c2c661af
authored
Nov 25, 2025
by
Roger Wang
Committed by
GitHub
Nov 25, 2025
Browse files
[Bugfix] Fix overallocation in MM profiling (#29386)
Signed-off-by:
Roger Wang
<
hey@rogerw.io
>
parent
798e87db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
vllm/v1/worker/gpu_model_runner.py
vllm/v1/worker/gpu_model_runner.py
+8
-4
No files found.
vllm/v1/worker/gpu_model_runner.py
View file @
c2c661af
...
@@ -4245,14 +4245,18 @@ class GPUModelRunner(
...
@@ -4245,14 +4245,18 @@ class GPUModelRunner(
# NOTE: This happens when encoder cache needs to store
# NOTE: This happens when encoder cache needs to store
# the embeddings that encoder outputs are scattered onto.
# the embeddings that encoder outputs are scattered onto.
# In this case we create dummy embeddings of size
# In this case we create dummy embeddings of size
# (
encode_budget
, hidden_size) and scatter
encoder
# (
max_tokens_for_modality
, hidden_size) and scatter
# output into it.
#
encoder
output into it.
encoder_output_shape
=
dummy_encoder_outputs
[
0
].
shape
encoder_output_shape
=
dummy_encoder_outputs
[
0
].
shape
if
encoder_output_shape
[
0
]
<
encoder_budget
:
max_mm_tokens_per_item
=
mm_budget
.
max_tokens_by_modality
[
dummy_modality
]
if
encoder_output_shape
[
0
]
<
max_mm_tokens_per_item
:
encoder_hidden_size
=
encoder_output_shape
[
-
1
]
expanded_outputs
=
[]
expanded_outputs
=
[]
for
output
in
dummy_encoder_outputs
:
for
output
in
dummy_encoder_outputs
:
expanded
=
output
.
new_zeros
(
expanded
=
output
.
new_zeros
(
(
encoder_budget
,
encoder_output_shape
[
-
1
]
)
(
max_mm_tokens_per_item
,
encoder_hidden_size
)
)
)
num_tokens
=
output
.
shape
[
0
]
num_tokens
=
output
.
shape
[
0
]
expanded
[:
num_tokens
].
copy_
(
output
)
expanded
[:
num_tokens
].
copy_
(
output
)
...
...
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