sgl-project/sglang · critical · Exception
{output_batch.error}
Error message
{output_batch.error} What it means
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.
Source
Thrown at python/sglang/multimodal_gen/runtime/entrypoints/diffusion_generator.py:321
results: list[GenerationResult] = []
total_start_time = time.perf_counter()
global_output_index = 0
for requests in request_groups:
try:
timer_prompt = [req.prompt for req in requests]
logger.info("Processing %d grouped request(s)", len(requests))
with ExitStack() as stack:
for req in requests:
stack.enter_context(trace_req(req.trace_ctx))
timer = stack.enter_context(
log_generation_timer(logger, timer_prompt)
)
output_batch = self._send_to_scheduler_and_wait_for_response(
requests
)
if output_batch.error:
raise Exception(f"{output_batch.error}")
if (
output_batch.output is None
and output_batch.output_file_paths is None
):
logger.error("Received empty output from scheduler")
continue
if requests[0].save_output and requests[0].return_file_paths_only:
output_file_paths = output_batch.output_file_paths or []
self._validate_output_count(
len(output_file_paths), len(requests)
)
for idx, path in enumerate(output_file_paths):
req = requests[idx]
if req.data_type == DataType.VIDEO:
req.sampling_params.validate_video_final_outputs(
[path], reqView on GitHub (pinned to 0132848349)
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
Defensive patterns
Strategy: try-catch
Try / catch
try:
out = generator.generate(prompt=p)
except Exception as e:
logger.error("scheduler failure: %s", e)
# inspect scheduler logs / reduce batch before retrying Prevention
- 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
When it happens
Trigger: 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.
Common situations: GPU OOM with large batch/image sizes; model weights or VAE missing or mismatched; corrupted input image; scheduler process restarted mid-request.
Related errors
- {response.error}
- action policy returned no output
- Expected {request_count} outputs, got {output_count} from sc
- {failure_msg}: {error_msg}
- Subclasses of BaseScheduler must define '{attr}' property
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/a5db87702355e410.
Report an issue: GitHub.