Revert "Bump FlashInfer to 0.6.15 and revert regressions" (#31625)
This commit is contained in:
@@ -31,7 +31,7 @@ dependencies = [
|
||||
"einops",
|
||||
"fastapi",
|
||||
"flash-attn-4==4.0.0b15",
|
||||
"flashinfer_python[cu13]==0.6.15", # keep it aligned with jit-cache version in Dockerfile
|
||||
"flashinfer_python[cu13]==0.6.14", # keep it aligned with jit-cache version in Dockerfile
|
||||
"gguf",
|
||||
"humming-kernels[cu13]==0.1.10",
|
||||
"interegular",
|
||||
|
||||
@@ -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.15",
|
||||
"0.6.14",
|
||||
"Please uninstall the old version and "
|
||||
"reinstall the latest version by following the instructions "
|
||||
"at https://docs.flashinfer.ai/installation.html.",
|
||||
|
||||
@@ -222,17 +222,6 @@ def resolve_cutedsl_standard_scales(
|
||||
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.
|
||||
|
||||
@@ -248,7 +237,7 @@ def ensure_cutedsl_wrapper(layer: torch.nn.Module) -> None:
|
||||
return
|
||||
|
||||
try:
|
||||
from flashinfer import ActivationType, CuteDslMoEWrapper
|
||||
from flashinfer import CuteDslMoEWrapper
|
||||
except ImportError as e:
|
||||
raise ImportError(
|
||||
"flashinfer_cutedsl backend requires FlashInfer with CuteDSL support. "
|
||||
@@ -295,9 +284,7 @@ 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_type=_cutedsl_wrapper_activation_type(
|
||||
layer.moe_runner_config.activation, ActivationType
|
||||
),
|
||||
activation=layer.moe_runner_config.activation,
|
||||
)
|
||||
|
||||
w1_alpha, fc2_input_scale, w2_alpha, used_input_scale = (
|
||||
|
||||
@@ -459,6 +459,14 @@ class MoEGate(nn.Module):
|
||||
"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)
|
||||
)
|
||||
|
||||
@@ -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.15")
|
||||
min_version: Minimum version required (e.g., "0.6.14")
|
||||
|
||||
Returns:
|
||||
True if package is installed and version >= min_version, False otherwise
|
||||
|
||||
Reference in New Issue
Block a user