sgl-project/sglang · error · ValueError

MiniMax H3 latent preparation requires pre-queue resolved te

Error message

MiniMax H3 latent preparation requires pre-queue resolved temporal dimensions

What it means

With resolved_v2 geometry confirmed, the stage requires both plan.shape['video_latent_t'] and plan.shape['audio_latent_t'] to be non-None, because it must know the temporal latent lengths to size the noise tensors. The error indicates the resolver did not (or could not) compute temporal dimensions for this request.

Source

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

        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
        # Noise semantics:
        # - video noise is drawn on the RAW latent tensor
        #   [1, 24, T, H_lat, W_lat] in tensor layout, then patchified
        #   into packed row order;
        # - audio uses an INDEPENDENT generator re-seeded with the same
        #   seed (each modality re-seeds its own generator);
        # - no extra cond-frame noise is drawn for image-conditioned

View on GitHub (pinned to 0132848349)

Solutions

  1. Ensure the request specifies duration/fps so the resolver computes video_latent_t and audio_latent_t
  2. Upgrade the resolver/pre-queue stage to the version that emits both temporal fields under resolved_v2
  3. Inspect plan.shape and re-resolve the request if either field is None
Defensive patterns

Strategy: validation

Validate before calling

if plan.shape.get("video_latent_t") is None or plan.shape.get("audio_latent_t") is None:
    raise ValueError("request needs duration/fps so the resolver fills temporal dims")

Type guard

def plan_has_temporal_dims(plan) -> bool:
    return plan.shape.get("video_latent_t") is not None and plan.shape.get("audio_latent_t") is not None

Prevention

When it happens

Trigger: _prepare_denoise_state_from_plan finds shape.get('video_latent_t') is None or shape.get('audio_latent_t') is None — e.g. duration unset in the request, a resolution path that skips temporal computation, or a v2 plan variant that omits audio latent_t.

Common situations: Requests without duration/fps information, resolver version mismatches where temporal fields were renamed, or video-only plans routed through a stage that assumes audio temporal dims exist.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


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