[CPU] refine CPU integration code (#7647)

This commit is contained in:
Chunyuan WU
2025-07-04 00:51:09 +08:00
committed by GitHub
parent ac49dac009
commit 9fcc9a80e7
9 changed files with 141 additions and 116 deletions

View File

@@ -42,7 +42,7 @@ from sglang.srt.model_executor.forward_batch_info import (
ForwardBatch,
ForwardMode,
)
from sglang.srt.utils import dump_to_file
from sglang.srt.utils import dump_to_file, use_intel_amx_backend
logger = logging.getLogger(__name__)
@@ -442,7 +442,7 @@ class LogitsProcessor(nn.Module):
dp_gather_replicate(hidden_states, local_hidden_states, logits_metadata)
if hasattr(lm_head, "weight"):
if getattr(lm_head, "use_intel_amx_backend", False):
if use_intel_amx_backend(lm_head):
logits = torch.ops.sgl_kernel.weight_packed_linear(
hidden_states.to(lm_head.weight.dtype),
lm_head.weight,