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
b1dc87a0
Unverified
Commit
b1dc87a0
authored
Apr 17, 2026
by
Lukas Geiger
Committed by
GitHub
Apr 17, 2026
Browse files
[Models][Gemma4] Prevent GPU/CPU sync in `embed_input_ids` (#39234)
Signed-off-by:
Lukas Geiger
<
lukas.geiger94@gmail.com
>
parent
79a5b632
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
vllm/model_executor/models/gemma4_mm.py
vllm/model_executor/models/gemma4_mm.py
+3
-2
No files found.
vllm/model_executor/models/gemma4_mm.py
View file @
b1dc87a0
...
...
@@ -1254,9 +1254,10 @@ class Gemma4ForConditionalGeneration(
# computation (using token_type_ids == 0 as text_mask).
# Replicate this: map image token positions to token 0.
if
is_multimodal
is
not
None
:
is_multimodal
=
is_multimodal
.
to
(
input_ids
.
device
)
ple_input_ids
=
torch
.
where
(
is_multimodal
,
torch
.
zeros_like
(
input_ids
),
input_ids
is_multimodal
.
to
(
input_ids
.
device
,
non_blocking
=
True
),
torch
.
zeros_like
(
input_ids
),
input_ids
,
)
else
:
ple_input_ids
=
input_ids
...
...
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