sgl-project/sglang · error · ValueError

task {task!r} resolves outside partition {self.partition!r}

Error message

task {task!r} resolves outside partition {self.partition!r}

What it means

canonical_task resolves a requested task through aliases and then verifies the canonical name both is declared and maps back to the loaded partition. This error fires in forward when the task name is declared but partition_for_task places it in the other partition (fl2va vs ref2va).

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/release_metadata.py:129

            if target not in metadata.tasks:
                raise ValueError(
                    f"task alias {alias!r} targets undeclared task {target!r}"
                )
            if canonical_minimax_h3_task(alias) != target:
                raise ValueError(
                    f"unsupported task alias mapping {alias!r} -> {target!r}"
                )
        return metadata

    @property
    def sigma_shift_scales(self) -> dict[str, float]:
        return {"video": self.video_sigma_shift, "audio": self.audio_sigma_shift}

    def canonical_task(self, task: str) -> str:
        normalized = task.strip().lower()
        canonical = self.task_aliases.get(normalized, normalized)
        if canonical not in self.tasks:
            raise ValueError(
                f"task {task!r} is not served by MiniMax H3 partition {self.partition!r}; "
                f"supported tasks: {list(self.tasks)!r}"
            )
        if partition_for_task(canonical) != self.partition:
            raise ValueError(
                f"task {task!r} resolves outside partition {self.partition!r}"
            )
        return canonical


class MiniMaxH3PartitionAdmissionStage(PipelineStage):
    def __init__(self, metadata: MiniMaxH3ReleaseMetadata) -> None:
        super().__init__()
        self.metadata = metadata

    def forward(self, batch: Req, server_args: ServerArgs) -> Req:
        task = None if batch.sampling_params is None else batch.sampling_params.task
        if not isinstance(task, str) or not task.strip():

View on GitHub (pinned to 0132848349)

Solutions

  1. Deploy the checkpoint whose partition matches the requested task (check _minimax_h3.partition in model_index.json)
  2. Fix the task string or alias in the request to one this partition serves
  3. Serve both partitions if you need both task families

Example fix

// before
response = partition.forward(task="t2v", ...)  # on ref2va weights

// after
response = ref2va_partition.forward(task=partition.canonical_task("ref2v"), ...)
Defensive patterns

Strategy: try-catch

Try / catch

try:
    task = meta.canonical_task(requested)
except ValueError as e:
    return unsupported_task(str(e))

Prevention

When it happens

Trigger: Sending a request whose task string (after alias resolution) belongs to the other partition, e.g. asking a ref2va checkpoint to serve a fl2va task at forward time.

Common situations: Single checkpoint deployed for the wrong workload, client reusing task names across model versions, or alias table drift between releases.

Related errors


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