sgl-project/sglang · error · ValueError
expert-pack requires --disable-shared-experts-fusion so the
Error message
expert-pack requires --disable-shared-experts-fusion so the shared expert remains on the dense GGUF path
What it means
The expert-pack path stores experts in a fused GGUF-like pack and requires shared experts to stay on the dense path. If shared-experts fusion is enabled (layer.num_fused_shared_experts != 0), the fused MoE layout conflicts with the pack, so create_weights raises.
Source
Thrown at python/sglang/srt/layers/quantization/expert_pack.py:99
self.hidden_size: int | None = None
self.intermediate_size: int | None = None
self.activation = "silu"
self.swiglu_limit: float | None = None
self.situ_beta: float | None = None
self.situ_linear_beta: float | None = None
def create_weights(
self,
layer: torch.nn.Module,
num_experts: int,
hidden_size: int,
intermediate_size_per_partition: int,
params_dtype: torch.dtype,
**extra_weight_attrs,
) -> None:
del extra_weight_attrs
if layer.num_fused_shared_experts:
raise ValueError(
"expert-pack requires --disable-shared-experts-fusion so the "
"shared expert remains on the dense GGUF path"
)
if layer.moe_ep_size != 1 or layer.moe_tp_size != 1:
raise ValueError("expert-pack v1 supports only single-GPU TP=EP=1")
if num_experts != self.store.header.num_experts:
raise ValueError("FusedMoE expert count does not match expert-pack")
if params_dtype not in (torch.bfloat16, torch.float16):
raise ValueError("expert-pack kernel requires BF16 or FP16 activations")
gate_shape = self.store.entries[(layer.layer_id, 0, 0)].shape
down_shape = self.store.entries[(layer.layer_id, 0, 2)].shape
if gate_shape != (hidden_size, intermediate_size_per_partition):
raise ValueError(
f"expert-pack gate shape {gate_shape} does not match "
f"{(hidden_size, intermediate_size_per_partition)}"
)
if down_shape != (intermediate_size_per_partition, hidden_size):
raise ValueError(View on GitHub (pinned to 0132848349)
Solutions
- Launch with --disable-shared-experts-fusion
- Verify the layer then has num_fused_shared_experts == 0
- Check other expert-pack constraints (TP=EP=1) at the same time
Example fix
# before python -m sglang.launch_server --model ds-expert-pack --tp 1 # after python -m sglang.launch_server --model ds-expert-pack --tp 1 --disable-shared-experts-fusion
Defensive patterns
Strategy: validation
Validate before calling
assert "--disable-shared-experts-fusion" in server_args, "expert-pack requires --disable-shared-experts-fusion"
Prevention
- Bake required flags into launch scripts for expert-pack models
When it happens
Trigger: Launching an expert-pack quantized MoE model without --disable-shared-experts-fusion, so SGLang fuses the shared expert into the MoE layer before expert-pack weight creation.
Common situations: Default server args enabling shared-experts fusion on models like DeepSeek-V3 expert-pack builds.
Related errors
- expert-pack header coverage is inconsistent
- expert-pack is not identity triplet layout
- expert-pack alignment is invalid
- expert-pack data offset is invalid
- expert-pack index is truncated
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/4b7c3432601aa855.
Report an issue: GitHub.