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
52d42829
Unverified
Commit
52d42829
authored
Jan 10, 2026
by
maang
Committed by
GitHub
Jan 10, 2026
Browse files
[Core] Refactor ColumnParallelLinear: remove unused parameter and optimize forward (#31939)
Signed-off-by:
maang
<
maang_h@163.com
>
parent
c60578de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
vllm/model_executor/layers/linear.py
vllm/model_executor/layers/linear.py
+4
-10
No files found.
vllm/model_executor/layers/linear.py
View file @
52d42829
...
...
@@ -411,10 +411,10 @@ class ReplicatedLinear(LinearBase):
assert
self
.
quant_method
is
not
None
output
=
self
.
quant_method
.
apply
(
self
,
x
,
bias
)
output_bias
=
self
.
bias
if
self
.
skip_bias_add
else
None
if
not
self
.
return_bias
:
return
output
output_bias
=
self
.
bias
if
self
.
skip_bias_add
else
None
return
output
,
output_bias
def
extra_repr
(
self
)
->
str
:
...
...
@@ -444,8 +444,6 @@ class ColumnParallelLinear(LinearBase):
skip adding bias but instead return it.
params_dtype: Data type for the parameters.
quant_config: Quantization configure.
output_sizes: list of output sizes packed into one output, like for QKV
the list would be size 3.
prefix: The name of the layer in the state dict, including all parents
(e.g. model.layers.0.qkv_proj)
return_bias: If true, return bias together with outputs in forward pass.
...
...
@@ -463,7 +461,6 @@ class ColumnParallelLinear(LinearBase):
skip_bias_add
:
bool
=
False
,
params_dtype
:
torch
.
dtype
|
None
=
None
,
quant_config
:
QuantizationConfig
|
None
=
None
,
output_sizes
:
list
[
int
]
|
None
=
None
,
prefix
:
str
=
""
,
*
,
return_bias
:
bool
=
True
,
...
...
@@ -495,9 +492,6 @@ class ColumnParallelLinear(LinearBase):
self
.
_maybe_allow_fp8_block_shape_mismatch
()
self
.
gather_output
=
gather_output
if
output_sizes
is
None
:
output_sizes
=
[
output_size
]
assert
self
.
quant_method
is
not
None
self
.
quant_method
.
create_weights
(
layer
=
self
,
...
...
@@ -614,9 +608,10 @@ class ColumnParallelLinear(LinearBase):
output
=
tensor_model_parallel_all_gather
(
output_parallel
)
else
:
output
=
output_parallel
output_bias
=
self
.
bias
if
self
.
skip_bias_add
else
None
if
not
self
.
return_bias
:
return
output
output_bias
=
self
.
bias
if
self
.
skip_bias_add
else
None
return
output
,
output_bias
def
extra_repr
(
self
)
->
str
:
...
...
@@ -1469,10 +1464,9 @@ class RowParallelLinear(LinearBase):
else
:
output
=
output_parallel
output_bias
=
self
.
bias
if
self
.
skip_bias_add
else
None
if
not
self
.
return_bias
:
return
output
output_bias
=
self
.
bias
if
self
.
skip_bias_add
else
None
return
output
,
output_bias
def
extra_repr
(
self
)
->
str
:
...
...
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