{"record":{"id":"98321adb0df9d25f","repo":"sgl-project/sglang","slug":"could-not-find-modulelist-in-type-self-model","errorCode":null,"errorMessage":"Could not find ModuleList in {type(self.model)}.","messagePattern":"Could not find ModuleList in (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/models/transformers.py","lineNumber":868,"sourceCode":"        if not pp_plan:\n            raise ValueError(\n                f\"{type(self.model)} does not support pipeline parallel yet!\"\n            )\n\n        pp_keys = [re.sub(r\"^model\\.\", \"\", name) for name in pp_plan.keys()]\n        module_list_idx = None\n        module_list_name = None\n        for idx, name in enumerate(pp_keys):\n            if isinstance(self._get_submodule_or_none(name), nn.ModuleList):\n                if module_list_idx is not None:\n                    raise ValueError(\n                        \"Pipeline parallel with multiple ModuleList blocks is not supported.\"\n                    )\n                module_list_idx = idx\n                module_list_name = name\n\n        if module_list_idx is None or module_list_name is None:\n            raise ValueError(f\"Could not find ModuleList in {type(self.model)}.\")\n\n        keep_prefix_modules = self.pp_group.is_first_rank or (\n            getattr(self.text_config, \"tie_word_embeddings\", False)\n            and self.pp_group.is_last_rank\n        )\n        for name in pp_keys[:module_list_idx]:\n            if keep_prefix_modules:\n                continue\n            self._set_submodule(name, PPMissingLayer())\n            self._register_missing_prefix(maybe_prefix(\"model\", name))\n\n        layers = self.model.get_submodule(module_list_name)\n        self.start_layer, self.end_layer = get_pp_indices(\n            len(layers),\n            self.pp_group.rank_in_group,\n            self.pp_group.world_size,\n        )\n        for idx in range(len(layers)):","sourceCodeStart":850,"sourceCodeEnd":886,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/transformers.py#L850-L886","documentation":"Mirror of 5631: pipeline_parallel needs at least one ModuleList among the pp plan keys to know where to split layers; none found means the plan doesn't reference a layer stack.","triggerScenarios":"A pp plan whose keys are all plain modules (embeddings, norms) with no layers ModuleList.","commonSituations":"Hand-written or auto-derived pp plans omitting the decoder layers path; renamed layer module (e.g. 'blocks' vs 'layers') not in the plan keys.","solutions":["Add the decoder layer ModuleList path to the pp plan keys","Check the module name via named_modules() and correct the plan key","Use pp-size 1 or a native implementation"],"exampleFix":"# before\npp_plan = {\"model.embed_tokens\": 1}\n# after\npp_plan = {\"model.embed_tokens\": 1, \"model.layers\": \"loop\"}","handlingStrategy":"validation","validationCode":"ml = [k for k in pp_plan if isinstance(model.get_submodule(k), nn.ModuleList)]\nassert ml, 'pp plan has no ModuleList to split on'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm layer-stack module name via named_modules()","Include decoder layers path in every pp plan"],"tags":["pipeline-parallel","transformers-backend"],"backgroundTag":"unsupported-pp-topology","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}