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
60a09519
Unverified
Commit
60a09519
authored
Sep 12, 2025
by
Jee Jee Li
Committed by
GitHub
Sep 12, 2025
Browse files
[Bugfix] Fix BNB name match (#24735)
Signed-off-by:
Jee Jee Li
<
pandaleefree@gmail.com
>
parent
64d90c3e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
vllm/model_executor/model_loader/bitsandbytes_loader.py
vllm/model_executor/model_loader/bitsandbytes_loader.py
+6
-5
No files found.
vllm/model_executor/model_loader/bitsandbytes_loader.py
View file @
60a09519
...
...
@@ -326,7 +326,8 @@ class BitsAndBytesModelLoader(BaseModelLoader):
global_tp_size
=
get_tensor_model_parallel_world_size
()
global_tp_rank
=
get_tensor_model_parallel_rank
()
check_match
=
(
lambda
weight_name
,
module_name
:
weight_name
.
removesuffix
(
".weight"
)
==
module_name
)
for
(
org_weight_name
,
mapped_weight_name
,
...
...
@@ -347,12 +348,12 @@ class BitsAndBytesModelLoader(BaseModelLoader):
)
and
mapped_weight_name
.
endswith
(
".weight"
):
# Without sharding
if
any
(
mapped_weight_name
.
startswith
(
module
)
check_match
(
mapped_weight_name
,
module
)
for
module
in
self
.
unsharded_weights_modules
):
weight_sub_tensor
=
weight_tensor
# Shard by column
elif
any
(
mapped_weight_name
.
startswith
(
module
)
check_match
(
mapped_weight_name
,
module
)
for
module
in
self
.
column_sharded_weights_modules
):
total_size
=
weight_tensor
.
size
(
-
1
)
start_index
=
total_size
//
tp_size
*
tp_rank
...
...
@@ -362,14 +363,14 @@ class BitsAndBytesModelLoader(BaseModelLoader):
# Weights have fused on disk. In this case, we assume that the
# weight and module use same name.
elif
any
(
mapped_weight_name
.
startswith
(
module
)
check_match
(
mapped_weight_name
,
module
)
for
module
in
self
.
maybe_fused_weights_modules
):
# special case for fused weights
# get the size of each shard weight tensor
total_shard_sizes
=
next
(
(
sizes
for
module
,
sizes
in
self
.
maybe_fused_weights_modules
.
items
()
if
mapped_weight_name
.
startswith
(
module
)))
if
check_match
(
mapped_weight_name
,
module
)))
total_size
=
weight_tensor
.
size
(
0
)
assert
total_size
==
sum
(
total_shard_sizes
)
# get the start/end index of each shard weight tensor
...
...
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