{"record":{"id":"a5db87702355e410","repo":"sgl-project/sglang","slug":"output-batch-error","errorCode":null,"errorMessage":"{output_batch.error}","messagePattern":"\\{output_batch\\.error\\}","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"python/sglang/multimodal_gen/runtime/entrypoints/diffusion_generator.py","lineNumber":321,"sourceCode":"        results: list[GenerationResult] = []\n        total_start_time = time.perf_counter()\n        global_output_index = 0\n\n        for requests in request_groups:\n            try:\n                timer_prompt = [req.prompt for req in requests]\n                logger.info(\"Processing %d grouped request(s)\", len(requests))\n                with ExitStack() as stack:\n                    for req in requests:\n                        stack.enter_context(trace_req(req.trace_ctx))\n                    timer = stack.enter_context(\n                        log_generation_timer(logger, timer_prompt)\n                    )\n                    output_batch = self._send_to_scheduler_and_wait_for_response(\n                        requests\n                    )\n                    if output_batch.error:\n                        raise Exception(f\"{output_batch.error}\")\n\n                    if (\n                        output_batch.output is None\n                        and output_batch.output_file_paths is None\n                    ):\n                        logger.error(\"Received empty output from scheduler\")\n                        continue\n\n                    if requests[0].save_output and requests[0].return_file_paths_only:\n                        output_file_paths = output_batch.output_file_paths or []\n                        self._validate_output_count(\n                            len(output_file_paths), len(requests)\n                        )\n                        for idx, path in enumerate(output_file_paths):\n                            req = requests[idx]\n                            if req.data_type == DataType.VIDEO:\n                                req.sampling_params.validate_video_final_outputs(\n                                    [path], req","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/entrypoints/diffusion_generator.py#L303-L339","documentation":"Raised in DiffusionGenerator.generate after _send_to_scheduler_and_wait_for_response returns an OutputBatch whose error field is set. This means the scheduler/worker side of the diffusion pipeline reported a failure (model load error, inference exception, OOM, etc.) and the error string is propagated verbatim to the caller.","triggerScenarios":"Any generate() call where the scheduler returns a non-None output_batch.error — e.g. worker crash during denoising, CUDA OOM, invalid latent shape, or an upstream preprocessing failure in the multimodal pipeline.","commonSituations":"GPU OOM with large batch/image sizes; model weights or VAE missing or mismatched; corrupted input image; scheduler process restarted mid-request.","solutions":["Read the inner error string — it carries the actual scheduler-side cause","Check scheduler logs for the traceback preceding this exception","Reduce batch size, image resolution, or number of inference steps if OOM","Verify model path/config and that input images are valid and readable"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    out = generator.generate(prompt=p)\nexcept Exception as e:\n    logger.error(\"scheduler failure: %s\", e)\n    # inspect scheduler logs / reduce batch before retrying","preventionTips":["Keep an eye on scheduler logs during generation","Reduce batch size / resolution near GPU memory limits","Treat the message text as a pointer to the real worker-side cause, not the cause itself"],"tags":["scheduler","inference-failure","diffusion","runtime-error"],"backgroundTag":"backend-inference-error","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}