support GLM-5.2 gate use FP32 (#47410)

Signed-off-by: zRzRzRzRzRzRzR <Yuxuan.Zhang2@liverpool.ac.uk>
This commit is contained in:
Yuxuan Zhang
2026-07-02 22:45:39 +08:00
committed by GitHub
parent a47f38f825
commit 178fd56094
2 changed files with 19 additions and 0 deletions
@@ -74,6 +74,7 @@ class GateLinear(ReplicatedLinear):
self.allow_specialized_router_gemm = can_use_specialized_kernels
self.allow_dsv3_router_gemm = (
self.allow_specialized_router_gemm
and self.weight.dtype == torch.bfloat16
and output_size in self.DSV3_SUPPORTED_NUM_EXPERTS
and input_size in self.DSV3_SUPPORTED_HIDDEN_SIZES
and (input_size, output_size) not in self.DSV3_UNSUPPORTED_SHAPES