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
6047187c
Unverified
Commit
6047187c
authored
Jul 12, 2024
by
Robert Shaw
Committed by
GitHub
Jul 12, 2024
Browse files
[ Misc ] Remove separate bias add (#6353)
parent
b6c16cf8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
15 deletions
+3
-15
vllm/model_executor/layers/linear.py
vllm/model_executor/layers/linear.py
+3
-15
No files found.
vllm/model_executor/layers/linear.py
View file @
6047187c
...
@@ -99,15 +99,7 @@ class LinearMethodBase(QuantizeMethodBase):
...
@@ -99,15 +99,7 @@ class LinearMethodBase(QuantizeMethodBase):
class
UnquantizedLinearMethod
(
LinearMethodBase
):
class
UnquantizedLinearMethod
(
LinearMethodBase
):
"""Linear method without quantization.
"""Linear method without quantization."""
Args:
separate_bias_add: If true, add bias separately after matrix
multiplication.
"""
def
__init__
(
self
,
separate_bias_add
:
bool
=
False
):
self
.
separate_bias_add
=
separate_bias_add
def
create_weights
(
self
,
layer
:
torch
.
nn
.
Module
,
def
create_weights
(
self
,
layer
:
torch
.
nn
.
Module
,
input_size_per_partition
:
int
,
input_size_per_partition
:
int
,
...
@@ -126,12 +118,8 @@ class UnquantizedLinearMethod(LinearMethodBase):
...
@@ -126,12 +118,8 @@ class UnquantizedLinearMethod(LinearMethodBase):
layer
:
torch
.
nn
.
Module
,
layer
:
torch
.
nn
.
Module
,
x
:
torch
.
Tensor
,
x
:
torch
.
Tensor
,
bias
:
Optional
[
torch
.
Tensor
]
=
None
)
->
torch
.
Tensor
:
bias
:
Optional
[
torch
.
Tensor
]
=
None
)
->
torch
.
Tensor
:
weight
=
layer
.
weight
if
self
.
separate_bias_add
:
return
F
.
linear
(
x
,
layer
.
weight
,
bias
)
if
bias
is
not
None
:
return
F
.
linear
(
x
,
weight
)
+
bias
return
F
.
linear
(
x
,
weight
)
return
F
.
linear
(
x
,
weight
,
bias
)
class
LinearBase
(
torch
.
nn
.
Module
):
class
LinearBase
(
torch
.
nn
.
Module
):
...
...
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