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
6c05f669
Unverified
Commit
6c05f669
authored
Oct 28, 2023
by
Sebastian Bodza
Committed by
GitHub
Oct 28, 2023
Browse files
Fixing starcoder based models with 15B (#118)
parent
0cadd65f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
awq/models/gpt_bigcode.py
awq/models/gpt_bigcode.py
+1
-0
awq/quantize/quantizer.py
awq/quantize/quantizer.py
+3
-0
awq/quantize/scale.py
awq/quantize/scale.py
+1
-1
No files found.
awq/models/gpt_bigcode.py
View file @
6c05f669
...
@@ -21,6 +21,7 @@ class GptBigCodeAWQForCausalLM(BaseAWQForCausalLM):
...
@@ -21,6 +21,7 @@ class GptBigCodeAWQForCausalLM(BaseAWQForCausalLM):
@
staticmethod
@
staticmethod
def
move_embed
(
model
:
GPTBigCodeForCausalLM
,
device
):
def
move_embed
(
model
:
GPTBigCodeForCausalLM
,
device
):
model
.
transformer
.
wte
=
model
.
transformer
.
wte
.
to
(
device
)
model
.
transformer
.
wte
=
model
.
transformer
.
wte
.
to
(
device
)
model
.
transformer
.
wpe
=
model
.
transformer
.
wpe
.
to
(
device
)
model
.
transformer
.
drop
=
model
.
transformer
.
drop
.
to
(
device
)
model
.
transformer
.
drop
=
model
.
transformer
.
drop
.
to
(
device
)
@
staticmethod
@
staticmethod
...
...
awq/quantize/quantizer.py
View file @
6c05f669
...
@@ -318,6 +318,9 @@ class AwqQuantizer:
...
@@ -318,6 +318,9 @@ class AwqQuantizer:
self
.
awq_model
.
move_embed
(
self
.
model
,
"cpu"
)
self
.
awq_model
.
move_embed
(
self
.
model
,
"cpu"
)
clear_memory
()
clear_memory
()
if
"attention_mask"
in
layer_kwargs
.
keys
():
layer_kwargs
[
"attention_mask"
]
=
layer_kwargs
[
"attention_mask"
].
to
(
"cuda"
)
return
modules
,
layer_kwargs
,
inps
return
modules
,
layer_kwargs
,
inps
...
...
awq/quantize/scale.py
View file @
6c05f669
...
@@ -108,4 +108,4 @@ def scale_gelu_fc(gelu: allowed_act_fns, fc: nn.Linear, scales: torch.Tensor):
...
@@ -108,4 +108,4 @@ def scale_gelu_fc(gelu: allowed_act_fns, fc: nn.Linear, scales: torch.Tensor):
fc
.
weight
.
mul_
(
scales
.
view
(
1
,
-
1
).
to
(
fc
.
weight
.
device
))
fc
.
weight
.
mul_
(
scales
.
view
(
1
,
-
1
).
to
(
fc
.
weight
.
device
))
for
p
in
fc
.
parameters
():
for
p
in
fc
.
parameters
():
assert
torch
.
isnan
(
p
).
sum
()
==
0
assert
torch
.
isnan
(
p
).
sum
()
==
0
\ No newline at end of file
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