{"record":{"id":"1c32fbc0d4e10cf5","repo":"sgl-project/sglang","slug":"unsupported-ltx25-decoder-rope-dtype-dtype","errorCode":null,"errorMessage":"Unsupported ltx25_decoder_rope dtype: {dtype}","messagePattern":"Unsupported ltx25_decoder_rope dtype: (.+?)","errorType":"validation","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/kernels/ops/diffusion/rope/ltx25_decoder_rope_jit.py","lineNumber":17,"sourceCode":"from __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nimport torch\n\nfrom sglang.kernels.jit.utils import cache_once, load_jit, make_cpp_args\nfrom sglang.srt.utils.custom_op import register_custom_op\n\nif TYPE_CHECKING:\n    from tvm_ffi.module import Module\n\n\n@cache_once\ndef _jit_ltx25_decoder_rope_module(dtype: torch.dtype) -> Module:\n    if dtype is not torch.bfloat16:\n        raise RuntimeError(f\"Unsupported ltx25_decoder_rope dtype: {dtype}\")\n    args = make_cpp_args(dtype)\n    return load_jit(\n        \"diffusion_ltx25_decoder_rope\",\n        *args,\n        cuda_files=[\"diffusion/ltx25_decoder_rope.cuh\"],\n        cuda_wrappers=[\n            (\n                \"ltx25_decoder_rope\",\n                f\"ltx25_decoder_rope::LTX25DecoderRopeKernel<{args}>::run\",\n            ),\n        ],\n    )\n\n\ndef _fake_impl(\n    q: torch.Tensor,\n    k: torch.Tensor,\n    cos_t: torch.Tensor,","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/kernels/ops/diffusion/rope/ltx25_decoder_rope_jit.py#L1-L35","documentation":"The LTX2.5 decoder RoPE JIT kernel is compiled only for bfloat16 inputs; any other dtype is rejected before JIT loading.","triggerScenarios":"Calling fused_ltx25_decoder_rope with float16 or float32 hidden states.","commonSituations":"LTX video model loaded in fp16 (e.g. variant='fp16' checkpoints) instead of bf16.","solutions":["Load the LTX2.5 model with torch.bfloat16.","Cast hidden states to bfloat16 before the call.","Fall back to a reference PyTorch RoPE if fp16 is mandatory."],"exampleFix":"// before\nh = h.to(torch.float16)\n// after\nh = h.to(torch.bfloat16)\nout = fused_ltx25_decoder_rope(h, cos, sin)","handlingStrategy":"validation","validationCode":"h = h.bfloat16() if h.dtype is not torch.bfloat16 else h","typeGuard":"def is_bf16(t: torch.Tensor) -> bool:\n    return t.dtype is torch.bfloat16","tryCatchPattern":null,"preventionTips":["Load LTX2.5 checkpoints in bf16, not fp16 variants."],"tags":["jit","dtype","bfloat16","ltx","rope"],"backgroundTag":"unsupported-dtype-for-kernel","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}