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
ffaaa259
Commit
ffaaa259
authored
Sep 27, 2023
by
s4rduk4r
Browse files
Rely on accelerate.dispatch_model() only
parent
91de3bfa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
awq/models/base.py
awq/models/base.py
+9
-16
No files found.
awq/models/base.py
View file @
ffaaa259
...
@@ -168,23 +168,16 @@ class BaseAWQForCausalLM(nn.Module):
...
@@ -168,23 +168,16 @@ class BaseAWQForCausalLM(nn.Module):
)
)
# Dispath to devices
# Dispath to devices
if
max_memory
is
None
:
if
fuse_layers
:
# VRAM only
self
.
fuse_layers
(
model
,
quant_config
)
model
=
simple_dispatch_model
(
model
,
device_map
)
if
fuse_layers
:
# Offloading dispatch
self
.
fuse_layers
(
model
,
quant_config
)
from
accelerate
import
dispatch_model
else
:
model
=
dispatch_model
(
if
fuse_layers
:
model
,
self
.
fuse_layers
(
model
,
quant_config
)
device_map
=
device_map
,
offload_dir
=
offload_folder
# Offloading dispatch
)
from
accelerate
import
dispatch_model
model
=
dispatch_model
(
model
,
device_map
=
device_map
,
offload_dir
=
offload_folder
)
return
self
(
model
,
model_type
,
is_quantized
=
is_quantized
,
quant_config
=
quant_config
)
return
self
(
model
,
model_type
,
is_quantized
=
is_quantized
,
quant_config
=
quant_config
)
...
...
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