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
958678df
Unverified
Commit
958678df
authored
Nov 04, 2023
by
Casper
Committed by
GitHub
Nov 04, 2023
Browse files
Fix condition when rolling cache (#150)
parent
92a403b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
awq/modules/fused/attn.py
awq/modules/fused/attn.py
+1
-1
No files found.
awq/modules/fused/attn.py
View file @
958678df
...
@@ -143,7 +143,7 @@ class QuantAttentionFused(nn.Module):
...
@@ -143,7 +143,7 @@ class QuantAttentionFused(nn.Module):
will_cache_be_exceeded
=
self
.
start_pos
+
seqlen
>
self
.
max_seq_len
will_cache_be_exceeded
=
self
.
start_pos
+
seqlen
>
self
.
max_seq_len
# Reset and avoid retaining state when processing context
# Reset and avoid retaining state when processing context
if
will_cache_be_exceeded
:
if
will_cache_be_exceeded
and
seqlen
>
1
:
self
.
start_pos
=
self
.
cache
.
roll_kv_n_steps
(
self
.
start_pos
,
n
=
self
.
start_pos
)
self
.
start_pos
=
self
.
cache
.
roll_kv_n_steps
(
self
.
start_pos
,
n
=
self
.
start_pos
)
# Slowly roll out old tokens without performance hit if exceeded during decoding
# Slowly roll out old tokens without performance hit if exceeded during decoding
elif
will_cache_be_exceeded
and
seqlen
==
1
:
elif
will_cache_be_exceeded
and
seqlen
==
1
:
...
...
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