Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Megatron-LM
Commits
07ffa1b7
Commit
07ffa1b7
authored
Apr 03, 2023
by
Mostofa Patwary
Browse files
addressing more comments
parent
df521589
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
megatron/model/transformer.py
megatron/model/transformer.py
+4
-4
No files found.
megatron/model/transformer.py
View file @
07ffa1b7
...
@@ -453,8 +453,6 @@ class ParallelAttention(MegatronModule):
...
@@ -453,8 +453,6 @@ class ParallelAttention(MegatronModule):
key_layer
=
inputs
[
1
]
key_layer
=
inputs
[
1
]
value_layer
=
inputs
[
2
]
value_layer
=
inputs
[
2
]
attention_mask
=
inputs
[
3
]
attention_mask
=
inputs
[
3
]
rotary_pos_emb
=
inputs
[
4
]
if
inputs
[
4
]
is
None
\
else
(
inputs
[
4
],
inputs
[
5
])
output_
=
self
.
core_attention
(
query_layer
,
key_layer
,
output_
=
self
.
core_attention
(
query_layer
,
key_layer
,
value_layer
,
attention_mask
)
value_layer
,
attention_mask
)
return
output_
return
output_
...
@@ -548,8 +546,10 @@ class ParallelAttention(MegatronModule):
...
@@ -548,8 +546,10 @@ class ParallelAttention(MegatronModule):
# duplicate the pos_emb for self attention
# duplicate the pos_emb for self attention
if
rotary_pos_emb
is
not
None
:
if
rotary_pos_emb
is
not
None
:
rotary_pos_emb
=
rotary_pos_emb
if
isinstance
(
rotary_pos_emb
,
\
if
isinstance
(
rotary_pos_emb
,
tuple
):
tuple
)
else
((
rotary_pos_emb
,)
*
2
)
rotary_pos_emb
=
rotary_pos_emb
else
:
rotary_pos_emb
=
((
rotary_pos_emb
,)
*
2
)
if
inference_params
:
if
inference_params
:
batch_start
=
inference_params
.
batch_size_offset
batch_start
=
inference_params
.
batch_size_offset
...
...
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