{"record":{"id":"23565ccace9703d4","repo":"sgl-project/sglang","slug":"step3-vl-image-item-has-num-patches-0-but-no-pat-23565c","errorCode":null,"errorMessage":"Step3-VL image item has num_patches > 0 but no patch_pixel_values.","messagePattern":"Step3-VL image item has num_patches > 0 but no patch_pixel_values\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/models/step3_vl_10b.py","lineNumber":557,"sourceCode":"        patch_offset = 0\n        for thumb_count, num_patches_list, patch_count in item_metadata:\n            item_thumb_features = all_thumb_features[\n                thumb_offset : thumb_offset + thumb_count\n            ]\n            thumb_offset += thumb_count\n            item_patch_features = (\n                all_patch_features[patch_offset : patch_offset + patch_count]\n                if patch_count > 0\n                else None\n            )\n            patch_offset += patch_count\n\n            cur_patch_idx = 0\n            for i, num_patch in enumerate(num_patches_list):\n                cur_feature = []\n                if num_patch > 0:\n                    if item_patch_features is None:\n                        raise ValueError(\n                            \"Step3-VL image item has num_patches > 0 but no patch_pixel_values.\"\n                        )\n                    patch_slice = item_patch_features[\n                        cur_patch_idx : cur_patch_idx + num_patch\n                    ]\n                    cur_feature.append(patch_slice.view(-1, patch_slice.shape[-1]))\n                cur_feature.append(\n                    item_thumb_features[i].view(-1, item_thumb_features.shape[-1])\n                )\n                cur_patch_idx += num_patch\n                merged_image_features.append(\n                    torch.cat(cur_feature) if len(cur_feature) > 1 else cur_feature[0]\n                )\n        return self._flatten_embeddings(merged_image_features)\n\n    def pad_input_ids(self, input_ids: List[int], mm_inputs: MultimodalInputs):\n        pattern = MultiModalityDataPaddingPatternMultimodalTokens()\n        return pattern.pad_input_tokens(input_ids, mm_inputs)","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/step3_vl_10b.py#L539-L575","documentation":"Step3-VL-10B mirror of the patch-feature guard: an image with num_patch > 0 must come with patch pixel features; when item_patch_features is None the loop raises ValueError because patch features are required to assemble the output.","triggerScenarios":"num_patches_list containing positive counts while patch pixel features are missing for that item in step3_vl_10b.get_image_feature (python/sglang/srt/models/step3_vl_10b.py:557).","commonSituations":"Preprocessor emitting patch counts but not patch pixels across versions; trimming patch inputs manually; DP/EP pipelines dropping the patch tensor.","solutions":["Provide patch_pixel_values/patch features for every image with num_patches > 0","Zero out num_patches when patch inputs are intentionally omitted","Keep processor and model code from the same release"],"exampleFix":"# before\nitem.model_specific_data = {\"num_patches\": [2, 1]}\n# after\nitem.model_specific_data = {\"num_patches\": [2, 1], \"patch_pixel_values\": patches}","handlingStrategy":"validation","validationCode":"assert item_patch_features is not None or all(n == 0 for n in num_patches_list)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never emit positive num_patches without patch pixel tensors"],"tags":["step3-vl-10b","multimodal","patches"],"backgroundTag":"missing-multimodal-metadata","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}