sgl-project/sglang · critical · ValueError

{type(self.model)} does not support pipeline parallel yet!

Error message

{type(self.model)} does not support pipeline parallel yet!

What it means

Pipeline parallel in the Transformers backend requires an explicit pp plan on the model class; with pp world_size>1 and no plan, pipeline_parallel raises because layer splitting points are unknown.

Source

Thrown at python/sglang/srt/models/transformers.py:851

        except AttributeError:
            return None

    def _set_submodule(self, name: str, module: nn.Module):
        if "." in name:
            parent_name, child_name = name.rsplit(".", 1)
            parent_module = self.model.get_submodule(parent_name)
        else:
            parent_module = self.model
            child_name = name
        setattr(parent_module, child_name, module)

    def pipeline_parallel(self):
        if self.pp_group.world_size <= 1:
            return

        pp_plan = self._get_model_pp_plan()
        if not pp_plan:
            raise ValueError(
                f"{type(self.model)} does not support pipeline parallel yet!"
            )

        pp_keys = [re.sub(r"^model\.", "", name) for name in pp_plan.keys()]
        module_list_idx = None
        module_list_name = None
        for idx, name in enumerate(pp_keys):
            if isinstance(self._get_submodule_or_none(name), nn.ModuleList):
                if module_list_idx is not None:
                    raise ValueError(
                        "Pipeline parallel with multiple ModuleList blocks is not supported."
                    )
                module_list_idx = idx
                module_list_name = name

        if module_list_idx is None or module_list_name is None:
            raise ValueError(f"Could not find ModuleList in {type(self.model)}.")

View on GitHub (pinned to 0132848349)

Solutions

  1. Run with pp-size 1
  2. Use a natively supported sglang architecture for pipeline parallelism
  3. Define a pp plan on the model class marking the decoder ModuleList boundary

Example fix

# before
--pp 2 on model without pp plan
# after
--pp 1 (or use architecture with defined pp plan)
Defensive patterns

Strategy: validation

Validate before calling

pp = get_args().pipeline_parallel_size
plan = getattr(HFModelCls, '_pp_plan', None)
assert pp == 1 or plan, 'no pp plan; run with pp=1'

Prevention

When it happens

Trigger: Launching with --pipeline-parallel-size >1 a model lacking a pp plan (_pp_plan/base_model_pp_plan).

Common situations: Trying PP on architectures only validated for TP; using the generic backend where only specific models define pipeline points.

Related errors


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