Skip to content

Commit

Permalink
Fix starcoder first token perf (#10612)
Browse files Browse the repository at this point in the history
* add bias check

* update
  • Loading branch information
hkvision authored Apr 2, 2024
1 parent e567956 commit 0a95c55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/llm/src/ipex_llm/transformers/low_bit_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def __init__(self, input_features, output_features, qtype, bias=True,
# The condition makes sure that empty cache only takes effect if this layer is lm_head.
# For other models like llama, lm_cache will be applied as well
# since performance isn't impacted.
self.is_lm_head = self.in_len * self.out_len >= 30000 * 4096
self.is_lm_head = self.in_len * self.out_len >= 32000 * 4096 and self.bias is None
self.low_memory_mode = self.is_lm_head

def forward(self, x: torch.Tensor):
Expand Down

0 comments on commit 0a95c55

Please sign in to comment.