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
AutoAWQ
Commits
5db86ec5
Unverified
Commit
5db86ec5
authored
Nov 10, 2023
by
Younes Belkada
Committed by
GitHub
Nov 10, 2023
Browse files
New logic for passing past_key_value (#177)
parent
63e3fd83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
awq/modules/fused/attn.py
awq/modules/fused/attn.py
+3
-1
No files found.
awq/modules/fused/attn.py
View file @
5db86ec5
...
...
@@ -215,5 +215,7 @@ class QuantAttentionFused(nn.Module):
self
.
start_pos
+=
seqlen
# past_key_value is replaced with cache_v, cache_k, returning empty data
past_key_value
=
[
torch
.
Tensor
([
[
[[
0
]],
[[
0
]],
[[
0
]]
]
])]
# we pass a dummy past kv cache for transformers to be able to retrieve the correct info
# about past key length
past_key_value
=
[
torch
.
zeros
(
1
,
1
,
self
.
start_pos
,
1
)]
return
attn_output
,
attention_weight
,
past_key_value
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