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
e94b263b
Unverified
Commit
e94b263b
authored
Mar 01, 2026
by
Isotr0py
Committed by
GitHub
Feb 28, 2026
Browse files
[Chore] Cleanup BNB utilization dead code (#35620)
Signed-off-by:
Isotr0py
<
mozf@mail2.sysu.edu.cn
>
parent
e113a301
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
39 deletions
+0
-39
vllm/model_executor/layers/linear.py
vllm/model_executor/layers/linear.py
+0
-39
No files found.
vllm/model_executor/layers/linear.py
View file @
e94b263b
...
...
@@ -3,7 +3,6 @@
import
itertools
from
abc
import
abstractmethod
from
typing
import
Any
import
torch
from
torch.nn.parameter
import
Parameter
,
UninitializedParameter
...
...
@@ -133,44 +132,6 @@ def adjust_scalar_to_fused_array(
return
param_data
[
shard_id
],
loaded_weight
# TODO(Isotr0py): We might need a more flexible structure to handle
# bitsandbytes shard offsets.
def
left_shift_bitsandbytes_4bit_shard
(
bnb_weight_attrs
:
dict
[
str
,
Any
],
)
->
tuple
[
dict
[
str
,
Any
],
dict
[
str
,
Any
]]:
"""
Separate the BitsAndBytes 4-bit shard.
For example, given bnb weight attributes as below:
{
'bnb_shard_offsets': array([0, 4, 8, 16]),
'bnb_quant_state': {0: ..., 1: ..., 2: ...},
}
The function will return:
{
'bnb_shard_offsets': array([0, 4]),
'bnb_quant_state': {0: ...},
}
and
{
'bnb_shard_offsets': array([0, 4, 12]),
'bnb_quant_state': {0: ..., 1: ...},
}
"""
shard_offsets
=
bnb_weight_attrs
[
"bnb_shard_offsets"
]
offset_l
=
shard_offsets
[:
2
]
offset_r
=
shard_offsets
[
1
:]
-
shard_offsets
[
1
]
quant_state_l
=
{
0
:
bnb_weight_attrs
[
"bnb_quant_state"
][
0
]}
quant_state_r
=
{
i
-
1
:
bnb_weight_attrs
[
"bnb_quant_state"
][
i
]
for
i
in
range
(
1
,
len
(
shard_offsets
)
-
1
)
}
left
=
dict
(
bnb_shard_offsets
=
offset_l
,
bnb_quant_state
=
quant_state_l
)
right
=
dict
(
bnb_shard_offsets
=
offset_r
,
bnb_quant_state
=
quant_state_r
)
return
left
,
right
class
LinearMethodBase
(
QuantizeMethodBase
):
"""Base class for different (maybe quantized) linear methods."""
...
...
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