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
chenpangpang
transformers
Commits
767e6b53
Unverified
Commit
767e6b53
authored
May 24, 2023
by
Wang, Yi
Committed by
GitHub
May 24, 2023
Browse files
fix gptj could not jit.trace in GPU (#23317)
Signed-off-by:
Wang, Yi A
<
yi.a.wang@intel.com
>
parent
b4698b7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/gptj/modeling_gptj.py
src/transformers/models/gptj/modeling_gptj.py
+1
-1
No files found.
src/transformers/models/gptj/modeling_gptj.py
View file @
767e6b53
...
...
@@ -212,7 +212,7 @@ class GPTJAttention(nn.Module):
key
=
self
.
_split_heads
(
key
,
self
.
num_attention_heads
,
self
.
head_dim
,
True
)
value
=
self
.
_split_heads
(
value
,
self
.
num_attention_heads
,
self
.
head_dim
,
False
)
if
is_torch_fx_proxy
(
position_ids
):
if
is_torch_fx_proxy
(
position_ids
)
or
torch
.
jit
.
is_tracing
()
:
# The logic to conditionally copy to GPU could not be traced, so we do this
# every time in the torch.fx case
embed_positions
=
get_embed_positions
(
self
.
embed_positions
,
position_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