sgl-project/sglang · error · Error

Unsupported content type ${header.content_type}

Error message

Unsupported content type ${header.content_type}

What it means

Identical to the float32 case but in the Half branch: deterministic_all_reduce packs fp16 elements into P::size vectors and requires out.numel() divisible by that width.

Source

Thrown at python/sglang/multimodal_gen/apps/realtime_webui/decoder_worker.js:144

      height: decoded.height,
      chunk: Number(header.chunk_index),
      frame_type: decoded.frame_type,
      frames: decoded.frames,
    };
  } else if (header.content_type === RAW_RGB_CONTENT_TYPE) {
    rawPayload = new Uint8Array(payload);
    const frameBytes = Number(header.bytes_per_frame);
    const count = Number(header.num_frames);
    lastFrame = count > 0
      ? rawPayload.slice((count - 1) * frameBytes, count * frameBytes)
      : null;
  } else if (
    header.content_type === RAW_RGB_DELTA_GZIP_CONTENT_TYPE ||
    header.content_type === RAW_RGBA_DELTA_GZIP_CONTENT_TYPE
  ) {
    rawPayload = await restoreDeltaGzipFrames(header, payload);
  } else {
    throw new Error(`Unsupported content type ${header.content_type}`);
  }

  return {
    id: header.__decode_id,
    width: Number(header.width),
    height: Number(header.height),
    chunk: Number(header.chunk_index),
    frames: rawFramesToRgbaBuffers(header, rawPayload),
  };
}

self.onmessage = async (event) => {
  const message = event.data;
  try {
    if (message.type === "reset") {
      reset();
      return;
    }

View on GitHub (pinned to 0132848349)

Solutions

  1. Pad input to a multiple of the pack width, reduce, then slice
  2. Ensure hidden size is a multiple of 8
  3. Fall back to RCCL for this tensor
Defensive patterns

Strategy: validation

Validate before calling

d = 8  # fp16 pack width
assert out.numel() % d == 0, f'size must be multiple of {d}'

Prevention

When it happens

Trigger: Calling deterministic_all_reduce with a float16 tensor whose element count is not a multiple of the pack width.

Common situations: fp16 serving with hidden sizes or slices not divisible by the pack width (commonly 8).

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/783ee6e71780a7ac. Report an issue: GitHub.