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
53a1ba6e
Unverified
Commit
53a1ba6e
authored
Nov 22, 2025
by
Ning Xie
Committed by
GitHub
Nov 21, 2025
Browse files
[log] add weights loading time log to sharded_state loader (#28628)
Signed-off-by:
Andy Xie
<
andy.xning@gmail.com
>
parent
1840c5cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
vllm/model_executor/model_loader/sharded_state_loader.py
vllm/model_executor/model_loader/sharded_state_loader.py
+8
-0
No files found.
vllm/model_executor/model_loader/sharded_state_loader.py
View file @
53a1ba6e
...
...
@@ -4,6 +4,7 @@
import
collections
import
glob
import
os
import
time
from
collections.abc
import
Generator
from
typing
import
Any
...
...
@@ -132,6 +133,7 @@ class ShardedStateLoader(BaseModelLoader):
f
"pre-sharded checkpoints are currently supported!"
)
state_dict
=
self
.
_filter_subtensors
(
model
.
state_dict
())
counter_before_loading_weights
=
time
.
perf_counter
()
for
key
,
tensor
in
self
.
iterate_over_files
(
filepaths
):
# If loading with LoRA enabled, additional padding may
# be added to certain parameters. We only load into a
...
...
@@ -150,6 +152,12 @@ class ShardedStateLoader(BaseModelLoader):
)
param_data
.
copy_
(
tensor
)
state_dict
.
pop
(
key
)
counter_after_loading_weights
=
time
.
perf_counter
()
logger
.
info_once
(
"Loading weights took %.2f seconds"
,
counter_after_loading_weights
-
counter_before_loading_weights
,
scope
=
"local"
,
)
if
state_dict
:
raise
ValueError
(
f
"Missing keys
{
tuple
(
state_dict
)
}
in loaded state!"
)
...
...
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