sgl-project/sglang · error · ValueError

MiniMax H3 latent preparation requires pre-queue…

Error message

MiniMax H3 latent preparation requires pre-queue resolved_v2 geometry, got {geometry!r}

What it means

When the denoise state is not already present, the stage builds it from the request's resolved plan and requires plan.shape['geometry'] == 'resolved_v2' — the geometry string produced by the pre-queue resolution stage. Any other value (e.g. 'raw', 'resolved', or None coerced to string) is rejected because latent dimension math assumes the v2 resolution contract.

Solutions

  1. Run the request through the pre-queue geometry resolution stage so plan.shape['geometry'] becomes 'resolved_v2' before latent preparation
  2. Discard cached plans produced by older resolver versions and re-resolve
  3. Verify height/width and latent_t fields are populated by the same resolver (v2 contract)
Defensive patterns

Strategy: validation

Validate before calling

if str(plan.shape.get("geometry")) != "resolved_v2":
    plan = resolve_plan_through_prequeue(plan)  # run geometry resolution first

Type guard

def plan_is_resolved_v2(plan) -> bool:
    return str(plan.shape.get("geometry", "")) == "resolved_v2"

Prevention

When it happens

Trigger: _prepare_denoise_state_from_plan executes with plan.shape['geometry'] set to anything other than 'resolved_v2', or the geometry key missing (str(None) == 'None'), because the pre-queue resolution stage was skipped or an older resolver version wrote a different tag.

Common situations: Running the pipeline without the geometry-resolution pre-queue stage, using a stale/cached resolved plan from an older format, or feeding a raw un-resolved request directly into the model stages.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/latent_preparation.py:80

        batch.audio_latents = audio_rows
        batch.raw_latent_shape = (1, 24, latent_t, latent_h, latent_w)
        batch.raw_audio_latent_shape = (2, 32, audio_t)

    def _prepare_denoise_state_from_plan(self, batch: Req, plan) -> None:
        """Direct initial-noise materialization (t2va recipe):
        torch.Generator().manual_seed(seed); video rows drawn first,
        then audio rows, CPU fp32. Every task consumes the final latent grid
        frozen by the pre-queue shape resolver."""
        from sglang.multimodal_gen.runtime.pipelines_core.stages.model_specific_stages.minimax_h3.constants import (
            MINIMAX_H3_DENOISE_STATE_EXTRA_KEY,
        )

        if MINIMAX_H3_DENOISE_STATE_EXTRA_KEY in batch.extra:
            return
        shape = plan.shape
        geometry = str(shape["geometry"])
        if geometry != "resolved_v2":
            raise ValueError(
                "MiniMax H3 latent preparation requires pre-queue resolved_v2 "
                f"geometry, got {geometry!r}"
            )
        latent_h = int(shape["height"]) // 16
        latent_w = int(shape["width"]) // 16
        if shape.get("video_latent_t") is None or shape.get("audio_latent_t") is None:
            raise ValueError(
                "MiniMax H3 latent preparation requires pre-queue resolved "
                "temporal dimensions"
            )
        latent_t = int(shape["video_latent_t"])
        audio_t = int(shape["audio_latent_t"])

        seed = plan.seed
        if seed is None:
            seed = 42  # pinned default seed
        video_rows_n = latent_t * (latent_h // 2) * (latent_w // 2)
        audio_rows_n = audio_t * 2

View on GitHub (pinned to 0132848349)