sgl-project/sglang · error · RuntimeError

Unsupported ltx25_decoder_rope dtype: {dtype}

Error message

Unsupported ltx25_decoder_rope dtype: {dtype}

What it means

The LTX2.5 decoder RoPE JIT kernel is compiled only for bfloat16 inputs; any other dtype is rejected before JIT loading.

Source

Thrown at python/sglang/kernels/ops/diffusion/rope/ltx25_decoder_rope_jit.py:17

from __future__ import annotations

from typing import TYPE_CHECKING

import torch

from sglang.kernels.jit.utils import cache_once, load_jit, make_cpp_args
from sglang.srt.utils.custom_op import register_custom_op

if TYPE_CHECKING:
    from tvm_ffi.module import Module


@cache_once
def _jit_ltx25_decoder_rope_module(dtype: torch.dtype) -> Module:
    if dtype is not torch.bfloat16:
        raise RuntimeError(f"Unsupported ltx25_decoder_rope dtype: {dtype}")
    args = make_cpp_args(dtype)
    return load_jit(
        "diffusion_ltx25_decoder_rope",
        *args,
        cuda_files=["diffusion/ltx25_decoder_rope.cuh"],
        cuda_wrappers=[
            (
                "ltx25_decoder_rope",
                f"ltx25_decoder_rope::LTX25DecoderRopeKernel<{args}>::run",
            ),
        ],
    )


def _fake_impl(
    q: torch.Tensor,
    k: torch.Tensor,
    cos_t: torch.Tensor,

View on GitHub (pinned to 0132848349)

Solutions

  1. Load the LTX2.5 model with torch.bfloat16.
  2. Cast hidden states to bfloat16 before the call.
  3. Fall back to a reference PyTorch RoPE if fp16 is mandatory.

Example fix

// before
h = h.to(torch.float16)
// after
h = h.to(torch.bfloat16)
out = fused_ltx25_decoder_rope(h, cos, sin)
Defensive patterns

Strategy: validation

Validate before calling

h = h.bfloat16() if h.dtype is not torch.bfloat16 else h

Type guard

def is_bf16(t: torch.Tensor) -> bool:
    return t.dtype is torch.bfloat16

Prevention

When it happens

Trigger: Calling fused_ltx25_decoder_rope with float16 or float32 hidden states.

Common situations: LTX video model loaded in fp16 (e.g. variant='fp16' checkpoints) instead of bf16.

Related errors


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