parent
							
								
									e567956121
								
							
						
					
					
						commit
						0a95c556a1
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -538,7 +538,7 @@ class LowBitLinear(nn.Linear):
 | 
				
			||||||
        # The condition makes sure that empty cache only takes effect if this layer is lm_head.
 | 
					        # 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
 | 
					        # For other models like llama, lm_cache will be applied as well
 | 
				
			||||||
        # since performance isn't impacted.
 | 
					        # 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
 | 
					        self.low_memory_mode = self.is_lm_head
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def forward(self, x: torch.Tensor):
 | 
					    def forward(self, x: torch.Tensor):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue