@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 6047187cd8
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 22:00 UTC

[ Misc ] Remove separate bias add (#6353)

Robert Shaw committed Jul 12, 2024 at 01:06 UTC 6047187cd854eef114bd70c76469d5a839a07ef4
1 file changed +3 -15
vllm/model_executor/layers/linear.py
+3 -15
@@ -99,15 +99,7 @@ class LinearMethodBase(QuantizeMethodBase):
99
100
101 class UnquantizedLinearMethod(LinearMethodBase):
102 - """Linear method without quantization.
103 -
104 - Args:
105 - separate_bias_add: If true, add bias separately after matrix
106 - multiplication.
107 - """
108 -
109 - def __init__(self, separate_bias_add: bool = False):
110 - self.separate_bias_add = separate_bias_add
102 + """Linear method without quantization."""
103
104 def create_weights(self, layer: torch.nn.Module,
105 input_size_per_partition: int,
@@ -126,12 +118,8 @@ class UnquantizedLinearMethod(LinearMethodBase):
118 layer: torch.nn.Module,
119 x: torch.Tensor,
120 bias: Optional[torch.Tensor] = None) -> torch.Tensor:
129 - weight = layer.weight
130 - if self.separate_bias_add:
131 - if bias is not None:
132 - return F.linear(x, weight) + bias
133 - return F.linear(x, weight)
134 - return F.linear(x, weight, bias)
121 +
122 + return F.linear(x, layer.weight, bias)
123
124
125 class LinearBase(torch.nn.Module):