[DeepSeek] Use torch.mm for bf16xbf16->fp32 gemm (#41300)

Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
This commit is contained in:
Woosuk Kwon
2026-04-30 16:28:57 -07:00
committed by GitHub
parent 71725f6730
commit 9c61864bf8
8 changed files with 9 additions and 91 deletions
@@ -105,7 +105,7 @@ class GateLinear(ReplicatedLinear):
# Tier 2: cuBLAS bf16→fp32
if self.allow_cublas_router_gemm and x.dtype == torch.bfloat16:
output = ops.router_gemm_bf16_fp32(x, self.weight)
output = torch.mm(x, self.weight.T, out_dtype=torch.float32)
return output, None
# Tier 3: F.linear (ReplicatedLinear)