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 17, 00:30 UTC
[Misc] Skip for logits_scale == 1.0 (#5291)
Woosuk Kwon committed
Jun 5, 2024 at 15:19 UTC
6a7c7711a2588ca4a5e713e5335122988f8c0a55
1 file changed
+3
-2
vllm/model_executor/layers/logits_processor.py
+3
-2
@@ -21,7 +21,7 @@ class LogitsProcessor(nn.Module):
21
def __init__(self,
22
vocab_size: int,
23
org_vocab_size: Optional[int] = None,
24
- scale: Optional[float] = 1.0,
24
+ scale: float = 1.0,
25
logits_as_input: bool = False) -> None:
26
"""
27
Args:
@@ -52,7 +52,8 @@ class LogitsProcessor(nn.Module):
52
logits = self._get_logits(hidden_states, embedding, embedding_bias)
53
54
if logits is not None:
55
- logits *= self.scale
55
+ if self.scale != 1.0:
56
+ logits *= self.scale
57
58
# Apply logits processors (if any).
59
logits = _apply_logits_processors(logits, sampling_metadata)