[CPU] [BF16] Call fused_experts_cpu, weight_packed_linear and bmm_cpu kernel in DeepSeek model (#6641)
Co-authored-by: Thien Tran <gau.nernst@yahoo.com.sg>
This commit is contained in:
@@ -442,11 +442,20 @@ class LogitsProcessor(nn.Module):
|
||||
dp_gather_replicate(hidden_states, local_hidden_states, logits_metadata)
|
||||
|
||||
if hasattr(lm_head, "weight"):
|
||||
logits = torch.matmul(
|
||||
hidden_states.to(lm_head.weight.dtype), lm_head.weight.T
|
||||
)
|
||||
if getattr(lm_head, "use_intel_amx_backend", False):
|
||||
logits = torch.ops.sgl_kernel.weight_packed_linear(
|
||||
hidden_states.to(lm_head.weight.dtype),
|
||||
lm_head.weight,
|
||||
None, # bias
|
||||
True, # is_vnni
|
||||
)
|
||||
else:
|
||||
logits = torch.matmul(
|
||||
hidden_states.to(lm_head.weight.dtype), lm_head.weight.T
|
||||
)
|
||||
else:
|
||||
# GGUF models
|
||||
# TODO: use weight_packed_linear for GGUF models
|
||||
logits = lm_head.quant_method.apply(lm_head, hidden_states, embedding_bias)
|
||||
|
||||
if self.logit_scale is not None:
|
||||
|
||||
Reference in New Issue
Block a user