sgl-project/sglang · error · ValueError

use_rope2d must be True

Error message

use_rope2d must be True

What it means

The Step3-VL-10B vision encoder's implementation only supports 2D rotary position embeddings; if config.use_rope2d is false the position-encoding path would differ from the trained model, so init rejects it outright.

Source

Thrown at python/sglang/srt/models/step3_vl_10b.py:317

        config,
        act_layer: Callable,
        norm_layer: Callable = _DEFAULT_NORM_LAYER,
        quant_config: Optional[QuantizationConfig] = None,
        prefix: str = "",
    ):
        super().__init__()
        self.patch_size = config.patch_size

        self.output_dim = config.output_dim or config.width
        self.heads = config.heads
        self.width = config.width
        self.layers = config.layers

        self.use_abs_posemb = config.use_abs_posemb
        self.use_cls_token = config.use_cls_token
        self.use_rope2d = config.use_rope2d
        if not self.use_rope2d:
            raise ValueError("use_rope2d must be True")
        self.image_size = config.image_size

        self.conv1 = Conv2dLayer(
            in_channels=3,
            out_channels=config.width,
            kernel_size=config.patch_size,
            stride=config.patch_size,
            bias=False,
        )

        self.ln_pre = norm_layer(config.width) if config.use_ln_pre else nn.Identity()
        self.ln_post = norm_layer(self.width) if config.use_ln_post else nn.Identity()

        self.transformer = PerceptionEncoderVisionTransformer(
            config.width,
            config.layers,
            config.heads,
            max_grid_height=self.image_size // self.patch_size,

View on GitHub (pinned to 0132848349)

Solutions

  1. Restore use_rope2d: true in the vision config.json
  2. Re-download the original step3-vl-10b checkpoint config
  3. If the variant truly lacks rope2d, use a backend supporting it or extend the model

Example fix

// config.json
// before: "use_rope2d": false
// after:  "use_rope2d": true
Defensive patterns

Strategy: validation

Validate before calling

assert config.use_rope2d is True, "step3-vl-10b vision requires use_rope2d=true"

Prevention

When it happens

Trigger: Loading a step3-vl-10b vision config where use_rope2d is False (edited config.json, wrong vision tower config merged from another model, or a new checkpoint variant).

Common situations: Checkpoint merges that take the vision config from a different model; hand-tuned configs disabling rope2d expecting abs-posemb fallback; conversion tooling writing incomplete vision configs.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/683cc2c6f4bd819c. Report an issue: GitHub.