[Perf] dspark: Combine the draft's mHC streams from bf16 without an fp32 copy (#45964)

This commit is contained in:
Liangsheng Yin
2026-10-22 21:44:01 -07:00
committed by GitHub
parent f4a2df3dac
commit 49933325cc
@@ -950,7 +950,8 @@ class DeepseekV4ForCausalLMDSpark(nn.Module):
if self.hc_pre_from_prev_sublayer:
from sglang.kernels.ops.layernorm.mhc import mhc_combine
x = mhc_combine(x.flatten(1).float(), pre, self.hc_mult, x.dtype)
# The kernel widens each element to fp32 as it loads it.
x = mhc_combine(x.flatten(1), pre, self.hc_mult, x.dtype)
return LogitsProcessorOutput(next_token_logits=None, hidden_states=x)
def collapse_hc_head(self, x: torch.Tensor) -> torch.Tensor: