sgl-project/sglang · error · ValueError
Unknown Pi05 Gemma variant: {variant}
Error message
Unknown Pi05 Gemma variant: {variant} What it means
The Pi05 (pi05_core.py) model factory maps a Gemma variant name string to a hardcoded transformer config (depth, mlp_dim, num_heads, num_kv_heads, head_dim). If the supplied variant string matches none of the known keys, construction fails with 'Unknown Pi05 Gemma variant'. This is a config-name validation error raised during model __init__, before any weights load.
Source
Thrown at python/sglang/multimodal_gen/runtime/models/vlas/pi05_core.py:823
if variant == "gemma_300m":
return GemmaVariantConfig(
width=1024,
depth=18,
mlp_dim=4096,
num_heads=8,
num_kv_heads=1,
head_dim=256,
)
if variant == "gemma_2b":
return GemmaVariantConfig(
width=2048,
depth=18,
mlp_dim=16_384,
num_heads=8,
num_kv_heads=1,
head_dim=256,
)
raise ValueError(f"Unknown Pi05 Gemma variant: {variant}")
def create_sinusoidal_pos_embedding(
time: torch.Tensor,
dimension: int,
min_period: float,
max_period: float,
) -> Tensor:
if dimension % 2 != 0:
raise ValueError(f"dimension ({dimension}) must be divisible by 2")
if time.ndim != 1:
raise ValueError("time must have shape [batch]")
fraction = torch.linspace(
0.0,
1.0,
dimension // 2,
dtype=torch.float64,
device=time.device,View on GitHub (pinned to 0132848349)
Solutions
- Check the error message for the exact variant string and compare it against the keys accepted in get_gemma_variant_config (pi05_core.py around line 790-823)
- Fix the typo/rename in your config to a supported variant name
- If the variant is legitimately new, add a config entry to the mapping in get_gemma_variant_config and rebuild
- Upgrade sglang to a version that supports the variant
Example fix
// before model = Pi05Model(config=Pi05Config(gemma_variant="gemma_3")) // after model = Pi05Model(config=Pi05Config(gemma_variant="gemma3"))
Defensive patterns
Strategy: validation
Validate before calling
import inspect
from sglang.multimodal_gen.runtime.models.vlas import pi05_core
src = inspect.getsource(pi05_core.get_gemma_variant_config)
# fast structural check: any string literal compared to `variant`
import re
supported = set(re.findall(r"variant\s*==\s*[\"']([\w-]+)[\"']", src))
assert my_config.gemma_variant in supported, f"use one of {supported}" Type guard
def is_supported_gemma_variant(v: str) -> bool:
import re, inspect
from sglang.multimodal_gen.runtime.models.vlas import pi05_core
src = inspect.getsource(pi05_core.get_gemma_variant_config)
return v in set(re.findall(r'variant\s*==\s*["\']([\w-]+)["\']', src)) Try / catch
try:
model = Pi05Model(cfg)
except ValueError as e:
if "Unknown Pi05 Gemma variant" in str(e):
raise SystemExit(f"Bad gemma_variant in config: {cfg.gemma_variant}. Check supported variants.") from e
raise Prevention
- Pin your sglang version and record which gemma variants it supports next to your config
- Never hand-edit variant strings in checkpoint configs; copy them verbatim from the upstream repo
- Add a config lint step that validates all enum-like strings before launching long training/serving jobs
When it happens
Trigger: Calling the Pi05 model constructor (directly or via a config object) with a variant key not in the supported set, e.g. a typo like 'gemma_3' instead of 'gemma3', or a new/renamed variant string from a checkpoint config that this code version does not know.
Common situations: Upgrading/downgrading sglang versions where variant names changed; hand-editing a model config JSON; loading a community-finetuned Pi05 checkpoint that names its language model variant differently.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Invalid Pi05 precision: {precision}
- Unsupported Pi05 dtype: {dtype_name}
- VLA action expert should not share the prefix TP layout. Use
- This browser cannot encode H.264 MP4
- H.264 encoder did not return MP4 decoder config
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/d407dd69f8fe6f68.
Report an issue: GitHub.