[Perf] dsv41: Drop the MegaGate padded-row copy on sgl-deep-gemm 0.2.3.post2 (#45933)

Co-authored-by: hnyls2002 <lsyincs@gmail.com>
This commit is contained in:
Khoa Pham
2026-10-22 22:10:57 -07:00
committed by GitHub
co-authored by hnyls2002
parent e83f585ae6
commit 5bdbec0d48
4 changed files with 6 additions and 8 deletions
+2 -2
View File
@@ -6,8 +6,8 @@ ARG TORCHVISION_NIGHTLY_VERSION=0.30.0.dev20261005+cu134
ARG TORCHAUDIO_NIGHTLY_VERSION=2.11.0.dev20261004+cu134
# Wheel build args
ARG MANYLINUX_IMAGE=pytorch/manylinuxaarch64-builder:cuda13.4
ARG DEEPGEMM_REF=v0.2.3
ARG SGL_DEEP_GEMM_VERSION=0.2.3
ARG DEEPGEMM_REF=v0.2.3.post2
ARG SGL_DEEP_GEMM_VERSION=0.2.3.post2
ARG DEEPEP_SOURCE_REF=sgl-deepep
ARG SGL_DEEP_EP_VERSION=0.1.2.post1
+1 -1
View File
@@ -75,7 +75,7 @@ dependencies = [
"sentencepiece==0.2.1", # 0.2.2 rejects null pieces in InternVL tokenizers.
"setproctitle",
"sgl-deep-ep==0.1.2.post1",
"sgl-deep-gemm==0.2.3",
"sgl-deep-gemm==0.2.3.post2",
"sgl-flash-mla==1.0.0",
"sglang-kernel==0.4.10",
"smg-grpc-servicer>=0.9.0",
@@ -23,9 +23,6 @@ def bf16_mega_gate(
) -> tuple[torch.Tensor, torch.Tensor]:
import deep_gemm
if valid_token_mask is not None:
hidden_states = torch.where(valid_token_mask[:, None], hidden_states, 0)
if out is None:
ids = torch.empty(
(hidden_states.shape[0], top_k),
@@ -456,8 +456,9 @@ class TestDeepGemmMegaMoeApi(CustomTestCase):
@staticmethod
def _mega_gate_reference(x, weight, top_k, **kwargs):
if not torch.isfinite(x).all():
raise ValueError("MegaGate rejects nonfinite GEMM inputs")
unmasked = x if kwargs["mask"] is None else x[kwargs["mask"]]
if not torch.isfinite(unmasked).all():
raise ValueError("MegaGate rejects nonfinite scores on unmasked rows")
scores = torch.log1p(torch.exp(x.float() @ weight.float().T)).sqrt()
if kwargs["unmapped_topk_idx"] is not None:
ids = kwargs["unmapped_topk_idx"]