Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
82f3937e
Unverified
Commit
82f3937e
authored
Sep 30, 2024
by
Divakar Verma
Committed by
GitHub
Oct 01, 2024
Browse files
[Misc] add process_weights_after_loading for DummyLoader (#8969)
parent
7da24875
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
vllm/model_executor/model_loader/loader.py
vllm/model_executor/model_loader/loader.py
+12
-0
No files found.
vllm/model_executor/model_loader/loader.py
View file @
82f3937e
...
@@ -441,6 +441,18 @@ class DummyModelLoader(BaseModelLoader):
...
@@ -441,6 +441,18 @@ class DummyModelLoader(BaseModelLoader):
# NOTE(woosuk): For accurate performance evaluation, we assign
# NOTE(woosuk): For accurate performance evaluation, we assign
# random values to the weights.
# random values to the weights.
initialize_dummy_weights
(
model
)
initialize_dummy_weights
(
model
)
for
_
,
module
in
model
.
named_modules
():
quant_method
=
getattr
(
module
,
"quant_method"
,
None
)
if
quant_method
is
not
None
:
# When quant methods need to process weights after loading
# (for repacking, quantizing, etc), they expect parameters
# to be on the global target device. This scope is for the
# case where cpu offloading is used, where we will move the
# parameters onto device for processing and back off after.
with
device_loading_context
(
module
,
torch
.
device
(
device_config
.
device
)):
quant_method
.
process_weights_after_loading
(
module
)
return
model
.
eval
()
return
model
.
eval
()
...
...
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