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
0f39807b
Commit
0f39807b
authored
Sep 20, 2023
by
Casper Hansen
Browse files
Fix small performance regression
parent
ed618bb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
awq/quantize/quantizer.py
awq/quantize/quantizer.py
+4
-1
No files found.
awq/quantize/quantizer.py
View file @
0f39807b
...
@@ -75,8 +75,11 @@ class AwqQuantizer:
...
@@ -75,8 +75,11 @@ class AwqQuantizer:
# [STEP 4]: Quantize weights
# [STEP 4]: Quantize weights
for
name
,
linear_layer
in
named_linears
.
items
():
for
name
,
linear_layer
in
named_linears
.
items
():
# NOTE: small regression in perplexity if linear layer you use .cpu().float()
linear_layer
=
linear_layer
.
cuda
().
half
()
linear_layer
.
weight
.
data
,
scales
,
zeros
=
self
.
pseudo_quantize_tensor
(
linear_layer
.
weight
.
data
,
scales
,
zeros
=
self
.
pseudo_quantize_tensor
(
linear_layer
.
weight
.
data
.
float
()
,
linear_layer
.
weight
.
data
,
get_scale_zp
=
True
get_scale_zp
=
True
)
)
...
...
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