[Kimi K3 Bug] Fix deepgemm support for kimi k3 (#50458)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2026-07-30 20:10:16 -04:00
committed by GitHub
parent 8700f86a70
commit 0bff0ce5d3
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -381,6 +381,7 @@ def run_single_fp4_case(m, n, k, topk, num_experts):
FP4_MNKs = [
(128, 4096, 4096), # DeepSeek V4 shape
(256, 2048, 2048), # Half-size variant
(128, 384, 3584), # Kimi-K3 TP8 latent-MoE shape
]
FP4_TOPKS = [2]
@@ -5,6 +5,8 @@ Taken from https://github.com/ModelTC/LightLLM/blob/8ed97c74c18f11505b048b1ba00b
and updated to fit vllm needs and terminology.
"""
import math
import torch
import vllm.model_executor.layers.fused_moe.modular_kernel as mk
@@ -424,7 +426,7 @@ def ep_gather(
num_warps = 2
num_tokens = output_tensor.shape[0]
hidden_size = input_tensor.shape[1]
BLOCK_D = min(hidden_size, 1024)
BLOCK_D = math.gcd(hidden_size, 1024)
assert hidden_size % BLOCK_D == 0
grid = (triton.cdiv(hidden_size, BLOCK_D), min(num_tokens, 1024))