sgl-project/sglang · error · ValueError
{rope_type=} not supported. Choose between 'interleaved' and
Error message
{rope_type=} not supported. Choose between 'interleaved' and 'split'. What it means
ValueError from the LTX-2 rotary embedding __init__: rope_type must be exactly 'interleaved' or 'split'. Any other string (typos, 'default', 'linear') is rejected at construction time.
Source
Thrown at python/sglang/multimodal_gen/runtime/models/adapter/ltx_2_connector.py:237
class LTX2RotaryPosEmbed1d(nn.Module):
"""
1D rotary positional embeddings (RoPE) for the LTX 2.0 text encoder connectors.
"""
def __init__(
self,
dim: int,
base_seq_len: int = 4096,
theta: float = 10000.0,
double_precision: bool = True,
rope_type: str = "interleaved",
num_attention_heads: int = 32,
):
super().__init__()
if rope_type not in ["interleaved", "split"]:
raise ValueError(
f"{rope_type=} not supported. Choose between 'interleaved' and 'split'."
)
self.dim = dim
self.base_seq_len = base_seq_len
self.theta = theta
self.double_precision = double_precision
self.rope_type = rope_type
self.num_attention_heads = num_attention_heads
def forward(
self,
batch_size: int,
pos: int,
device: Union[str, torch.device],
dtype: Optional[torch.dtype] = None,
) -> Tuple[torch.Tensor, torch.Tensor]:
# 1. Get 1D position idsView on GitHub (pinned to 0132848349)
Solutions
- Use exactly 'interleaved' or 'split'
- Normalize incoming config: rope_type.strip().lower() and map known aliases before passing
- Validate config values at load time with a clear error
Example fix
// before rope_type="Interleaved" // after rope_type="interleaved"
Defensive patterns
Strategy: validation
Validate before calling
rope_type = rope_type.strip().lower()
assert rope_type in {"interleaved", "split"}, rope_type Type guard
def is_valid_rope_type(v: str) -> TypeGuard[str]:
return isinstance(v, str) and v in {"interleaved", "split"} Prevention
- Whitelist-validate rope_type at config load
- Map aliases from other repos to these two values
When it happens
Trigger: Constructing the rotary module with rope_type='half'/'rope'/'interleaved ' (typo/case/whitespace) or a value ported from another codebase's naming scheme.
Common situations: Converting configs from other video-model repos that use different rope naming; case sensitivity ('Interleaved'); trailing whitespace from config parsing.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Expected x.shape[-1] to be even for split rotary, got {last}
- head_dim must be a multiple of 8, got {head_dim}.
- num_frames/height/width must be provided for RoPE coordinate
- audio_num_frames must be provided for RoPE coordinate genera
- rope_pool_fused expects q/k/v to be 3-D
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/8e1557cca2bfa011.
Report an issue: GitHub.