sgl-project/sglang · error · ValueError

Only 2D tile_tag is supported currently, got: {self.tile_tag

Error message

Only 2D tile_tag is supported currently, got: {self.tile_tag}

What it means

UnlimitedOCR's tile-position encoder only implements tile_tag=='2D'; any other tile_tag value in the vision config is rejected at __init__.

Source

Thrown at python/sglang/srt/models/unlimited_ocr.py:71

        """Initialize UnlimitedOCRForCausalLM with vision encoders, projector, and LM."""
        super().__init__()

        self.config = config
        self.vision_config = config.vision_config
        self.projector_config = config.projector_config
        self.text_config = config.text_config

        n_embed = getattr(self.projector_config, "n_embed", 1280)

        self.tile_tag = config.tile_tag
        self.global_view_pos = config.global_view_pos

        embed_std = 1 / torch.sqrt(torch.tensor(n_embed, dtype=torch.float32))
        if self.tile_tag == "2D":
            self.view_seperator = nn.Parameter(torch.randn(n_embed) * embed_std)
            self.image_newline = nn.Parameter(torch.randn(n_embed) * embed_std)
        else:
            raise ValueError(
                f"Only 2D tile_tag is supported currently, got: {self.tile_tag}"
            )

        self.model = DeepseekForCausalLM(
            config=config.text_config,
            quant_config=quant_config,
            prefix=maybe_prefix(prefix, "language"),
        )

        self.sam_model = build_sam_vit_b()
        self.vision_model = build_clip_l()

        self.projector = MlpProjector(
            projector_type=self.projector_config.projector_type,
            input_dim=self.projector_config.input_dim,
            n_embed=n_embed,
            depth=self.projector_config.depth,
            mlp_ratio=self.projector_config.mlp_ratio,

View on GitHub (pinned to 0132848349)

Solutions

  1. Use a checkpoint/config with tile_tag='2D'
  2. Set tile_tag='2D' in the vision config if the weights actually match
  3. Implement the 1D branch if you have such a checkpoint

Example fix

# config.json
# before
"tile_tag": "1D"
# after
"tile_tag": "2D"
Defensive patterns

Strategy: validation

Validate before calling

assert cfg.vision_config.get('tile_tag','2D') == '2D', 'unlimited_ocr supports tile_tag=2D only'

Prevention

When it happens

Trigger: Loading an UnlimitedOCR checkpoint whose config sets tile_tag to '1D' or another value.

Common situations: Custom/older checkpoints trained with 1D row tags; hand-edited vision configs.

Related errors


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