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
63d2aaec
Unverified
Commit
63d2aaec
authored
Nov 20, 2023
by
Casper
Committed by
GitHub
Nov 20, 2023
Browse files
Robust quantization for Catcher (#209)
parent
e440c7ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
awq/quantize/quantizer.py
awq/quantize/quantizer.py
+10
-2
No files found.
awq/quantize/quantizer.py
View file @
63d2aaec
...
@@ -319,8 +319,16 @@ class AwqQuantizer:
...
@@ -319,8 +319,16 @@ class AwqQuantizer:
super
().
__init__
()
super
().
__init__
()
self
.
module
=
module
self
.
module
=
module
def
forward
(
self
,
hijacked_inputs
,
**
kwargs
):
def
forward
(
self
,
*
args
,
**
kwargs
):
inps
.
append
(
hijacked_inputs
)
# assume first input to forward is hidden states
if
len
(
args
)
>
0
:
hidden_states
=
args
[
0
]
del
args
else
:
first_key
=
list
(
kwargs
.
keys
())[
0
]
hidden_states
=
kwargs
.
pop
(
first_key
)
inps
.
append
(
hidden_states
)
layer_kwargs
.
update
(
kwargs
)
layer_kwargs
.
update
(
kwargs
)
raise
ValueError
# early exit to break later inference
raise
ValueError
# early exit to break later inference
...
...
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