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
8363cd09
Unverified
Commit
8363cd09
authored
Mar 19, 2025
by
Jan Kaniecki
Committed by
GitHub
Mar 19, 2025
Browse files
[Bugfix] Adjust mllama to regional compilation (#15112)
Signed-off-by:
Jan Kaniecki
<
jkaniecki@habana.ai
>
parent
6c5a3195
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
vllm/model_executor/models/mllama.py
vllm/model_executor/models/mllama.py
+4
-7
No files found.
vllm/model_executor/models/mllama.py
View file @
8363cd09
...
@@ -1070,8 +1070,8 @@ class MllamaTextModel(nn.Module):
...
@@ -1070,8 +1070,8 @@ class MllamaTextModel(nn.Module):
inputs_embeds
=
self
.
embed_tokens
(
input_ids
)
inputs_embeds
=
self
.
embed_tokens
(
input_ids
)
hidden_states
=
inputs_embeds
hidden_states
=
inputs_embeds
for
decoder_layer
in
self
.
layers
:
for
idx
,
decoder_layer
in
enumerate
(
self
.
layers
)
:
if
i
sinstance
(
decoder_layer
,
MllamaC
ross
A
ttention
DecoderL
ayer
)
:
if
i
dx
in
self
.
c
ross
_a
ttention
_l
ayer
s
:
if
not
skip_cross_attention
:
if
not
skip_cross_attention
:
hidden_states
=
decoder_layer
(
hidden_states
=
decoder_layer
(
hidden_states
=
hidden_states
,
hidden_states
=
hidden_states
,
...
@@ -1081,16 +1081,13 @@ class MllamaTextModel(nn.Module):
...
@@ -1081,16 +1081,13 @@ class MllamaTextModel(nn.Module):
full_text_row_masked_out_mask
=
full_text_row_masked_out_mask
=
full_text_row_masked_out_mask
,
full_text_row_masked_out_mask
,
)
)
el
if
isinstance
(
decoder_layer
,
LlamaDecoderLayer
)
:
el
se
:
hidden_states
,
residual
=
decoder_layer
(
hidden_states
,
residual
=
decoder_layer
(
positions
=
positions
,
positions
=
positions
,
hidden_states
=
hidden_states
,
hidden_states
=
hidden_states
,
residual
=
None
,
residual
=
None
,
)
)
hidden_states
=
hidden_states
+
residual
hidden_states
=
hidden_states
+
residual
else
:
raise
ValueError
(
f
"Unknown decoder layer type
{
type
(
decoder_layer
)
}
"
)
hidden_states
=
self
.
norm
(
hidden_states
)
hidden_states
=
self
.
norm
(
hidden_states
)
return
hidden_states
return
hidden_states
...
@@ -1551,4 +1548,4 @@ def convert_dense_cross_attention_mask_to_tensor(
...
@@ -1551,4 +1548,4 @@ def convert_dense_cross_attention_mask_to_tensor(
full_text_mask
=
((
mask
!=
ninf
).
any
(
dim
=-
1
).
type_as
(
mask
)[...,
None
])
full_text_mask
=
((
mask
!=
ninf
).
any
(
dim
=-
1
).
type_as
(
mask
)[...,
None
])
mask
*=
full_text_mask
mask
*=
full_text_mask
# (num_prompt_tokens, num_encoder_tokens)
# (num_prompt_tokens, num_encoder_tokens)
return
mask
return
mask
\ No newline at end of file
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