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
text-generation-inference
Commits
689b1abb
Unverified
Commit
689b1abb
authored
Aug 09, 2024
by
Wang, Yi
Committed by
GitHub
Aug 08, 2024
Browse files
fix EleutherAI/gpt-neox-20b does not work in tgi (#2346)
Signed-off-by:
Wang, Yi A
<
yi.a.wang@intel.com
>
parent
82d19d77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
server/text_generation_server/models/custom_modeling/flash_neox_modeling.py
...tion_server/models/custom_modeling/flash_neox_modeling.py
+9
-1
No files found.
server/text_generation_server/models/custom_modeling/flash_neox_modeling.py
View file @
689b1abb
...
@@ -153,8 +153,16 @@ class FlashNeoxAttention(torch.nn.Module):
...
@@ -153,8 +153,16 @@ class FlashNeoxAttention(torch.nn.Module):
qkv
=
self
.
query_key_value
(
hidden_states
)
qkv
=
self
.
query_key_value
(
hidden_states
)
qkv
=
qkv
.
view
(
-
1
,
3
,
self
.
num_heads
,
self
.
head_size
)
qkv
=
qkv
.
view
(
-
1
,
3
,
self
.
num_heads
,
self
.
head_size
)
# Compute rotary embeddings on rotary_ndims
query_rot
=
qkv
[:,
0
][...,
:
self
.
rotary_dim
]
query_pass
=
qkv
[:,
0
][...,
self
.
rotary_dim
:]
key_rot
=
qkv
[:,
1
][...,
:
self
.
rotary_dim
]
key_pass
=
qkv
[:,
1
][...,
self
.
rotary_dim
:]
# Inplace rotary
# Inplace rotary
self
.
rotary_emb
(
qkv
[:,
0
],
qkv
[:,
1
],
cos
,
sin
)
self
.
rotary_emb
(
query_rot
,
key_rot
,
cos
,
sin
)
qkv
[:,
0
]
=
torch
.
cat
((
query_rot
,
query_pass
),
dim
=-
1
)
qkv
[:,
1
]
=
torch
.
cat
((
key_rot
,
key_pass
),
dim
=-
1
)
reshape_and_cache
(
qkv
[:,
1
],
qkv
[:,
2
],
kv_cache
[
0
],
kv_cache
[
1
],
slots
)
reshape_and_cache
(
qkv
[:,
1
],
qkv
[:,
2
],
kv_cache
[
0
],
kv_cache
[
1
],
slots
)
...
...
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