sgl-project/sglang · error · ValueError

unsupported MiniMax H3 decoder task {task_value!r}

Error message

unsupported MiniMax H3 decoder task {task_value!r}

What it means

_minimax_h3_decoder_task resolves the task from the resolved plan or canonical request and requires it to be a string in the _MINIMAX_H3_DECODER_TASKS set. Any non-string or unknown task raises ValueError.

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/decoding.py:251

    if not isinstance(extra, Mapping):
        return None
    canonical = extra.get(_MINIMAX_H3_CANONICAL_REQUEST_EXTRA_KEY)
    if canonical is not None and not isinstance(canonical, Mapping):
        raise ValueError("minimax_h3_canonical_request must be a mapping")
    canonical_task = canonical.get("task") if isinstance(canonical, Mapping) else None
    resolved = extra.get(_MINIMAX_H3_RESOLVED_PLAN_EXTRA_KEY)
    resolved_task = getattr(resolved, "task", None) if resolved is not None else None
    if canonical_task is not None and resolved_task is not None:
        if str(canonical_task) != str(resolved_task):
            raise ValueError(
                "MiniMax H3 decoder task mismatch between canonical request and "
                "resolved plan"
            )
    task_value = resolved_task if resolved_task is not None else canonical_task
    if task_value is None:
        return None
    if not isinstance(task_value, str) or task_value not in _MINIMAX_H3_DECODER_TASKS:
        raise ValueError(f"unsupported MiniMax H3 decoder task {task_value!r}")
    return task_value


class MiniMaxH3DecodingStage(DecodingStage):
    def __init__(self, video_vae, audio_vae) -> None:
        super().__init__(vae=video_vae, component_name="video_vae")
        self.video_vae = video_vae
        self.audio_vae = audio_vae
        self._compiled_audio_vae_decode = ActiveTargetCompiledCallable()

    @property
    def role_affinity(self) -> RoleType:
        return RoleType.DECODER

    @property
    def parallelism_type(self) -> StageParallelismType:
        # Every decode-group rank owns a subset of visual VAE tiles. The GPU
        # worker only materializes/saves the final OutputBatch on world rank 0.

View on GitHub (pinned to 0132848349)

Solutions

  1. Set task to one of the supported MiniMax H3 decoder tasks (check _MINIMAX_H3_DECODER_TASKS in decoding.py)
  2. Ensure task is a plain string, not an enum/other type
  3. Regenerate the plan through minimax_h3_resolve_plan so the task is normalized

Example fix

# before
canonical["task"] = "text2video"
# after
canonical["task"] = "t2v"  # or another entry in _MINIMAX_H3_DECODER_TASKS
Defensive patterns

Strategy: type-guard

Validate before calling

from ...decoding import _MINIMAX_H3_DECODER_TASKS
assert canonical["task"] in _MINIMAX_H3_DECODER_TASKS

Type guard

def is_decoder_task(t) -> bool:
    return isinstance(t, str) and t in _MINIMAX_H3_DECODER_TASKS

Prevention

When it happens

Trigger: Passing task values like 't2v', 'i2a', an enum, or None-but-not-really (e.g. a dict) via the resolved plan or canonical request when the MiniMaxH3DecodingStage runs.

Common situations: Typos or renamed task identifiers after upgrading the model package; constructing canonical requests with task ids from a different model family.

Related errors


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