{"record":{"id":"99eb4aacae24a226","repo":"sgl-project/sglang","slug":"step3-vl-image-item-is-missing-num-patches-99eb4a","errorCode":null,"errorMessage":"Step3-VL image item is missing num_patches.","messagePattern":"Step3-VL image item is missing num_patches\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/models/step3_vl_10b.py","lineNumber":494,"sourceCode":"\n        return torch.cat(tuple(self._flatten_embeddings(t) for t in embeddings))\n\n    def _process_image_features(self, image_features: torch.Tensor) -> torch.Tensor:\n        image_features, _ = self.vit_large_projector(image_features)\n        return image_features\n\n    def get_image_feature(self, items: List[MultimodalDataItem]) -> torch.Tensor:\n        # Phase 1: Collect thumbnails and patches separately (different resolutions).\n        all_thumbnails = []\n        all_patches = []\n        # Per-item metadata: (thumb_count, num_patches_list, patch_count)\n        item_metadata = []\n\n        for item in items:\n            pixel_values = item.feature.type(self.vision_model.dtype)\n            num_patches = item.model_specific_data.get(\"num_patches\")\n            if num_patches is None:\n                raise ValueError(\"Step3-VL image item is missing num_patches.\")\n            if isinstance(num_patches, torch.Tensor):\n                num_patches = [int(x) for x in num_patches.flatten().cpu().tolist()]\n            elif isinstance(num_patches, (list, tuple)):\n                num_patches = [\n                    int(x.item()) if isinstance(x, torch.Tensor) else int(x)\n                    for x in num_patches\n                ]\n            else:\n                num_patches = [int(num_patches)]\n\n            patch_pixel_values = item.model_specific_data.get(\n                \"patch_pixel_values\", None\n            )\n            if patch_pixel_values is not None and patch_pixel_values.shape[0] == 0:\n                patch_pixel_values = None\n            if patch_pixel_values is not None:\n                patch_pixel_values = patch_pixel_values.type(\n                    self.vision_model.dtype","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/step3_vl_10b.py#L476-L512","documentation":"Identical to the step3_vl check: get_image_feature for step3-vl-10b requires num_patches in each image item's model_specific_data; without it, patch-count-driven feature assembly cannot proceed.","triggerScenarios":"Serving step3-vl-10b with image items lacking model_specific_data['num_patches'] (processor/model version mismatch or manual item construction).","commonSituations":"Mixed-version sglang installs, custom input pipelines, or older preprocessing configs for the 10B variant.","solutions":["Update sglang so preprocessing emits num_patches","Set item.model_specific_data['num_patches'] from the processor output when building items manually","Re-run inputs through the server's standard multimodal preprocessing"],"exampleFix":"# before\nitem.model_specific_data = {}\n# after\nitem.model_specific_data = {\"num_patches\": num_patches_list}","handlingStrategy":"validation","validationCode":"for item in items:\n    assert item.model_specific_data.get(\"num_patches\") is not None","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Same-release processor+model; attach num_patches when building items"],"tags":["step3-vl-10b","multimodal","metadata"],"backgroundTag":"missing-multimodal-metadata","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}