Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ARG PIP_DEFAULT_INDEX
ARG UBUNTU_MIRROR
ARG GITHUB_ARTIFACTORY=github.com
ARG INSTALL_FLASHINFER_JIT_CACHE=0
ARG FLASHINFER_VERSION=0.6.14
ARG FLASHINFER_VERSION=0.6.15
ARG MOONCAKE_VERSION=0.3.11.post1
ARG MSCCLPP_VERSION=sglang-v0.9.1
#if need other arg please add in MOONCAKE_COMPILE_ARG
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies = [
"einops",
"fastapi",
"flash-attn-4==4.0.0b15",
"flashinfer_python[cu13]==0.6.14", # keep it aligned with jit-cache version in Dockerfile
"flashinfer_python[cu13]==0.6.15", # keep it aligned with jit-cache version in Dockerfile
"gguf",
"humming-kernels[cu13]==0.1.10",
"interegular",
Expand Down
2 changes: 1 addition & 1 deletion python/sglang/srt/entrypoints/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ def _set_envs_and_config(server_args: ServerArgs):
if server_args.attention_backend == "flashinfer":
assert_pkg_version(
"flashinfer_python",
"0.6.14",
"0.6.15",
"Please uninstall the old version and "
"reinstall the latest version by following the instructions "
"at https://docs.flashinfer.ai/installation.html.",
Expand Down
17 changes: 15 additions & 2 deletions python/sglang/srt/layers/moe/moe_runner/flashinfer_cutedsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,17 @@ def _resolve_w2_alpha_from_scalar_fc2_input_scale(
return w1_alpha, fc2_input_scale, w2_alpha, used_input_scale


def _cutedsl_wrapper_activation_type(activation: str, activation_type_cls: Any) -> Any:
if activation == "silu":
return activation_type_cls.Swiglu
if activation == "relu2":
return activation_type_cls.Relu2
raise ValueError(
f"CuteDSL MoE wrapper supports 'silu' (gated) or 'relu2' (non-gated) "
f"activation, got {activation!r}."
)


def ensure_cutedsl_wrapper(layer: torch.nn.Module) -> None:
"""Lazily create CuteDslMoEWrapper and resolve scales on first forward.

Expand All @@ -237,7 +248,7 @@ def ensure_cutedsl_wrapper(layer: torch.nn.Module) -> None:
return

try:
from flashinfer import CuteDslMoEWrapper
from flashinfer import ActivationType, CuteDslMoEWrapper
except ImportError as e:
raise ImportError(
"flashinfer_cutedsl backend requires FlashInfer with CuteDSL support. "
Expand Down Expand Up @@ -284,7 +295,9 @@ def ensure_cutedsl_wrapper(layer: torch.nn.Module) -> None:
local_expert_offset=layer.moe_ep_rank * layer.num_local_experts,
output_dtype=layer.moe_runner_config.params_dtype,
device=str(layer.w13_weight.device),
activation=layer.moe_runner_config.activation,
activation_type=_cutedsl_wrapper_activation_type(
layer.moe_runner_config.activation, ActivationType
),
)

w1_alpha, fc2_input_scale, w2_alpha, used_input_scale = (
Expand Down
8 changes: 0 additions & 8 deletions python/sglang/srt/models/deepseek_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,6 @@ def __init__(
"quark",
):
correction_bias_dtype = torch.bfloat16
# NOTE(kpham-sgl): flashinfer trtllm routing requires a bf16
# routing_bias; an fp32 bias yields NaN routing on exact ties.
# Mirror the fp8 path's cast.
if (
quant_config.get_name() == "modelopt_fp4"
and get_moe_runner_backend().is_flashinfer_trtllm()
):
correction_bias_dtype = torch.bfloat16
self.e_score_correction_bias = nn.Parameter(
torch.empty((config.n_routed_experts), dtype=correction_bias_dtype)
)
Expand Down
2 changes: 1 addition & 1 deletion python/sglang/srt/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,7 @@ def check_pkg_version_at_least(pkg: str, min_version: str) -> bool:

Args:
pkg: Package name (distribution name, e.g., "flashinfer-python")
min_version: Minimum version required (e.g., "0.6.14")
min_version: Minimum version required (e.g., "0.6.15")

Returns:
True if package is installed and version >= min_version, False otherwise
Expand Down
2 changes: 1 addition & 1 deletion test/registered/models_e2e/test_dsa_glm52_nvfp4_tp_mtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TestGLM52NVFP4TPMTP(
model = "nvidia/GLM-5.2-NVFP4"
tp_size = 4
mem_fraction_static = 0.8
bs_1_speed_thres = 250
bs_1_speed_thres = 280
extra_server_args = [
"--moe-runner-backend",
"flashinfer_trtllm",
Expand Down
Loading